PluginBench
Skill
Official
Review
Audit score 70

python-mcp-server-generator

github/awesome-copilot

Generate a complete, production-ready MCP server in Python with tools, resources, and proper configuration.

What is python-mcp-server-generator?

This skill scaffolds a full Model Context Protocol (MCP) server project in Python using uv, with built-in support for tools, resources, prompts, and multiple transport types. Use it when you need to create a new MCP server that integrates with Claude or other MCP clients.

  • Initializes a Python project structure with uv and MCP SDK dependencies
  • Generates server configuration with choice of stdio or HTTP transport
  • Creates decorated tool functions with automatic schema generation from type hints
  • Implements error handling, validation, and async/await support
  • Optionally adds resources and prompts with URI templates and dynamic content
  • Provides testing and installation guidance for Claude Desktop and MCP Inspector

How to install python-mcp-server-generator

npx skills add https://github.com/github/awesome-copilot --skill python-mcp-server-generator
Prerequisites
  • Node.js and npm (to run npx skills add)
  • Python 3.8 or later
  • uv package manager installed
Claude Code
Cursor
Windsurf
Cline

How to use python-mcp-server-generator

  1. 1.Run npx skills add to install the skill
  2. 2.Choose your transport type (stdio for local, HTTP for remote)
  3. 3.Define your tool functions with type hints and docstrings
  4. 4.Optionally add resources or prompts using decorators
  5. 5.Test locally with uv run mcp dev server.py
  6. 6.Install to Claude Desktop with uv run mcp install server.py

Use cases

Good for
  • Building a custom MCP server that exposes file system operations or data processing tools to Claude
  • Creating an HTTP-based MCP server for remote access with stateless scaling
  • Integrating external APIs or databases as MCP tools with proper type safety
  • Generating a local stdio server for testing MCP functionality before deployment
  • Setting up a production-ready server with comprehensive error handling and logging
Who it's for
  • Python developers building MCP integrations
  • AI engineers creating custom tools for Claude or other MCP clients
  • Backend developers exposing internal APIs as MCP servers
  • Teams standardizing on MCP for agent-based workflows

python-mcp-server-generator FAQ

What's the difference between stdio and HTTP transport?

stdio is for local execution (simpler, direct) while HTTP is for remote servers with optional stateless mode for scalability. Choose stdio for testing and local use, HTTP for production deployments.

Do I need to write schemas for my tools?

No. Type hints on your tool functions automatically generate schemas. Just use proper Python type annotations and the MCP SDK handles schema generation.

Can I use async operations in my tools?

Yes. The skill supports async/await for I/O-bound operations. Use async functions with the @mcp.tool() decorator for better performance.

How do I test my MCP server before installing it?

Run uv run mcp dev server.py to start the MCP Inspector, which lets you test tools and resources interactively before installation.

What should I return from my tools?

Return structured data when possible using Pydantic models or TypedDicts. For simple cases, return strings or basic types. Avoid writing to stdout; use stderr or Context logging instead.

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: python-mcp-server-generator description: 'Generate a complete MCP server project in Python with tools, resources, and proper configuration'

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 scientific calculations

Configuration Options

  • For stdio Servers:

    • Simple direct execution
    • Test with uv run mcp dev server.py
    • Install to Claude: uv run mcp install server.py
  • For HTTP Servers:

    • Port configuration via environment variables
    • Stateless mode for scalability: stateless_http=True
    • JSON response mode: json_response=True
    • CORS configuration for browser clients
    • Mounting to existing ASGI servers (Starlette/FastAPI)

Testing Guidance

  • Explain how to run the server:
    • stdio: python server.py or uv run server.py
    • HTTP: python server.py then connect to http://localhost:PORT/mcp
  • Test with MCP Inspector: uv run mcp dev server.py
  • Install to Claude Desktop: uv run mcp install server.py
  • Include example tool invocations
  • Add troubleshooting tips

Additional Features to Consider

  • Context usage for logging, progress, and notifications
  • LLM sampling for AI-powered tools
  • User input elicitation for interactive workflows
  • Lifespan management for shared resources (databases, connections)
  • Structured output with Pydantic models
  • Icons for UI display
  • Image handling with Image class
  • Completion support for better UX

Best Practices

  • Use type hints everywhere - they're not optional
  • Return structured data when possible
  • Log to stderr (or use Context logging) to avoid stdout pollution
  • Clean up resources properly
  • Validate inputs early
  • Provide clear error messages
  • Test tools independently before LLM integration

Generate a complete, production-ready MCP server with type safety, proper error handling, and comprehensive documentation.

Related skills

More from github/awesome-copilot and the wider catalog.

PYpython-pypi-package-builder logo

python-pypi-package-builder

Official
github/awesome-copilot

End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI. Covers all four build backends (setuptools+setuptools_scm, hatchling, flit, poetry), PEP 440 versioning, semantic versioning, dynamic git-tag versioning, OOP/SOLID design, type hints (PEP 484/526/544/561), Trusted Publishing (OIDC), and the full PyPA packaging flow. Use for: creating Python packages, pip-installable SDKs, CLI tools, framework plugins, pyproject.toml setup, py.typed, setuptools_scm, semver, mypy, pre-commit, GitHub Actions CI/CD, or PyPI publishing.

762 installs
QUquality-playbook logo

quality-playbook

Official
github/awesome-copilot

Complete quality engineering audit: behavioral requirements, spec-traced tests, three-pass review, multi-model spec audit, and TDD-verified patches.

1.6k installs
QUquasi-coder logo

quasi-coder

Official
github/awesome-copilot

Turns shorthand, pseudo-code, and rough natural-language descriptions into production-quality code.

9.1k installs
REreact-audit-grep-patterns logo

react-audit-grep-patterns

Official
github/awesome-copilot

Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade. Use this skill whenever running a migration audit - for both the react18-auditor and react19-auditor agents. Contains every grep pattern needed to find deprecated APIs, removed APIs, unsafe lifecycle methods, batching vulnerabilities, test file issues, dependency conflicts, and React 19 specific removals. Always use this skill when writing audit scan commands - do not rely on memory for grep syntax, especially for the multi-line async setState patterns which require context flags.

733 installsAudited
REreact18-batching-patterns logo

react18-batching-patterns

Official
github/awesome-copilot

Provides exact patterns for diagnosing and fixing automatic batching regressions in React 18 class components. Use this skill whenever a class component has multiple setState calls in an async method, inside setTimeout, inside a Promise .then() or .catch(), or in a native event handler. Use it before writing any flushSync call - the decision tree here prevents unnecessary flushSync overuse. Also use this skill when fixing test failures caused by intermediate state assertions that break after React 18 upgrade.

696 installsAudited
REreact18-dep-compatibility logo

react18-dep-compatibility

Official
github/awesome-copilot

React 18.3.1 and React 19 dependency compatibility matrix.

701 installsAudited