Python MCP Server Generator
Generate a Python MCP server from a short form: name the server, list tools and typed parameters, then download a ZIP with server.py, pyproject.toml and host-config steps for Claude Desktop or Cursor. Defaults to the official mcp package (MCPServer), not FastMCP. Handlers are stubs you replace.
Build your Python MCP server
Loading Python preview…
What the Python ZIP uses
- Official
mcppackage (2.x):from mcp.server import MCPServerand@mcp.tool(...)decorators. Parameters useAnnotated[..., Field(description=...)]so tools/list gets clear JSON Schema. - Files:
server.py,requirements.txt(mcp>=2.0.0,pydantic>=2),pyproject.toml, and a README with venv, uv, MCP Inspector and host config steps. - Transport: local stdio only (what Claude Desktop and Cursor launch today). Not a remote Streamable HTTP server.
venv vs uv
After you download the ZIP, either environment manager works:
| Approach | Typical commands | Host config tip |
|---|---|---|
venv + pip |
python -m venv .venv then .venv/bin/pip install -r requirements.txt |
Point the host at .venv/bin/python (absolute path) and server.py. |
uv |
uv sync or uv run --directory /path/to/project python server.py |
README shows a uv run --directory command alternative; keep paths absolute. |
On Windows use .venv\Scripts\python.exe and escape backslashes in JSON. Prefer a dedicated interpreter over a bare python on PATH so the host does not pick a system Python without mcp installed.
MCPServer vs FastMCP
This generator writes an official MCPServer scaffold. FastMCP is a separate, widely used Python framework with richer helpers (including OpenAPI import). Choose FastMCP when you want that library and its docs; choose this page when you want a small boilerplate you can read end-to-end and wire into Claude Desktop or Cursor without adopting FastMCP.
If you already have an OpenAPI/Swagger spec and want HTTP handlers that call the API, use the OpenAPI to MCP converter instead of this form.
Limitations (honest)
- Scaffold, not production. Tool handlers echo arguments and leave a TODO. You must implement real logic, auth, timeouts and error handling.
- Not FastMCP unless you rewrite the project for that API. We compare the two above; we do not ship FastMCP code.
- Simple parameter types on this form: string, number, boolean. For enums, arrays, annotations or outputSchema, use the MCP tool schema generator.
- Stdio only. No remote HTTP transport in the ZIP. See the TypeScript and Python template guide for Streamable HTTP examples.
Next steps after download
- Install deps with venv or uv (table above).
- Smoke-test with MCP Inspector (
npx @modelcontextprotocol/inspector .venv/bin/python server.py). - Paste the README config into Claude Desktop or Cursor; the config generator can rewrite or validate it. Full paths guide: connect MCP server to Claude Desktop and Cursor.
- New to MCP? Read What is an MCP server? or the step-by-step how to create an MCP server without OpenAPI.
FAQ
How do I generate a Python MCP server?
Name the server, keep Language on Python (mcp), add tools with typed parameters, click Generate MCP server to preview server.py, then Download MCP server ZIP. Create a venv or use uv, install requirements, and paste the README mcpServers snippet into Claude Desktop or Cursor.
Does this use FastMCP or the official mcp MCPServer?
The ZIP uses the official mcp package's MCPServer API (decorator-style @mcp.tool with pydantic Field annotations), not FastMCP. FastMCP is a popular higher-level wrapper with its own docs and from_openapi helpers. Use FastMCP when you want that ecosystem; use this generator when you want a small, inspectable MCPServer scaffold you own.
Should I use venv or uv to run the generated Python MCP server?
Either works. python -m venv .venv then pip install -r requirements.txt is the classic path and matches the README absolute-path .venv/bin/python host config. uv sync or uv run --directory is faster and keeps dependencies locked; the README also shows a uv-based host command if you prefer that.
Are the generated Python tool handlers production-ready?
No. Each handler is a stub that echoes its arguments with a TODO. The scaffold wires tools/list and tools/call over stdio so you can connect and test quickly; replace the stubs with real logic before production. This is not a FastMCP production framework.
Can I still download a TypeScript MCP server from this page?
Yes. The language toggle still offers TypeScript (MCP SDK). This page lands on Python by default because that is the intent here; the home page defaults to TypeScript. Both languages use the same client-side generator.
Is anything I type into the form uploaded?
No. Preview and ZIP generation run in your browser with JavaScript. The form contents are not sent to a server. The site only records page views with Vercel Web Analytics.