python-mcp-server-generator
FeaturedGenerate a complete MCP server project in Python with tools, resources, and proper configuration
AI & Automation 41,313 stars
5382 forks Updated today MIT
Install
Quality Score: 93/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Generate Python MCP Server
Create a complete Model Context Protocol (MCP) server in Python with the following specifications:
## Requirements
1. **Project Structure**: Create a new Python project with proper structure using uv
2. **Dependencies**: Include mcp[cli] package with uv
3. **Transport Type**: Choose between stdio (for local) or streamable-http (for remote)
4. **Tools**: Create at least one useful tool with proper type hints
5. **Error Handling**: Include comprehensive error handling and validation
## Implementation Details
### Project Setup
- Initialize with `uv init project-name`
- Add MCP SDK: `uv add "mcp[cli]"`
- Create main server file (e.g., `server.py`)
- Add `.gitignore` for Python projects
- Configure for direct execution with `if __name__ == "__main__"`
### Server Configuration
- Use `FastMCP` class from `mcp.server.fastmcp`
- Set server name and optional instructions
- Choose transport: stdio (default) or streamable-http
- For HTTP: optionally configure host, port, and stateless mode
### Tool Implementation
- Use `@mcp.tool()` decorator on functions
- Always include type hints - they generate schemas automatically
- Write clear docstrings - they become tool descriptions
- Use Pydantic models or TypedDicts for structured outputs
- Support async operations for I/O-bound tasks
- Include proper error handling
### Resource/Prompt Setup (Optional)
- Add resources with `@mcp.resource()` decorator
- Use URI templates for dynamic resources: `"resource://...
Details
- Author
- github
- Repository
- github/awesome-copilot
- Created
- 1 years ago
- Last Updated
- today
- Language
- JavaScript
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Featured
csharp-mcp-server-generator
Generate a complete MCP server project in C# with tools, prompts, and proper configuration
41,313 Updated today
github API & Backend Listed
mcp-server-authoring
FastMCP authoring for Python MCP servers — tools, resources, prompts, TDD, release-please. Use when building or extending an MCP server, adding a tool/resource, or scaffolding a new server.
60 Updated today
laurigates AI & Automation Featured
ruby-mcp-server-generator
Generate a complete Model Context Protocol server project in Ruby using the official MCP Ruby SDK gem.
41,313 Updated today
github