github avatar

Python Mcp Server Generator

The python-mcp-server-generator skill generates a complete Model Context Protocol (MCP) server project in Python, including proper project structure, tools with type hints, resources, prompts, and error handling using the FastMCP framework. It's designed for developers who need to create MCP servers quickly, supporting both stdio (local) and HTTP (remote) transport types with configuration options for deployment scenarios. The skill solves the problem of setting up boilerplate MCP server infrastructure by providing a template-based approach with best practices for tool implementation, code organization, and testing.

skills.sh installs
10.5K
GitHub stars
41K
last updated
Aug 21, 2026

Install

$ npx -y skills add github/awesome-copilot --skill python-mcp-server-generator --agent claude-code

Installs into .claude/skills of the current project.

Files

Python MCP Server Generator

Create a Model Context Protocol (MCP) server in Python with the official MCP Python SDK v2. SDK v2 supports the MCP specification revision 2026-07-28. The same server also serves clients that use earlier revisions.

Workflow

Copy this checklist and track your progress:

  • Step 1: Create the project.
  • Step 2: Write the server.
  • Step 3: Write the tests.
  • Step 4: Run the tests until they pass.
  • Step 5: Configure the client.

Step 1: Create the project

Run these commands:

uv init --app --no-package project-name
cd project-name
uv add "mcp[cli]>=2,<3"
uv add --dev pytest

Then delete main.py. The server goes in server.py.

  • Without --no-package, uv makes a src/ package layout, and the tests cannot import server.py.
  • uv init makes the .gitignore file. Do not write a different one.

Step 2: Write the server

Start from this template:

from mcp.server import MCPServer
from mcp.server.mcpserver.exceptions import ToolError

mcp = MCPServer("Demo", version="0.1.0")

Sponsors

Details

Repository
github.com/github/awesome-copilot
Categories
Backend & APIs, Git & Pull Requests, AI & Agent Building, Automation & Workflows, Python

More from github/awesome-copilot

All 318
1github avatarpdftk-servergithub/awesome-copilotSkill for using the command-line tool pdftk (PDFtk Server) for working with PDF files. Use when asked to merge PDFs, split PDFs, rotate pages, encrypt or decryp10Kskills.sh installs
2github avatargo-mcp-server-generatorgithub/awesome-copilotGenerate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk.9.2Kskills.sh installs
3github avatarrust-mcp-server-generatorgithub/awesome-copilotGenerate a complete Rust Model Context Protocol server project with tools, prompts, resources, and tests using the official rmcp SDK9.2Kskills.sh installs
4google avataragent-platform-endpoint-managementgoogle/skillsManages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platfor9Kskills.sh installs
5github avatarphp-mcp-server-generatorgithub/awesome-copilotGenerate a complete PHP Model Context Protocol server project with tools, resources, prompts, and tests using the official PHP SDK8.9Kskills.sh installs
6github avatarjava-mcp-server-generatorgithub/awesome-copilotGenerate a complete Model Context Protocol server project in Java using the official MCP Java SDK with reactive streams and optional Spring Boot integration.8.8Kskills.sh installs