Agent skill · software engineering · github

python-mcp-server-generator

Generate a complete MCP server project in Python with tools, resources, and proper configuration

Why this skill is useful

Adds a complete project generation script for an MCP server in Python, including configuration, error handling, and best practices that extend the AI's capabilities.

What it needs

Requires uv installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 37,534 stars on the source repository.

What this skill does

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://{param}" Add prompts with @mcp.prompt() decorator Return strings or Message lists from prompts Code Quality Use type hints for all function parameters and returns Write docstrings for tools, resources, and prompts Follow PEP 8 style guidelines Use async/await for asynchronous operations Implement context managers for resource cleanup Add inline comments for complex logic Example Tool Types to Consider Data processing and transformation File system operations (read, analyze, search) External API integrations Database queries Text analysis or generation (with sampling) System information retrieval Math or sc …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills github/python-mcp-server-generator

View the source on GitHub

Browse the @skills marketplace