{"id":"9524d4c6-3cf4-48f8-a3ae-f6fe16101ea6","shortId":"R4fKWB","kind":"skill","title":"python-mcp-server-generator","tagline":"Generate a complete MCP server project in Python with tools, resources, and proper configuration","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","agent-skills","agents","custom-agents","github-copilot","hacktoberfest"],"capabilities":["skill","source-github","skill-python-mcp-server-generator","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"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":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (3,801 chars)","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-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:21.551Z","embedding":null,"createdAt":"2026-04-18T20:25:35.385Z","updatedAt":"2026-05-18T18:52:21.551Z","lastSeenAt":"2026-05-18T18:52:21.551Z","tsv":"'1':39 '2':52 '3':60 '4':74 '5':86 '8':249 'add':106,110,119,205,217,263,402 'addit':405 'ai':420 'ai-pow':419 'alway':169 'analysi':290 'analyz':282 'api':285 'asgi':354 'async':193 'async/await':253 'asynchron':255 'automat':176 'avoid':478 'becom':181 'best':455 'better':453 'browser':349 'calcul':301 'choos':63,145 'class':136,449 'claud':319,391 'clean':481 'cleanup':262 'clear':178,489 'cli':56,112 'client':350 'code':229 'comment':265 'complet':8,26,450,500 'complex':267 'comprehens':90,513 'configur':19,124,133,156,302,329,347 'connect':376,435 'consid':273,408 'context':28,258,409,475 'cor':346 'creat':24,42,76,113 'data':274,467 'databas':287,434 'decor':166,209,221 'default':148 'depend':53 'descript':183 'desktop':392 'detail':96 'dev':315,387 'direct':126,308 'display':444 'docstr':179,241 'document':514 'dynam':214 'e.g':117 'earli':487 'elicit':425 'environ':331 'error':87,91,200,490,510 'everywher':460 'exampl':269,399 'execut':127,309 'exist':353 'explain':359 'extern':284 'fastmcp':135 'featur':406 'file':116,278 'follow':36,247 'function':168,236 'generat':5,6,20,174,292,498 'gitignor':120 'guidanc':358 'guidelin':251 'handl':88,92,201,446,511 'hint':85,172,233,459 'host':157 'http':71,152,154,326,338,372 'i/o-bound':196 'icon':441 'imag':445,448 'implement':95,163,257 'includ':54,89,170,198,398 'independ':494 'inform':296 'init':102 'initi':99 'inlin':264 'input':424,486 'inspector':383 'instal':317,323,389,396 'instruct':144 'integr':286,497 'interact':427 'invoc':401 'json':340,343 'least':78 'lifespan':429 'list':226 'llm':416,496 'local':67 'localhost':378 'log':412,470,476 'logic':268 'main':114,131 'manag':259,430 'math':298 'mcp':3,9,22,30,55,107,111,314,322,382,386,395,504 'mcp.prompt':220 'mcp.resource':208 'mcp.server.fastmcp':138 'mcp.tool':165 'messag':225,491 'mode':161,334,342 'model':27,186,440 'mount':351 'name':105,130,141 'new':44 'notif':415 'one':79 'oper':194,256,280 'option':143,155,204,303,464 'output':191,437 'packag':57 'param':216 'paramet':237 'pep':248 'pollut':480 'port':158,328 'port/mcp':379 'possibl':469 'power':421 'practic':456 'process':275 'product':502 'production-readi':501 'progress':413 'project':11,40,46,97,104,123 'project-nam':103 'prompt':218,228,246 'proper':18,48,83,199,484,509 'protocol':29 'provid':488 'pydant':185,439 'python':2,13,21,33,45,122,366,373 'python-mcp-server-gener':1 'qualiti':230 'queri':288 're':462 'read':281 'readi':503 'remot':73 'requir':38 'resourc':16,206,215,244,261,433,483 'resource/prompt':202 'respons':341,344 'retriev':297 'return':222,239,465 'run':313,321,362,370,385,394 'safeti':508 'sampl':294,417 'scalabl':336 'schema':175 'scientif':300 'sdk':108 'search':283 'server':4,10,23,31,115,132,140,306,327,355,364,505 'server.py':118,316,324,367,371,374,388,397 'set':139 'setup':98,203 'share':432 'simpl':307 'skill' 'skill-python-mcp-server-generator' 'source-github' 'specif':37 'starlette/fastapi':356 'stateless':160,333,337 'stderr':472 'stdio':65,147,305,365 'stdout':479 'streamabl':70,151 'streamable-http':69,150 'string':223 'structur':41,49,190,436,466 'style':250 'support':192,451 'system':279,295 'task':197 'templat':212 'test':310,357,380,492 'text':289 'tip':404 'tool':15,75,81,162,182,243,270,400,422,493 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'transform':277 'transport':61,146 'troubleshoot':403 'true':339,345 'type':62,84,171,232,271,458,507 'typeddict':188 'ui':443 'uri':211 'usag':410 'use':50,80,134,164,184,210,231,252,457,474 'user':423 'uv':51,59,101,109,312,320,369,384,393 'ux':454 'valid':94,485 'variabl':332 'via':330 'workflow':428 'write':177,240","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-05-18T18:52:21.551Z"},{"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-05-07T22:40:17.437Z"}],"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","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"9e77e716dd1c3fc2a996ce3f66940a38c24b1c40","skill_md_path":"skills/python-mcp-server-generator/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/python-mcp-server-generator"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"python-mcp-server-generator","description":"Generate a complete MCP server project in Python with tools, resources, and proper configuration"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/python-mcp-server-generator"},"updatedAt":"2026-05-18T18:52:21.551Z"}}