Skip to content
Index / Guides / MCP & ChatGPT apps / MCP server for a REST API: generate from OpenAPI or hand-write?

MCP & ChatGPT apps guide

MCP server for a REST API: generate from OpenAPI or hand-write?

Updated 2026-10-26

Short answer: Generate a first draft from your OpenAPI spec to see the surface, then hand-curate: merge endpoints into task-shaped tools, rewrite descriptions, trim responses and hide admin endpoints.

Generator first, then curate

Curation checklist

Example tool over a REST endpoint

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({ name: "acme", version: "0.1.0" });

server.registerTool("list_invoices", {
  description: "List the signed-in user's invoices, newest first.",
  inputSchema: { status: z.enum(["open", "paid", "void"]).optional(), limit: z.number().max(50).default(20) },
  annotations: { readOnlyHint: true },
}, async ({ status, limit }) => {
  const r = await fetch(`https://api.acme.com/v1/invoices?limit=${limit}${status ? "&status=" + status : ""}`,
    { headers: { Authorization: `Bearer ${process.env.ACME_API_KEY}` } });
  if (!r.ok) return { isError: true, content: [{ type: "text", text: `Acme API error ${r.status}` }] };
  return { content: [{ type: "text", text: JSON.stringify(await r.json()) }] };
});

await server.connect(new StdioServerTransport());

Rate limits

Assistants can call tools in quick loops. Add a per-user limiter in the MCP server and return a clear "rate limited, retry in N seconds" error rather than passing raw 429s.

Cofounderbase build service

Get a free 2-minute demo of your product in Claude

Besides running this directory, our team builds MCP servers and ChatGPT apps for small SaaS. Send your product URL and we'll record a short video of it working inside Claude, built only from your public API docs. Free, no call needed. Pilots start at $1,500. This service is separate from the agency rankings, which it never affects.

Prefer email? Write to us. Want an outside agency instead? See agencies that do MCP work.

Agencies in our index that mention MCP work

Listed in their normal directory order. Our own build service is not part of this list or the rankings.

Questions

Which generators exist?

Several open-source projects turn OpenAPI specs into MCP servers. They are useful for prototypes; review the output before shipping.

GraphQL?

Same idea: write a few task-shaped tools with fixed queries instead of exposing arbitrary queries.

How many tools is too many?

There is no hard limit, but past about 20 to 30 tools quality usually drops. Start with fewer.

More MCP guides

Cost and effort figures on this page are rough estimates, not quotes.

CompareOpen shortlist