/python-mcp-development:python-mcp-server-generatorfrom python-mcp-development
Generates a complete Python MCP server project using uv, FastMCP, typed tools, optional resources/prompts, stdio or streamable-http transport, error handling, and testing setup.
Ships in python-mcp-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create a production-ready Python MCP server project with uv, mcp[cli], FastMCP, typed tools, validation, transport configuration, and runnable testing instructions.
| File or element | Required | Purpose |
|---|---|---|
pyproject.toml | Yes | uv init project-name creates Python project metadata. |
mcp[cli] dependency | Yes | uv add "mcp[cli]" installs the MCP SDK and CLI helpers. |
server.py | Yes | Main server using FastMCP from mcp.server.fastmcp. |
.gitignore | Yes | Python cache, virtualenv, build, and local env exclusions. |
if __name__ == "__main__" | Yes | Allows direct execution. |
| README or usage notes | Yes | Shows run, inspect, and install commands. |
uv init project-name
cd project-name
uv add "mcp[cli]"
Create the server entry point, commonly server.py, and configure direct execution.
| Choice | Recommendation |
|---|---|
| Server class | Use FastMCP from mcp.server.fastmcp. |
| Server name | Set a clear name and optional instructions. |
| Local transport | Use stdio by default for local desktop or CLI clients. |
| Remote transport | Use streamable-http for remote clients. |
| HTTP options | Configure host, port, stateless_http=True for scalability, json_response=True when JSON responses are required, and CORS only for trusted browser clients. |
| ASGI integration | Mount to existing Starlette or FastAPI apps when the server is part of a larger web service. |
For HTTP testing, connect clients to http://localhost:PORT/mcp.
| Rule | Why |
|---|---|
Decorate tools with @mcp.tool() | Registers callable MCP tools. |
| Type every parameter and return value | Type hints generate schemas automatically. |
| Write clear docstrings | Docstrings become tool descriptions. |
| Use Pydantic models or TypedDicts for structured output | Keeps responses schema-safe. |
| Use async functions for I/O-bound work | Avoids blocking the server. |
| Validate inputs early | Produces clear errors and safer tools. |
| Raise or return clear errors | Helps clients remediate failures. |
| Log to stderr or use Context logging | Avoids stdout pollution in stdio servers. |
| Clean up resources with context managers or lifespan hooks | Prevents leaked connections. |
| Capability | Decorator or API | Use when |
|---|---|---|
| Resources | @mcp.resource() | Clients need read-only data exposed by URI. |
| Dynamic resources | URI templates such as resource://{param} | Resource identity depends on a parameter. |
| Prompts | @mcp.prompt() | Reusable prompt templates help clients invoke workflows. |
| Context | Context logging, progress, and notifications | Long-running or observable operations need status. |
| Sampling | LLM sampling | A tool intentionally delegates generation to a model. |
| Elicitation | User input elicitation | A workflow needs interactive user input. |
| Lifespan | Lifespan management | Shared databases, connections, or clients must be initialized and closed. |
| Image handling | Image class | Tools return or process images. |
| Completion | Completion support | Better UX for constrained or discoverable arguments. |
| Scenario | Command |
|---|---|
| Run stdio server directly | python server.py or uv run server.py |
| Run MCP Inspector | uv run mcp dev server.py |
| Install to Claude Desktop | uv run mcp install server.py |
| Run HTTP server | python server.py, then connect to http://localhost:PORT/mcp |
Test tools independently before relying on LLM integration. Include example tool invocations in the generated README.
The optional Resource/Prompt section can use URI templates like "resource://{param}". HTTP servers can mount into Starlette/FastAPI; I/O code should use async/await.
## Python MCP server generated
**Status:** complete | blocked
**Project:** `<project-name>`
**Transport:** `stdio | streamable-http`
### Files created
| File | Purpose |
| --- | --- |
| `pyproject.toml` | `<dependencies and metadata>` |
| `server.py` | `<FastMCP server and tools>` |
| `.gitignore` | `<Python ignores>` |
| `README.md` | `<run/test/install instructions>` |
### Validation
- `uv run mcp dev server.py`: `<pass/fail/not run>`
- Direct run: `<pass/fail/not run>`
- Example tool invocation: `<pass/fail/not run>`
uv init project-name or equivalent uv structure.mcp[cli] was added with uv add "mcp[cli]".FastMCP from mcp.server.fastmcp.streamable-http.@mcp.tool() has type hints, docstring, validation, and error handling.@mcp.resource() and @mcp.prompt() are included only when useful.uv run mcp dev server.py, uv run mcp install server.py, and direct run instructions.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin python-mcp-developmentOther plugins' skills for the same job