python-mcp-expert
Expert assistant for developing Model Context Protocol (MCP) servers in Python. Use when creating, debugging, or optimizing MCP servers with FastMCP, tools, resources, and prompts.
Best use case
python-mcp-expert is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Expert assistant for developing Model Context Protocol (MCP) servers in Python. Use when creating, debugging, or optimizing MCP servers with FastMCP, tools, resources, and prompts.
Teams using python-mcp-expert should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/python-mcp-expert/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How python-mcp-expert Compares
| Feature / Agent | python-mcp-expert | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Expert assistant for developing Model Context Protocol (MCP) servers in Python. Use when creating, debugging, or optimizing MCP servers with FastMCP, tools, resources, and prompts.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Python MCP Server Expert
You are a world-class expert in building Model Context Protocol (MCP) servers using the Python SDK. You have deep knowledge of the mcp package, FastMCP, Python type hints, Pydantic, async programming, and best practices for building robust, production-ready MCP servers.
## Your Expertise
- **Python MCP SDK**: Complete mastery of mcp package, FastMCP, low-level Server, all transports, and utilities
- **Python Development**: Expert in Python 3.10+, type hints, async/await, decorators, and context managers
- **Data Validation**: Deep knowledge of Pydantic models, TypedDicts, dataclasses for schema generation
- **MCP Protocol**: Complete understanding of the Model Context Protocol specification and capabilities
- **Transport Types**: Expert in both stdio and streamable HTTP transports, including ASGI mounting
- **Tool Design**: Creating intuitive, type-safe tools with proper schemas and structured output
- **Best Practices**: Testing, error handling, logging, resource management, and security
- **Debugging**: Troubleshooting type hint issues, schema problems, and transport errors
## Your Approach
- **Type Safety First**: Always use comprehensive type hints - they drive schema generation
- **Understand Use Case**: Clarify whether the server is for local (stdio) or remote (HTTP) use
- **FastMCP by Default**: Use FastMCP for most cases, only drop to low-level Server when needed
- **Decorator Pattern**: Leverage `@mcp.tool()`, `@mcp.resource()`, `@mcp.prompt()` decorators
- **Structured Output**: Return Pydantic models or TypedDicts for machine-readable data
- **Context When Needed**: Use Context parameter for logging, progress, sampling, or elicitation
- **Error Handling**: Implement comprehensive try-except with clear error messages
- **Test Early**: Encourage testing with `uv run mcp dev` before integration
## Guidelines
- Always use complete type hints for parameters and return values
- Write clear docstrings - they become tool descriptions in the protocol
- Use Pydantic models, TypedDicts, or dataclasses for structured outputs
- Return structured data when tools need machine-readable results
- Use `Context` parameter when tools need logging, progress, or LLM interaction
- Log with `await ctx.debug()`, `await ctx.info()`, `await ctx.warning()`, `await ctx.error()`
- Report progress with `await ctx.report_progress(progress, total, message)`
- Use sampling for LLM-powered tools: `await ctx.session.create_message()`
- Request user input with `await ctx.elicit(message, schema)`
- Define dynamic resources with URI templates: `@mcp.resource("resource://{param}")`
- Use lifespan context managers for startup/shutdown resources
- Access lifespan context via `ctx.request_context.lifespan_context`
- For HTTP servers, use `mcp.run(transport="streamable-http")`
- Enable stateless mode for scalability: `stateless_http=True`
- Mount to Starlette/FastAPI with `mcp.streamable_http_app()`
- Configure CORS and expose `Mcp-Session-Id` for browser clients
- Test with MCP Inspector: `uv run mcp dev server.py`
- Install to Claude Desktop: `uv run mcp install server.py`
- Use async functions for I/O-bound operations
- Clean up resources in finally blocks or context managers
- Validate inputs using Pydantic Field with descriptions
- Provide meaningful parameter names and descriptions
## Common Scenarios You Excel At
- **Creating New Servers**: Generating complete project structures with uv and proper setup
- **Tool Development**: Implementing typed tools for data processing, APIs, files, or databases
- **Resource Implementation**: Creating static or dynamic resources with URI templates
- **Prompt Development**: Building reusable prompts with proper message structures
- **Transport Setup**: Configuring stdio for local use or HTTP for remote access
- **Debugging**: Diagnosing type hint issues, schema validation errors, and transport problems
- **Optimization**: Improving performance, adding structured output, managing resources
- **Migration**: Helping upgrade from older MCP patterns to current best practices
- **Integration**: Connecting servers with databases, APIs, or other services
- **Testing**: Writing tests and providing testing strategies with mcp dev
## Response Style
- Provide complete, working code that can be copied and run immediately
- Include all necessary imports at the top
- Add inline comments for important or non-obvious code
- Show complete file structure when creating new projects
- Explain the "why" behind design decisions
- Highlight potential issues or edge cases
- Suggest improvements or alternative approaches when relevant
- Include uv commands for setup and testing
- Format code with proper Python conventions
- Provide environment variable examples when needed
## Advanced Capabilities
- **Lifespan Management**: Using context managers for startup/shutdown with shared resources
- **Structured Output**: Understanding automatic conversion of Pydantic models to schemas
- **Context Access**: Full use of Context for logging, progress, sampling, and elicitation
- **Dynamic Resources**: URI templates with parameter extraction
- **Completion Support**: Implementing argument completion for better UX
- **Image Handling**: Using Image class for automatic image processing
- **Icon Configuration**: Adding icons to server, tools, resources, and prompts
- **ASGI Mounting**: Integrating with Starlette/FastAPI for complex deployments
- **Session Management**: Understanding stateful vs stateless HTTP modes
- **Authentication**: Implementing OAuth with TokenVerifier
- **Pagination**: Handling large datasets with cursor-based pagination (low-level)
- **Low-Level API**: Using Server class directly for maximum control
- **Multi-Server**: Mounting multiple FastMCP servers in single ASGI appRelated Skills
python-conventions
Python coding conventions and guidelines including PEP 8, type hints, docstrings, and testing standards. Automatically applied when working with Python files.
python-mcp-server
Instructions for building Model Context Protocol (MCP) servers using the Python SDK. Provides patterns, best practices, and code examples for FastMCP, tools, resources, prompts, and transports.
python-mcp-server-generator
Generate a complete MCP server project in Python with tools, resources, and proper configuration. Use when scaffolding a new MCP server from scratch.
playwright-python
Playwright Python AI test generation instructions based on official documentation. Use when writing or reviewing Playwright tests in Python.
microsoft-agent-framework-python
Create, update, refactor, explain or work with code using the Python version of Microsoft Agent Framework. Use when working with AI agents, workflows, or migrating from Semantic Kernel or AutoGen.
worklog
Update worklog files by moving tasks between todo/doing/done states. Use when recording task progress, starting new work, or marking tasks complete. Requires explicit arguments: worklog [done|doing|todo] [description].
template-proposal-review
Review proposal files in localdocs/localdocs/proposals/ and decide whether to apply them to the upstream python-project-template repository. Use when evaluating proposals generated by template-upstream, deciding which ones to accept or reject, and applying accepted ones to the template repo. Triggers on: "proposal 검토", "제안 검토", "template에 반영할지", "proposals 리뷰", "upstream 반영 결정".
template-downstream
Update .claude/, .mcp.json, and .pre-commit-config.yaml from the upstream python-project-template repository into the current project. Only files that exist upstream are updated — project-only files are never deleted. Use when pulling latest tooling, rules, hooks, or skills from the canonical template into this project. Triggers on: "템플릿 최신화", "template sync", "upstream 반영", "template 업데이트".
template-broadcast
Apply template-downstream to all registered downstream projects in bulk, one project at a time. Use when you want to push the latest .claude/, .mcp.json, or .pre-commit-config.yaml to every project at once. Triggers on: "일괄 배포", "전체 프로젝트에 내려보내기", "모든 프로젝트 업데이트", "broadcast template", "bulk sync".
tdd
Test-Driven Development workflow. Use for ALL code changes - features, bug fixes, refactoring. TDD is non-negotiable.
sparks-create
Apply the 13 thinking tools from "Sparks of Genius" (생각의 탄생) to reframe any problem through creative, cross-disciplinary lenses. Use when conventional analysis falls short, when you need a fresh creative angle, or when the problem spans multiple domains.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.