MCP Server Generator
Tutorial · No OpenAPI

How to Build an MCP Server Without OpenAPI

You do not need an OpenAPI spec to create an MCP server for Cursor or Claude Desktop. Describe each tool and its typed parameters in a form, choose TypeScript or Python, then download a ZIP with a stdio server, install steps, and host config. Handlers start as stubs—replace the TODOs with your real logic.

Want to skip the reading? Go straight to the homepage generator form.

How to build an MCP server

To build an MCP server, pick an official SDK (TypeScript @modelcontextprotocol/sdk or Python mcp), register each tool with a name, a description and a typed input schema, write a handler that returns text content, and connect a stdio transport. Then add the server's launch command to your host's config (Claude Desktop, Cursor) and restart the host. No OpenAPI spec is needed at any step.

  1. Choose a language and SDK. TypeScript with @modelcontextprotocol/sdk and Zod, or Python with mcp 2.x (MCPServer). Not sure what the server actually does for the host? What is an MCP server explains tools/list and tools/call first.
  2. Define your tools. One clear job per tool, a verb in the name, typed parameters. The MCP tool schema generator helps you draft them. Already have an OpenAPI spec? Use the OpenAPI to MCP converter instead.
  3. Write the handlers. Each handler receives validated arguments and returns { content: [{ type: "text", text }] } (TypeScript) or a string (Python). Calling a private REST API? Copy the tested handlers and error handling from build an MCP server for an internal API.
  4. Connect a stdio transport. Log to stderr only; anything printed to stdout breaks the protocol.
  5. Test it. List and call your tools with MCP Inspector before touching any host: see how to test an MCP server.
  6. Add it to your host. Paste the mcpServers entry with absolute paths and restart: connect an MCP server to Claude Desktop and Cursor.

Want to see the code first? Read a complete, tested MCP server example in TypeScript and Python. To skip the boilerplate, the free MCP Server Generator form does steps 1 to 4 for you and writes the host config into the README; the step-by-step below shows how.

What “without OpenAPI” means

MCP tools are a name + description + typed parameters (string, number, boolean)—not REST paths or HTTP methods. OpenAPI shines for large HTTP APIs; many first MCP servers are task tools, not a 1:1 map of every endpoint.

You don’t need a spec to get started: define a few task tools, connect Cursor or Claude Desktop, and confirm the server works end to end.

Form generator vs hand-written SDK vs OpenAPI converter

ApproachWhen to useStart here
Form generator A few task tools, no OpenAPI, want a ZIP with stdio + host config fast MCP Server Generator
Hand-written SDK Full control over handlers, learning the protocol step by step This page (steps below)
OpenAPI converter You already maintain an OpenAPI/Swagger spec and want real HTTP tools OpenAPI to MCP converter
AI coding agent + mcp-builder skill You want Claude Code or Codex to research an API and write the whole server, and you will review the result Agent route below
Side-by-side comparison Deciding form vs OpenAPI on one example API Form generator vs OpenAPI

Prerequisites

  • Runtime: Node.js 18+ for TypeScript, or Python 3.10+ for Python (the Python output needs mcp 2.x)
  • Host: Cursor or Claude Desktop
  • Generator: No account, no paid API key required to scaffold

Step-by-step

  1. Open the generator

    Go to the free MCP Server Generator and scroll to the form.

  2. Name the server

    Set a server name and one-line description for package metadata and host config.

  3. Add tools

    Define tools and parameters in the form—no YAML/JSON OpenAPI file.

  4. Choose language

    TypeScript (@modelcontextprotocol/sdk + Zod) or Python (mcp).

  5. Preview & download

    Generate to preview source, then download the ZIP.

  6. Install dependencies

    npm install or pip install -r requirements.txt.

  7. Paste host config

    Copy the README JSON into Cursor’s mcp.json, claude_desktop_config.json or Claude Code’s .mcp.json. Details and absolute-path variants: connect an MCP server to Claude Desktop and Cursor. For VS Code’s servers format or a quick syntax check, use the MCP config generator and validator.

  8. Replace the TODO and restart

    Every generated tool returns a placeholder that echoes its arguments, so the host can list and call it before you write any logic. Replace that one block per tool, test it, then restart the host and call the tool.

    Worked example. One tool, days_until, with one required string parameter date (description: "Target date, YYYY-MM-DD"). In TypeScript the form writes this handler:

      async ({ date }) => {
        // TODO: replace this placeholder with real logic for days_until
        return {
          content: [{ type: "text", text: "[days_until] " + "date=" + JSON.stringify(date) }],
        };
      }

    Replace it with the real logic. Bad input returns isError: true so the model reads the reason instead of a crash:

      async ({ date }) => {
        const target = new Date(date + "T00:00:00Z");
        if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || Number.isNaN(target.getTime()) || target.toISOString().slice(0, 10) !== date) {
          return { content: [{ type: "text", text: `Not a valid YYYY-MM-DD date: ${date}` }], isError: true };
        }
        const today = new Date(new Date().toISOString().slice(0, 10) + "T00:00:00Z");
        const days = Math.round((target.getTime() - today.getTime()) / 86_400_000);
        return { content: [{ type: "text", text: `${days} days until ${date} (UTC)` }] };
      }

    The Python version keeps the generated decorator and signature; only the body changes. Raising ToolError turns bad input into an error result:

    import datetime
    from mcp.server.mcpserver.exceptions import ToolError
    
    @mcp.tool(name="days_until", description="Count whole days from today until a date (YYYY-MM-DD)")
    def days_until(date: Annotated[str, Field(description="Target date, YYYY-MM-DD")]) -> str:
        try:
            target = datetime.date.fromisoformat(date)
        except ValueError:
            raise ToolError(f"Not a valid YYYY-MM-DD date: {date}")
        days = (target - datetime.datetime.now(datetime.timezone.utc).date()).days
        return f"{days} days until {target.isoformat()} (UTC)"

    What an MCP client saw when we called both servers over stdio on 2026-10-29 (Node 20.19.2 with @modelcontextprotocol/sdk 1.32.2 and tsc --strict clean; Python 3.13.5 with mcp 2.3.0):

    ArgumentsTypeScript resultPython result
    {"date": "2026-12-25"}57 days until 2026-12-25 (UTC)same text
    {"date": "2026-02-30"}isError: Not a valid YYYY-MM-DD date: 2026-02-30isError: Error executing tool days_until: Not a valid YYYY-MM-DD date: 2026-02-30
    {"date": "next friday"}isError: Not a valid YYYY-MM-DD date: next fridayisError, same message

    Without the extra round-trip check, JavaScript's Date silently rolls 2026-02-30 over to March 2. Run the same three calls yourself with the MCP Inspector CLI: how to test an MCP server.

Can an AI agent build the MCP server for you? (the mcp-builder skill)

Yes. Anthropic publishes an mcp-builder skill in its anthropics/skills repository. Once installed, Claude Code (or another agent that reads SKILL.md files) follows a four-phase playbook to research, write, test and evaluate an MCP server in TypeScript or Python. It writes everything, including the handlers, so you review more code than with a form.

Install it in Claude Code from the plugin marketplace the repository documents:

/plugin marketplace add anthropics/skills
/plugin install example-skills@anthropic-agent-skills

What the skill tells the agent to do, per its SKILL.md:

  1. Research and plan: read the MCP spec and the official SDK READMEs, study the target API, and choose tool names with a shared prefix (for example github_create_issue). When unsure, it prefers broad API coverage over a few workflow tools.
  2. Implement: Zod or Pydantic input schemas, an outputSchema where possible, actionable error messages, pagination, and tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). It recommends TypeScript, stdio for local servers and stateless Streamable HTTP for remote ones.
  3. Review and test: npm run build or python -m py_compile, then the MCP Inspector.
  4. Evaluate: write 10 realistic, read-only questions with verifiable answers to check whether a model can actually use the tools.
Form generator (this site)Agent + mcp-builder skill
What you give itTool names, descriptions, typed parametersA goal in plain words, usually an API to wrap
What you getThe same scaffold every time, with one marked TODO per toolA full implementation that differs from run to run
HandlersYou write them (see the worked example above)The agent writes them; you review them
NeedsA browser; no accountAn agent such as Claude Code, which needs a Claude account
Best forA few task tools you can describe nowWrapping a whole API or service

The two combine well. Generate the scaffold here so names, schemas and the host config are fixed, then ask the agent to fill in only the TODO handlers. That keeps the diff small enough to review.

What the ZIP contains

  • TypeScript: package.json, tsconfig.json, src/index.ts, README.md
  • Python: server.py, requirements.txt, pyproject.toml, README.md (the Python MCP server generator opens the same form on Python)
  • Each tool registered with typed parameters (Zod schema or Python type hints) and a placeholder handler that echoes its arguments
  • README with run commands and an mcpServers snippet for Cursor / Claude Desktop

Every file, line by line: MCP server template for TypeScript and Python.

It is a scaffold plus setup instructions, not a hosted service. The homepage form writes a local stdio server; the remote MCP server generator writes the same tools as a Streamable HTTP server with a Dockerfile that you deploy yourself.

When to skip OpenAPI (and when not)

  • Skip: prototypes, personal tools, small curated tool sets, no public HTTP API yet
  • Don’t skip: large existing REST APIs with a good OpenAPI you want to sync—prefer OpenAPI→MCP generators instead

See also: MCP Server Generator vs OpenAPI generators, which compares both routes on one example API. If you do have a spec, try the free OpenAPI to MCP converter.

Honest limitations

Limitations

This generator creates an MCP scaffold. Tools are registered with typed parameters, but handlers are placeholders. It does not invent an OpenAPI file, host your server, or replace careful tool design for large APIs.

  • Parameter types today: string, number, boolean (not full OpenAPI schemas)
  • No auth or multi-user deployment baked in
  • The homepage form writes stdio only; for HTTP use the remote MCP server generator and host it yourself

Try the free form

Describe tools → download TypeScript or Python → connect Cursor or Claude Desktop.

FAQ

Do I need OpenAPI to create an MCP server?

No. You can define tools and parameters in a form and generate TypeScript or Python source.

Will the generated server call my real API?

Not until you replace the TODO handlers. The ZIP scaffolds tools and types; business logic is yours.

Are Cursor and Claude Desktop both supported?

Yes—README includes JSON snippets for both (stdio).

TypeScript or Python?

Both; pick before generate.

Is it free?

Yes—no account, no checkout; you download and run locally.

When should I use an OpenAPI-based generator instead?

When you already maintain a solid OpenAPI for a large HTTP API and want bulk tool generation—see the comparison page.

How do I build an MCP server from scratch?

Install an official SDK (npm install @modelcontextprotocol/sdk zod, or pip install mcp), create a server object, register each tool with a name, description and input schema, and connect a stdio transport. A complete, tested two-tool example in TypeScript and Python is in the MCP server example. The generator form writes the same structure for your own tools.

How do I build an MCP server in Python?

Install mcp 2.x (pip install "mcp>=2.0.0"), create MCPServer("your-server"), decorate each function with @mcp.tool() so its type hints become the input schema and its docstring the description, and call mcp.run() to serve over stdio. On mcp 1.x the same class is FastMCP from mcp.server.fastmcp. Choose Python in the generator to get server.py, requirements.txt and pyproject.toml.

How do I build an MCP server for an API?

Each tool handler calls your API and returns the response as text content. If the API has an OpenAPI or Swagger spec, the OpenAPI to MCP converter maps its operations to tools and writes the HTTP calls for you. If it does not, define a few task-shaped tools in the form and fill in the handlers; the internal API guide shows env-based auth and readable errors.

Can Claude Code or Codex build an MCP server for me?

Yes. Install Anthropic's mcp-builder skill and ask the agent to build the server; it researches the API, writes TypeScript or Python, tests with the MCP Inspector and drafts evaluation questions. You review all of the generated code. A middle path is to generate the scaffold with the form and let the agent fill in only the TODO handlers.

How do I build an MCP server for Claude?

For Claude Desktop or Claude Code on your own machine, build a local stdio server and add its launch command to claude_desktop_config.json or the project's .mcp.json; the form writes that entry into the README. To offer it as a connector on claude.ai, Claude's docs ask for a remote server over Streamable HTTP that you host; start from the remote MCP server generator.

Is it hard to build an MCP server?

A minimal local server is small: one source file that registers tools and starts a stdio transport. The usual sticking points are printing to stdout (which corrupts the stdio protocol), relative paths in the host config (see connect to Claude Desktop and Cursor), and vague tool descriptions. Remote HTTP servers with authentication take more work.