{"id":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","shortId":"R4fKWB","kind":"skill","title":"Python Mcp Server Generator","tagline":"Awesome Copilot skill by Github","description":"# Generate Python MCP Server\n\nCreate a complete Model Context Protocol (MCP) server in Python with the following specifications:\n\n## Requirements\n\n1. **Project Structure**: Create a new Python project with proper structure using uv\n2. **Dependencies**: Include mcp[cli] package with uv\n3. **Transport Type**: Choose between stdio (for local) or streamable-http (for remote)\n4. **Tools**: Create at least one useful tool with proper type hints\n5. **Error Handling**: Include comprehensive error handling and validation\n\n## Implementation Details\n\n### Project Setup\n- Initialize with `uv init project-name`\n- Add MCP SDK: `uv add \"mcp[cli]\"`\n- Create main server file (e.g., `server.py`)\n- Add `.gitignore` for Python projects\n- Configure for direct execution with `if __name__ == \"__main__\"`\n\n### Server Configuration\n- Use `FastMCP` class from `mcp.server.fastmcp`\n- Set server name and optional instructions\n- Choose transport: stdio (default) or streamable-http\n- For HTTP: optionally configure host, port, and stateless mode\n\n### Tool Implementation\n- Use `@mcp.tool()` decorator on functions\n- Always include type hints - they generate schemas automatically\n- Write clear docstrings - they become tool descriptions\n- Use Pydantic models or TypedDicts for structured outputs\n- Support async operations for I/O-bound tasks\n- Include proper error handling\n\n### Resource/Prompt Setup (Optional)\n- Add resources with `@mcp.resource()` decorator\n- Use URI templates for dynamic resources: `\"resource://{param}\"`\n- Add prompts with `@mcp.prompt()` decorator\n- Return strings or Message lists from prompts\n\n### Code Quality\n- Use type hints for all function parameters and returns\n- Write docstrings for tools, resources, and prompts\n- Follow PEP 8 style guidelines\n- Use async/await for asynchronous operations\n- Implement context managers for resource cleanup\n- Add inline comments for complex logic\n\n## Example Tool Types to Consider\n- Data processing and transformation\n- File system operations (read, analyze, search)\n- External API integrations\n- Database queries\n- Text analysis or generation (with sampling)\n- System information retrieval\n- Math or scientific calculations\n\n## Configuration Options\n- **For stdio Servers**:\n  - Simple direct execution\n  - Test with `uv run mcp dev server.py`\n  - Install to Claude: `uv run mcp install server.py`\n  \n- **For HTTP Servers**:\n  - Port configuration via environment variables\n  - Stateless mode for scalability: `stateless_http=True`\n  - JSON response mode: `json_response=True`\n  - CORS configuration for browser clients\n  - Mounting to existing ASGI servers (Starlette/FastAPI)\n\n## Testing Guidance\n- Explain how to run the server:\n  - stdio: `python server.py` or `uv run server.py`\n  - HTTP: `python server.py` then connect to `http://localhost:PORT/mcp`\n- Test with MCP Inspector: `uv run mcp dev server.py`\n- Install to Claude Desktop: `uv run mcp install server.py`\n- Include example tool invocations\n- Add troubleshooting tips\n\n## Additional Features to Consider\n- Context usage for logging, progress, and notifications\n- LLM sampling for AI-powered tools\n- User input elicitation for interactive workflows\n- Lifespan management for shared resources (databases, connections)\n- Structured output with Pydantic models\n- Icons for UI display\n- Image handling with Image class\n- Completion support for better UX\n\n## Best Practices\n- Use type hints everywhere - they're not optional\n- Return structured data when possible\n- Log to stderr (or use Context logging) to avoid stdout pollution\n- Clean up resources properly\n- Validate inputs early\n- Provide clear error messages\n- Test tools independently before LLM integration\n\nGenerate a complete, production-ready MCP server with type safety, proper error handling, and comprehensive documentation.","tags":["python","mcp","server","generator","awesome","copilot","github"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/python-mcp-server-generator","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T17:40:17.623Z","embedding":null,"createdAt":"2026-04-18T20:25:35.385Z","updatedAt":"2026-04-22T17:40:17.623Z","lastSeenAt":"2026-04-22T17:40:17.623Z","tsv":"'1':29 '2':42 '3':50 '4':64 '5':76 '8':239 'add':96,100,109,195,207,253,392 'addit':395 'ai':410 'ai-pow':409 'alway':159 'analysi':280 'analyz':272 'api':275 'asgi':344 'async':183 'async/await':243 'asynchron':245 'automat':166 'avoid':468 'awesom':5 'becom':171 'best':445 'better':443 'browser':339 'calcul':291 'category-awesome-copilot' 'choos':53,135 'class':126,439 'claud':309,381 'clean':471 'cleanup':252 'clear':168,479 'cli':46,102 'client':340 'code':219 'comment':255 'complet':16,440,490 'complex':257 'comprehens':80,503 'configur':114,123,146,292,319,337 'connect':366,425 'consid':263,398 'context':18,248,399,465 'copilot':6 'cor':336 'creat':14,32,66,103 'data':264,457 'databas':277,424 'decor':156,199,211 'default':138 'depend':43 'descript':173 'desktop':382 'detail':86 'dev':305,377 'direct':116,298 'display':434 'docstr':169,231 'document':504 'dynam':204 'e.g':107 'earli':477 'elicit':415 'environ':321 'error':77,81,190,480,500 'everywher':450 'exampl':259,389 'execut':117,299 'exist':343 'explain':349 'extern':274 'fastmcp':125 'featur':396 'file':106,268 'follow':26,237 'function':158,226 'generat':4,10,164,282,488 'github':9 'gitignor':110 'guidanc':348 'guidelin':241 'handl':78,82,191,436,501 'hint':75,162,223,449 'host':147 'http':61,142,144,316,328,362 'i/o-bound':186 'icon':431 'imag':435,438 'implement':85,153,247 'includ':44,79,160,188,388 'independ':484 'inform':286 'init':92 'initi':89 'inlin':254 'input':414,476 'inspector':373 'instal':307,313,379,386 'instruct':134 'integr':276,487 'interact':417 'invoc':391 'json':330,333 'least':68 'lifespan':419 'list':216 'llm':406,486 'local':57 'localhost':368 'log':402,460,466 'logic':258 'main':104,121 'manag':249,420 'math':288 'mcp':2,12,20,45,97,101,304,312,372,376,385,494 'mcp.prompt':210 'mcp.resource':198 'mcp.server.fastmcp':128 'mcp.tool':155 'messag':215,481 'mode':151,324,332 'model':17,176,430 'mount':341 'name':95,120,131 'new':34 'notif':405 'one':69 'oper':184,246,270 'option':133,145,194,293,454 'output':181,427 'packag':47 'param':206 'paramet':227 'pep':238 'pollut':470 'port':148,318 'port/mcp':369 'possibl':459 'power':411 'practic':446 'process':265 'product':492 'production-readi':491 'progress':403 'project':30,36,87,94,113 'project-nam':93 'prompt':208,218,236 'proper':38,73,189,474,499 'protocol':19 'provid':478 'pydant':175,429 'python':1,11,23,35,112,356,363 'qualiti':220 'queri':278 're':452 'read':271 'readi':493 'remot':63 'requir':28 'resourc':196,205,234,251,423,473 'resource/prompt':192 'respons':331,334 'retriev':287 'return':212,229,455 'run':303,311,352,360,375,384 'safeti':498 'sampl':284,407 'scalabl':326 'schema':165 'scientif':290 'sdk':98 'search':273 'server':3,13,21,105,122,130,296,317,345,354,495 'server.py':108,306,314,357,361,364,378,387 'set':129 'setup':88,193 'share':422 'simpl':297 'skill':7 'source-github' 'specif':27 'starlette/fastapi':346 'stateless':150,323,327 'stderr':462 'stdio':55,137,295,355 'stdout':469 'streamabl':60,141 'streamable-http':59,140 'string':213 'structur':31,39,180,426,456 'style':240 'support':182,441 'system':269,285 'task':187 'templat':202 'test':300,347,370,482 'text':279 'tip':394 'tool':65,71,152,172,233,260,390,412,483 'transform':267 'transport':51,136 'troubleshoot':393 'true':329,335 'type':52,74,161,222,261,448,497 'typeddict':178 'ui':433 'uri':201 'usag':400 'use':40,70,124,154,174,200,221,242,447,464 'user':413 'uv':41,49,91,99,302,310,359,374,383 'ux':444 'valid':84,475 'variabl':322 'via':320 'workflow':418 'write':167,230","prices":[{"id":"9f090ae0-2952-479c-b0b6-bdaf0bf32241","listingId":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:35.385Z"}],"sources":[{"listingId":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","source":"github","sourceId":"github/awesome-copilot/python-mcp-server-generator","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/python-mcp-server-generator","isPrimary":false,"firstSeenAt":"2026-04-18T21:50:43.824Z","lastSeenAt":"2026-04-22T12:52:20.892Z"},{"listingId":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","source":"skills_sh","sourceId":"github/awesome-copilot/python-mcp-server-generator","sourceUrl":"https://skills.sh/github/awesome-copilot/python-mcp-server-generator","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:35.385Z","lastSeenAt":"2026-04-22T17:40:17.623Z"}],"details":{"listingId":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"python-mcp-server-generator","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/python-mcp-server-generator"},"updatedAt":"2026-04-22T17:40:17.623Z"}}