MCP Server Generator
Generate a working MCP server in TypeScript or Python with the official SDKs: tools, resources and prompts over stdio or HTTP, plus README and client config.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the MCP Server Generator?
Describe the tools your server should offer (names, descriptions and typed parameters), add optional resources and prompt templates, and pick TypeScript or Python and stdio or streamable HTTP. The generator writes a small, complete project: the server file, package.json and tsconfig.json or pyproject.toml, a .gitignore and a README with run, test and connect instructions.
Each tool handler starts as a TODO that echoes its arguments, so the server runs and answers from the first build; then you replace the echo with real work. Download every file in one zip or copy them one by one. The project is generated in your browser.
- TypeScript (SDK v2, Zod 4) or Python (SDK v2, MCPServer)
- stdio or streamable HTTP transport
- Tools with nested parameters, defaults and enums, plus resources and prompts
- package.json, tsconfig.json or pyproject.toml, README and .gitignore
- MCP Inspector commands and Claude Code and Claude Desktop config in the README
- One-click zip download built in the browser
Updated
How to use the MCP Server Generator
- Name the server and choose TypeScript or Python and stdio or streamable HTTP.
- Edit the example tools or add your own, with a clear description and typed parameters.
- Optionally add resources (read-only data at a URI) and prompts with {{arg}} placeholders.
- Fix anything the checks flag, then download the zip.
- Follow the README: install, build, test with MCP Inspector, and paste the client config into Claude, Cursor or another client.
Worked examples
TypeScript, stdio
Input
search_notes(query, tag?, limit = 10) and add_note(title, body, tags?)
Output
src/index.ts with registerTool and z.object({ query: z.string(), tag: z.string().optional(), limit: z.number().int().default(10) })Zod both validates arguments and produces the JSON Schema clients see in tools/list.
Python, streamable HTTP
Input
Same tools, Python, HTTP
Output
server.py with Annotated[int, Field(description=...)] = 10 and mcp.run(transport="streamable-http", port=8000)
Clients connect to http://127.0.0.1:8000/mcp.
Background and insight
The code targets the current official SDKs, checked on 1 November 2026. The TypeScript SDK's v2 line (@modelcontextprotocol/server, released for the 2026-07-28 protocol revision) registers tools with server.registerTool(name, { description, inputSchema }, handler), where inputSchema is a Zod 4 object; serveStdio runs a server factory over stdio, and createMcpHandler with the @modelcontextprotocol/node adapter serves it over streamable HTTP. The Python SDK's v2 line (package mcp) uses MCPServer with @mcp.tool(), @mcp.resource(uri) and @mcp.prompt() decorators, building the schema from type hints and docstrings.
All four combinations were built and exercised with MCP Inspector: the tools list with their schemas, calls return the echo, the resource reads back and the prompt fills in its argument. The HTTP versions bind to 127.0.0.1; the TypeScript one also puts the SDK's Host and Origin checks in front of the handler, which is what stops DNS-rebinding attacks against a local server.
stdio servers have one rule that catches most first attempts: stdout belongs to the protocol. A stray console.log or print corrupts the JSON-RPC stream, so the generated TypeScript logs with console.error and the README says to use logging in Python.
Common use cases
Exposing an internal API
Give Claude or Cursor a few well-described tools for your service.
Learning MCP
See how tools, resources and prompts map to code in both official SDKs.
Hackathons and prototypes
Get a runnable server in minutes and spend the time on the tool logic.
Team templates
Start every new server from the same layout, scripts and README.
Tips and limitations
- Design tools around user tasks rather than mirroring every endpoint; fewer, clearer tools work better.
- Return concise, relevant text. Large raw payloads fill the model's context and cost tokens.
- Read secrets from environment variables inside the server, never from tool arguments.
- Python tool names come from function names; the generator adds name= when your tool name is not a valid identifier.
- Resource URIs with {placeholders} need a template registration; the generator registers fixed URIs and warns about templates.
- Before exposing an HTTP server beyond localhost, add HTTPS and authentication.
Frequently asked questions
Should I use registerTool or tool in the TypeScript SDK?
registerTool. The v2 documentation uses it throughout: a name, a config with a description and a Zod inputSchema, and a handler. Examples that call tool() or wire StdioServerTransport by hand come from v1, and the v2 docs provide a codemod for migrating.
What is the import for FastMCP in the new Python SDK?
Version 2 of the official package calls the high-level class MCPServer: from mcp.server import MCPServer. The decorators @mcp.tool(), @mcp.resource() and @mcp.prompt() work as before.
How do I test an MCP server without an AI client?
Run MCP Inspector: npx @modelcontextprotocol/inspector node build/index.js opens a web UI where you can list and call tools, and --cli gives the same in a terminal. For Python, uv run mcp dev server.py opens it too.
stdio or streamable HTTP: which should I choose?
stdio for a server that runs on the user's machine and is started by the client. Streamable HTTP for a server many clients share or that you host, where you also need authentication.
Why does my stdio server fail to connect?
Usually something writes to stdout, the build was not run, or the path in the client config is relative. Log to stderr, build first and use an absolute path.
Does the generator need my API keys?
No. It writes code only. Your server reads any keys it needs from environment variables when it runs.
Is there an in-depth guide to the MCP Server Generator?
Yes. “How to Build an MCP Server in TypeScript or Python” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.