Architecture Guide · MCP Build
How to Turn a REST or OpenAPI into a Production MCP Server for ChatGPT & Claude
Turning an existing REST API into a working MCP server is not a 1:1 OpenAPI conversion. The reliable approach is choosing one verifiable customer workflow, exposing up to eight LLM-tuned tools over Streamable HTTP with OAuth 2.0, verifying against real prompts on staging with MCP Inspector, and monitoring tools/list drift in production.
- • Start from one verifiable customer task (search catalogue -> check availability -> prepare a quote request) rather than mirroring every API route.
- • OpenAPI generators are useful only for a first draft; human engineering is still required to consolidate endpoints, tune tool descriptions, wire OAuth 2.0 and handle errors for LLMs.
- • Read-first tool design reduces security review friction while proving real customer value inside ChatGPT and Claude.
- • You can inspect a live public MCP implementation we built and run ourselves at webmcp-tool.com.
1. Start with one customer workflow, not your entire OpenAPI spec
The most common engineering mistake when building an MCP server is feeding an entire OpenAPI specification into an automatic generator. A SaaS API with 60 REST endpoints produces 60 overlapping MCP tools. That inflates every prompt's token overhead and confuses the model when choosing which tool to call.
Instead, pick one concrete task your customers already try to solve before talking to sales or support, and define a result you can verify against real data.
- Step A — Find the right item: search your catalogue, documentation or dataset using customer requirements.
- Step B — Check real-time facts: inspect stock, lead times, compatibility, or account status from your live API.
- Step C — Carry context forward: prepare a quote request, draft ticket or structured recommendation using the exact item and requirements already discussed.
2. Why OpenAPI-to-MCP generators are only step zero
Code generators save boilerplate, and we use them for initial scaffolding. Where they stop is precisely where production quality starts: collapsing multi-step REST calls into single intent-level tools, trimming noisy JSON responses so they fit cleanly in an assistant's context window, and returning actionable error messages.
| Layer | Auto-generated OpenAPI wrapper | Production MCP server |
|---|---|---|
| Tool count | 30–100+ raw CRUD endpoints | 3–8 intent-level tools mapped to real buyer questions |
| Payloads | Full nested database JSON (thousands of tokens) | Curated, structured fields the assistant can cite accurately |
| Descriptions | Terse backend notes ('Gets record by ID') | Clear usage triggers, constraints and explicit annotations |
| Authentication | Static bearer token pasted manually | OAuth 2.0 with scoped access and Dynamic Client Registration |
| Error handling | Raw 400/500 stack codes | Plain-language recovery hints the model can act on |
3. Architecture: Streamable HTTP, OAuth 2.0 and staging verification
For remote connectors used inside ChatGPT and Claude, expose your server over HTTPS using the Streamable HTTP transport on the current MCP SDK. Keep the MCP server as a thin, stateless or session-scoped adapter in front of your existing API so your core backend requires zero breaking changes.
Before any directory submission, deploy to a staging URL, inspect every tool in MCP Inspector, and test 15–20 real customer phrasings — including ambiguous questions, typos, out-of-stock queries, and missing required inputs.
- Isolate credentials: map each user's OAuth 2.0 token to narrow read/write scopes on your upstream API.
- Enforce per-user rate limits and timeouts so an agent loop cannot overload upstream services.
- Log tool name, latency and status codes for reliability without storing sensitive user prompt bodies unnecessarily.
- Test without an API? If you have no public API yet, build a clean read layer over your structured product catalogue, docs or website.
4. Firsthand implementation you can inspect: WebMCP Tool
We do not preach MCP architecture from slides — we run it on our own product. WebMCP Tool (webmcp-tool.com) is our website Agent Readiness scanner. Its public MCP server exposes website scoring and structured explanations as tools an assistant can call directly.
The workflow is deliberately narrow and verifiable: a user supplies a public URL, the assistant calls the scoring tool, and the server returns structured findings the assistant can explain clearly. Notice how one focused task beats ten speculative endpoints.
Inspect our live implementation at webmcp-tool.com, or check your own site's readiness first before planning an MCP server build.
5. Operations after launch: preventing tools/list drift
An MCP server is live software, not a static file. The MCP specification and SDKs evolve, directory policies update, and your upstream API changes over time. Schedule automated checks every five minutes on both the MCP handshake and the tools/list response so you know immediately if an endpoint breaks or a tool definition drifts.
Frequently asked questions
Straight answers on turn a rest api into an mcp server.
Do we have to modify our existing REST or GraphQL API to add MCP?
Usually no. An MCP server sits as an adapter layer in front of your existing API endpoints, translating assistant tool calls into authenticated requests and shaping the responses back into clean structured outputs.
What if our product does not have a public API yet?
You can still ship a useful read-only MCP server by exposing a structured read layer over your product catalogue, pricing tables, documentation or knowledge base. Read-only connectors are also the easiest to get approved in directories.
How long does a production MCP server take to build?
With a clear workflow scope, API documentation and a test account ready, a focused 8-tool MCP server with OAuth 2.0, staging and directory submission preparation takes 10 business days in our fixed-price Build.
Next step
Want one production workflow shipped in 10 business days?
The fixed-price Build ($4,900 USD) delivers up to 8 tools over your API or website, Streamable HTTP, OAuth 2.0, staging, 30 days of hosting and monitoring, the full Listing Sprint, and code in a repository you own.
Want to inspect our own live MCP implementation first? Check WebMCP Tool ↗
Continue reading
AI Directory ASO · Checklist
Claude Connectors Directory & ChatGPT Apps Submission Checklist (2026/2027)
The complete technical and AI-directory ASO checklist for getting your MCP server approved in the Claude Connectors Directory and ChatGPT Apps: Streamable HTTP, OAuth 2.0, tool annotations, descriptions, and test accounts.
Buyer Comparison · Pricing & ROI
Build an MCP Server In-House vs Agency vs Fixed-Price ($4,900): Honest Comparison
Compare building a Model Context Protocol (MCP) server in-house, hiring a software agency, or using a $4,900 fixed-price Build. Transparent breakdown of engineering hours, OAuth 2.0 pitfalls, timeline, and code ownership.