MCP Overview
The Subscriptions Engine ships with a companion MCP (Model Context Protocol) server athttps://mcp.oluwadunsin.dev/mcp. It lets any MCP-aware client — Claude Desktop, Claude web, Cursor, Codex, ChatGPT connectors — call the engine’s REST API through structured tools instead of hand-crafted HTTP requests.
The server is a thin translation layer. Every tool call is forwarded to the existing REST API using the merchant’s X-Api-Key, so tenant isolation, validation, and every downstream side effect (webhooks, emails, DB writes) continue to run through the same middleware and services that back the public API.
What you get
| Category | Count | Purpose |
|---|---|---|
| Tools | 15 | Query, analyze, act, or generate reports on subscription data. |
| Resources | 4 static + 1 template | Read-only URIs the client can browse (plans://all, customers://{emailOrCode}, …). |
| Prompts | 2 | Reusable multi-step workflows (monthly_business_review, subscription_health_check). |
Design
- Transport: Streamable HTTP. Works over standard HTTPS to any hosted MCP client.
- Endpoint:
https://mcp.oluwadunsin.dev/mcp. - Auth: the MCP client sends
X-Api-Key: <your merchant key>. The server relays that header to the engine unchanged. Requests without a key are rejected at the HTTP layer with401 unauthorizedbefore any tool logic runs. - Rate limit: per API key, token-bucket, 120 requests / minute by default. Exceeded budgets return
429withRetry-After. - Errors: tool failures are returned as a structured envelope
{ code, message, retryable }so clients can distinguishinvalid_input(never retry) fromengine_error(safe to retry). - Health:
GET https://mcp.oluwadunsin.dev/healthbypasses auth and is intended for load-balancer probes.
When to use the MCP vs the REST API
- REST API — programmatic integrations, merchant backends, automated systems.
- MCP server — AI agents, dashboards driven by natural language, one-off ops questions (“what’s my MRR”, “retry failed invoices from yesterday”, “why did churn go up”).
Next steps
- Connect a client — Claude Desktop, Cursor, Codex CLI, MCP Inspector.
- Explore the tools — 15 tools with their inputs and the endpoints they wrap.
- Resources and prompts — browsable URIs and reusable workflows.
- Security — auth, rate limits,
dry_runfor destructive tools, error envelope.
