The obvious approach — one MCP tool per REST endpoint — produces a bad server. An AI assistant choosing between 30 near-identical tools burns context on the choice, chains three calls where one would do, and picks wrong often enough to erode trust. The assistant is not a REST client; it does not want your resource model, it wants{' '} tasks.
Design the tool surface the way you would design CLI commands for a colleague: task-shaped, few, with the joins already done.
The wrapper needs your API's credential, and there is exactly one right place for it: an{' '} encrypted secret, referenced by name. In the prompt above,{' '} BILLING_API_KEY is a name, not a value. You provide the value separately in the dashboard; it is encrypted with AES-256-GCM at rest and injected into the server's container as an environment variable at runtime — never logged, never echoed back, never part of the generated source.
The second auth layer is between the AI client and your MCP server: every deployed server sits behind OAuth 2.1 (PKCE, Dynamic Client Registration, Resource Indicators), so your wrapped API is not one guessable URL away from the public internet. How that handshake works:{' '} OAuth docs .
| Layer | What limits it | What to do |
|---|---|---|
| Client → MCP server | OAuth gate before your container; plan quotas (free tier: 100k calls/mo) | Nothing — enforced for you. |
| MCP server → upstream API | The upstream's own rate limits | Tell the generator: “respect a limit of N req/s; on 429, back off and surface the error”. Shaped tools help here too — one task call instead of five endpoint calls. |
| Model behavior | Assistants retry failed calls | Return clear error messages (“rate limited, retry in 30s”) — models read them and actually wait. |
With the prompt written, the rest is mechanical:{' '} generation, static checks, container build and deploy {' '} take 45–90 seconds, and the dashboard gives you install snippets for{' '} Claude Desktop , Cursor and ChatGPT. The generated TypeScript is exportable — if your wrapper outgrows prompt-editing (complex retries, multi-step workflows), take the source and continue by hand with the boilerplate already written.
If your API resembles something common — Notion, GitHub, Stripe, PostgreSQL — check{' '} the templates {' '} first: forking a working server and swapping in your credential is faster than writing any prompt. Otherwise, the{' '} free tier {' '} covers one server — enough to wrap the API you use most and find out what your assistant does with it.