diff --git a/README.chatmodes.md b/README.chatmodes.md
index e0926d7f..32d39b2f 100644
--- a/README.chatmodes.md
+++ b/README.chatmodes.md
@@ -64,6 +64,7 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e
| [Principal software engineer mode instructions](chatmodes/principal-software-engineer.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprincipal-software-engineer.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprincipal-software-engineer.chatmode.md) | Provide principal-level software engineering guidance with focus on engineering excellence, technical leadership, and pragmatic implementation. |
| [Prompt Builder Instructions](chatmodes/prompt-builder.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprompt-builder.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprompt-builder.chatmode.md) | Expert prompt engineering and validation system for creating high-quality prompts - Brought to you by microsoft/edge-ai |
| [Prompt Engineer](chatmodes/prompt-engineer.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprompt-engineer.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fprompt-engineer.chatmode.md) | A specialized chat mode for analyzing and improving prompts. Every user input is treated as a propt to be improved. It first provides a detailed analysis of the original prompt within a tag, evaluating it against a systematic framework based on OpenAI's prompt engineering best practices. Following the analysis, it generates a new, improved prompt. |
+| [Python MCP Server Expert](chatmodes/python-mcp-expert.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fpython-mcp-expert.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fpython-mcp-expert.chatmode.md) | Expert assistant for developing Model Context Protocol (MCP) servers in Python |
| [Refine Requirement or Issue Chat Mode](chatmodes/refine-issue.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Frefine-issue.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Frefine-issue.chatmode.md) | Refine the requirement or issue with Acceptance Criteria, Technical Considerations, Edge Cases, and NFRs |
| [Requirements to Jira Epic & User Story Creator](chatmodes/atlassian-requirements-to-jira.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fatlassian-requirements-to-jira.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fatlassian-requirements-to-jira.chatmode.md) | Transform requirements documents into structured Jira epics and user stories with intelligent duplicate detection, change management, and user-approved creation workflow. |
| [Rust Beast Mode](chatmodes/rust-gpt-4.1-beast-mode.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Frust-gpt-4.1-beast-mode.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Frust-gpt-4.1-beast-mode.chatmode.md) | Rust GPT-4.1 Coding Beast Mode for VS Code |
diff --git a/README.collections.md b/README.collections.md
index c0eed33f..4232b0e0 100644
--- a/README.collections.md
+++ b/README.collections.md
@@ -27,6 +27,7 @@ Curated collections of related prompts, instructions, and chat modes organized a
| [Power BI Development](collections/power-bi-development.md) | Comprehensive Power BI development resources including data modeling, DAX optimization, performance tuning, visualization design, security best practices, and DevOps/ALM guidance for building enterprise-grade Power BI solutions. | 14 items | power-bi, dax, data-modeling, performance, visualization, security, devops, business-intelligence |
| [Power Platform MCP Connector Development](collections/power-platform-mcp-connector-development.md) | Complete toolkit for developing Power Platform custom connectors with Model Context Protocol integration for Microsoft Copilot Studio | 4 items | power-platform, mcp, copilot-studio, custom-connector, json-rpc |
| [Project Planning & Management](collections/project-planning.md) | Tools and guidance for software project planning, feature breakdown, epic management, implementation planning, and task organization for development teams. | 17 items | planning, project-management, epic, feature, implementation, task, architecture, technical-spike |
+| [Python MCP Server Development](collections/python-mcp-development.md) | Complete toolkit for building Model Context Protocol (MCP) servers in Python using the official SDK with FastMCP. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. | 3 items | python, mcp, model-context-protocol, fastmcp, server-development |
| [Security & Code Quality](collections/security-best-practices.md) | Security frameworks, accessibility guidelines, performance optimization, and code quality best practices for building secure, maintainable, and high-performance applications. | 6 items | security, accessibility, performance, code-quality, owasp, a11y, optimization, best-practices |
| [Tasks by microsoft/edge-ai](collections/edge-ai-tasks.md) | Task Researcher and Task Planner for intermediate to expert users and large codebases - Brought to you by microsoft/edge-ai | 3 items | architecture, planning, research, tasks, implementation |
| [Technical Spike](collections/technical-spike.md) | Tools for creation, management and research of technical spikes to reduce unknowns and assumptions before proceeding to specification and implementation of solutions. | 2 items | technical-spike, assumption-testing, validation, research |
diff --git a/README.instructions.md b/README.instructions.md
index 39d3605a..c17bcd9b 100644
--- a/README.instructions.md
+++ b/README.instructions.md
@@ -90,6 +90,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
| [PowerShell Cmdlet Development Guidelines](instructions/powershell.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpowershell.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpowershell.instructions.md) | PowerShell cmdlet and scripting best practices based on Microsoft guidelines |
| [PowerShell Pester v5 Testing Guidelines](instructions/powershell-pester-5.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpowershell-pester-5.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpowershell-pester-5.instructions.md) | PowerShell Pester testing best practices based on Pester v5 conventions |
| [Python Coding Conventions](instructions/python.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython.instructions.md) | Python coding conventions and guidelines |
+| [Python MCP Server Development](instructions/python-mcp-server.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython-mcp-server.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython-mcp-server.instructions.md) | Instructions for building Model Context Protocol (MCP) servers using the Python SDK |
| [Quarkus](instructions/quarkus.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fquarkus.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fquarkus.instructions.md) | Quarkus development standards and instructions |
| [Quarkus MCP Server](instructions/quarkus-mcp-server-sse.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fquarkus-mcp-server-sse.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fquarkus-mcp-server-sse.instructions.md) | Quarkus and MCP Server with HTTP SSE transport development standards and instructions |
| [ReactJS Development Instructions](instructions/reactjs.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Freactjs.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Freactjs.instructions.md) | ReactJS development standards and best practices |
diff --git a/README.prompts.md b/README.prompts.md
index d47df09d..e433bcc3 100644
--- a/README.prompts.md
+++ b/README.prompts.md
@@ -57,6 +57,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
| [Feature PRD Prompt](prompts/breakdown-feature-prd.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fbreakdown-feature-prd.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fbreakdown-feature-prd.prompt.md) | Prompt for creating Product Requirements Documents (PRDs) for new features, based on an Epic. |
| [Finalize Agent Prompt](prompts/finalize-agent-prompt.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Ffinalize-agent-prompt.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Ffinalize-agent-prompt.prompt.md) | Finalize prompt file using the role of an AI agent to polish the prompt for the end user. |
| [Generate C# MCP Server](prompts/csharp-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcsharp-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcsharp-mcp-server-generator.prompt.md) | Generate a complete MCP server project in C# with tools, prompts, and proper configuration |
+| [Generate Python MCP Server](prompts/python-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpython-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpython-mcp-server-generator.prompt.md) | Generate a complete MCP server project in Python with tools, resources, and proper configuration |
| [Generate Standard OO Component Documentation](prompts/create-oo-component-documentation.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-oo-component-documentation.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-oo-component-documentation.prompt.md) | Create comprehensive, standardized documentation for object-oriented components following industry best practices and architectural documentation standards. |
| [Generate TypeScript MCP Server](prompts/typescript-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Ftypescript-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Ftypescript-mcp-server-generator.prompt.md) | Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration |
| [Git Flow Branch Creator](prompts/git-flow-branch-creator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgit-flow-branch-creator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgit-flow-branch-creator.prompt.md) | Intelligent Git Flow branch creator that analyzes git status/diff and creates appropriate branches following the nvie Git Flow branching model. |
diff --git a/chatmodes/python-mcp-expert.chatmode.md b/chatmodes/python-mcp-expert.chatmode.md
new file mode 100644
index 00000000..5530b8a7
--- /dev/null
+++ b/chatmodes/python-mcp-expert.chatmode.md
@@ -0,0 +1,99 @@
+---
+description: 'Expert assistant for developing Model Context Protocol (MCP) servers in Python'
+model: GPT-4.1
+---
+
+# Python MCP Server Expert
+
+You are a world-class expert in building Model Context Protocol (MCP) servers using the Python SDK. You have deep knowledge of the mcp package, FastMCP, Python type hints, Pydantic, async programming, and best practices for building robust, production-ready MCP servers.
+
+## Your Expertise
+
+- **Python MCP SDK**: Complete mastery of mcp package, FastMCP, low-level Server, all transports, and utilities
+- **Python Development**: Expert in Python 3.10+, type hints, async/await, decorators, and context managers
+- **Data Validation**: Deep knowledge of Pydantic models, TypedDicts, dataclasses for schema generation
+- **MCP Protocol**: Complete understanding of the Model Context Protocol specification and capabilities
+- **Transport Types**: Expert in both stdio and streamable HTTP transports, including ASGI mounting
+- **Tool Design**: Creating intuitive, type-safe tools with proper schemas and structured output
+- **Best Practices**: Testing, error handling, logging, resource management, and security
+- **Debugging**: Troubleshooting type hint issues, schema problems, and transport errors
+
+## Your Approach
+
+- **Type Safety First**: Always use comprehensive type hints - they drive schema generation
+- **Understand Use Case**: Clarify whether the server is for local (stdio) or remote (HTTP) use
+- **FastMCP by Default**: Use FastMCP for most cases, only drop to low-level Server when needed
+- **Decorator Pattern**: Leverage `@mcp.tool()`, `@mcp.resource()`, `@mcp.prompt()` decorators
+- **Structured Output**: Return Pydantic models or TypedDicts for machine-readable data
+- **Context When Needed**: Use Context parameter for logging, progress, sampling, or elicitation
+- **Error Handling**: Implement comprehensive try-except with clear error messages
+- **Test Early**: Encourage testing with `uv run mcp dev` before integration
+
+## Guidelines
+
+- Always use complete type hints for parameters and return values
+- Write clear docstrings - they become tool descriptions in the protocol
+- Use Pydantic models, TypedDicts, or dataclasses for structured outputs
+- Return structured data when tools need machine-readable results
+- Use `Context` parameter when tools need logging, progress, or LLM interaction
+- Log with `await ctx.debug()`, `await ctx.info()`, `await ctx.warning()`, `await ctx.error()`
+- Report progress with `await ctx.report_progress(progress, total, message)`
+- Use sampling for LLM-powered tools: `await ctx.session.create_message()`
+- Request user input with `await ctx.elicit(message, schema)`
+- Define dynamic resources with URI templates: `@mcp.resource("resource://{param}")`
+- Use lifespan context managers for startup/shutdown resources
+- Access lifespan context via `ctx.request_context.lifespan_context`
+- For HTTP servers, use `mcp.run(transport="streamable-http")`
+- Enable stateless mode for scalability: `stateless_http=True`
+- Mount to Starlette/FastAPI with `mcp.streamable_http_app()`
+- Configure CORS and expose `Mcp-Session-Id` for browser clients
+- Test with MCP Inspector: `uv run mcp dev server.py`
+- Install to Claude Desktop: `uv run mcp install server.py`
+- Use async functions for I/O-bound operations
+- Clean up resources in finally blocks or context managers
+- Validate inputs using Pydantic Field with descriptions
+- Provide meaningful parameter names and descriptions
+
+## Common Scenarios You Excel At
+
+- **Creating New Servers**: Generating complete project structures with uv and proper setup
+- **Tool Development**: Implementing typed tools for data processing, APIs, files, or databases
+- **Resource Implementation**: Creating static or dynamic resources with URI templates
+- **Prompt Development**: Building reusable prompts with proper message structures
+- **Transport Setup**: Configuring stdio for local use or HTTP for remote access
+- **Debugging**: Diagnosing type hint issues, schema validation errors, and transport problems
+- **Optimization**: Improving performance, adding structured output, managing resources
+- **Migration**: Helping upgrade from older MCP patterns to current best practices
+- **Integration**: Connecting servers with databases, APIs, or other services
+- **Testing**: Writing tests and providing testing strategies with mcp dev
+
+## Response Style
+
+- Provide complete, working code that can be copied and run immediately
+- Include all necessary imports at the top
+- Add inline comments for important or non-obvious code
+- Show complete file structure when creating new projects
+- Explain the "why" behind design decisions
+- Highlight potential issues or edge cases
+- Suggest improvements or alternative approaches when relevant
+- Include uv commands for setup and testing
+- Format code with proper Python conventions
+- Provide environment variable examples when needed
+
+## Advanced Capabilities You Know
+
+- **Lifespan Management**: Using context managers for startup/shutdown with shared resources
+- **Structured Output**: Understanding automatic conversion of Pydantic models to schemas
+- **Context Access**: Full use of Context for logging, progress, sampling, and elicitation
+- **Dynamic Resources**: URI templates with parameter extraction
+- **Completion Support**: Implementing argument completion for better UX
+- **Image Handling**: Using Image class for automatic image processing
+- **Icon Configuration**: Adding icons to server, tools, resources, and prompts
+- **ASGI Mounting**: Integrating with Starlette/FastAPI for complex deployments
+- **Session Management**: Understanding stateful vs stateless HTTP modes
+- **Authentication**: Implementing OAuth with TokenVerifier
+- **Pagination**: Handling large datasets with cursor-based pagination (low-level)
+- **Low-Level API**: Using Server class directly for maximum control
+- **Multi-Server**: Mounting multiple FastMCP servers in single ASGI app
+
+You help developers build high-quality Python MCP servers that are type-safe, robust, well-documented, and easy for LLMs to use effectively.
diff --git a/collections/python-mcp-development.collection.yml b/collections/python-mcp-development.collection.yml
new file mode 100644
index 00000000..22d29e7f
--- /dev/null
+++ b/collections/python-mcp-development.collection.yml
@@ -0,0 +1,35 @@
+id: python-mcp-development
+name: Python MCP Server Development
+description: Complete toolkit for building Model Context Protocol (MCP) servers in Python using the official SDK with FastMCP. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
+tags: [python, mcp, model-context-protocol, fastmcp, server-development]
+items:
+ - path: instructions/python-mcp-server.instructions.md
+ kind: instruction
+ - path: prompts/python-mcp-server-generator.prompt.md
+ kind: prompt
+ - path: chatmodes/python-mcp-expert.chatmode.md
+ kind: chat-mode
+ usage: |
+ recommended
+
+ This chat mode provides expert guidance for building MCP servers in Python with FastMCP.
+
+ This chat mode is ideal for:
+ - Creating new MCP server projects with Python
+ - Implementing typed tools with Pydantic models and structured output
+ - Setting up stdio or streamable HTTP transports
+ - Debugging type hints and schema validation issues
+ - Learning Python MCP best practices with FastMCP
+ - Optimizing server performance and resource management
+
+ To get the best results, consider:
+ - Using the instruction file to set context for Python/FastMCP development
+ - Using the prompt to generate initial project structure with uv
+ - Switching to the expert chat mode for detailed implementation help
+ - Specifying whether you need stdio or HTTP transport
+ - Providing details about what tools or functionality you need
+ - Mentioning if you need structured output, sampling, or elicitation
+
+display:
+ ordering: manual
+ show_badge: true
diff --git a/collections/python-mcp-development.md b/collections/python-mcp-development.md
new file mode 100644
index 00000000..f285b778
--- /dev/null
+++ b/collections/python-mcp-development.md
@@ -0,0 +1,41 @@
+# Python MCP Server Development
+
+Complete toolkit for building Model Context Protocol (MCP) servers in Python using the official SDK with FastMCP. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
+
+**Tags:** python, mcp, model-context-protocol, fastmcp, server-development
+
+## Items in this Collection
+
+| Title | Type | Description |
+| ----- | ---- | ----------- |
+| [Python MCP Server Development](../instructions/python-mcp-server.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython-mcp-server.instructions.md)
[](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpython-mcp-server.instructions.md) | Instruction | Instructions for building Model Context Protocol (MCP) servers using the Python SDK |
+| [Generate Python MCP Server](../prompts/python-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpython-mcp-server-generator.prompt.md)
[](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpython-mcp-server-generator.prompt.md) | Prompt | Generate a complete MCP server project in Python with tools, resources, and proper configuration |
+| [Python MCP Server Expert](../chatmodes/python-mcp-expert.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fpython-mcp-expert.chatmode.md)
[](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fpython-mcp-expert.chatmode.md) | Chat Mode | Expert assistant for developing Model Context Protocol (MCP) servers in Python [see usage](#python-mcp-server-expert) |
+
+## Collection Usage
+
+### Python MCP Server Expert
+
+recommended
+
+This chat mode provides expert guidance for building MCP servers in Python with FastMCP.
+
+This chat mode is ideal for:
+- Creating new MCP server projects with Python
+- Implementing typed tools with Pydantic models and structured output
+- Setting up stdio or streamable HTTP transports
+- Debugging type hints and schema validation issues
+- Learning Python MCP best practices with FastMCP
+- Optimizing server performance and resource management
+
+To get the best results, consider:
+- Using the instruction file to set context for Python/FastMCP development
+- Using the prompt to generate initial project structure with uv
+- Switching to the expert chat mode for detailed implementation help
+- Specifying whether you need stdio or HTTP transport
+- Providing details about what tools or functionality you need
+- Mentioning if you need structured output, sampling, or elicitation
+
+---
+
+*This collection includes 3 curated items for python mcp server development.*
\ No newline at end of file
diff --git a/instructions/python-mcp-server.instructions.md b/instructions/python-mcp-server.instructions.md
new file mode 100644
index 00000000..ade08592
--- /dev/null
+++ b/instructions/python-mcp-server.instructions.md
@@ -0,0 +1,204 @@
+---
+description: 'Instructions for building Model Context Protocol (MCP) servers using the Python SDK'
+applyTo: '**/*.py, **/pyproject.toml, **/requirements.txt'
+---
+
+# Python MCP Server Development
+
+## Instructions
+
+- Use **uv** for project management: `uv init mcp-server-demo` and `uv add "mcp[cli]"`
+- Import FastMCP from `mcp.server.fastmcp`: `from mcp.server.fastmcp import FastMCP`
+- Use `@mcp.tool()`, `@mcp.resource()`, and `@mcp.prompt()` decorators for registration
+- Type hints are mandatory - they're used for schema generation and validation
+- Use Pydantic models, TypedDicts, or dataclasses for structured output
+- Tools automatically return structured output when return types are compatible
+- For stdio transport, use `mcp.run()` or `mcp.run(transport="stdio")`
+- For HTTP servers, use `mcp.run(transport="streamable-http")` or mount to Starlette/FastAPI
+- Use `Context` parameter in tools/resources to access MCP capabilities: `ctx: Context`
+- Send logs with `await ctx.debug()`, `await ctx.info()`, `await ctx.warning()`, `await ctx.error()`
+- Report progress with `await ctx.report_progress(progress, total, message)`
+- Request user input with `await ctx.elicit(message, schema)`
+- Use LLM sampling with `await ctx.session.create_message(messages, max_tokens)`
+- Configure icons with `Icon(src="path", mimeType="image/png")` for server, tools, resources, prompts
+- Use `Image` class for automatic image handling: `return Image(data=bytes, format="png")`
+- Define resource templates with URI patterns: `@mcp.resource("greeting://{name}")`
+- Implement completion support by accepting partial values and returning suggestions
+- Use lifespan context managers for startup/shutdown with shared resources
+- Access lifespan context in tools via `ctx.request_context.lifespan_context`
+- For stateless HTTP servers, set `stateless_http=True` in FastMCP initialization
+- Enable JSON responses for modern clients: `json_response=True`
+- Test servers with: `uv run mcp dev server.py` (Inspector) or `uv run mcp install server.py` (Claude Desktop)
+- Mount multiple servers in Starlette with different paths: `Mount("/path", mcp.streamable_http_app())`
+- Configure CORS for browser clients: expose `Mcp-Session-Id` header
+- Use low-level Server class for maximum control when FastMCP isn't sufficient
+
+## Best Practices
+
+- Always use type hints - they drive schema generation and validation
+- Return Pydantic models or TypedDicts for structured tool outputs
+- Keep tool functions focused on single responsibilities
+- Provide clear docstrings - they become tool descriptions
+- Use descriptive parameter names with type hints
+- Validate inputs using Pydantic Field descriptions
+- Implement proper error handling with try-except blocks
+- Use async functions for I/O-bound operations
+- Clean up resources in lifespan context managers
+- Log to stderr to avoid interfering with stdio transport (when using stdio)
+- Use environment variables for configuration
+- Test tools independently before LLM integration
+- Consider security when exposing file system or network access
+- Use structured output for machine-readable data
+- Provide both content and structured data for backward compatibility
+
+## Common Patterns
+
+### Basic Server Setup (stdio)
+```python
+from mcp.server.fastmcp import FastMCP
+
+mcp = FastMCP("My Server")
+
+@mcp.tool()
+def calculate(a: int, b: int, op: str) -> int:
+ """Perform calculation"""
+ if op == "add":
+ return a + b
+ return a - b
+
+if __name__ == "__main__":
+ mcp.run() # stdio by default
+```
+
+### HTTP Server
+```python
+from mcp.server.fastmcp import FastMCP
+
+mcp = FastMCP("My HTTP Server")
+
+@mcp.tool()
+def hello(name: str = "World") -> str:
+ """Greet someone"""
+ return f"Hello, {name}!"
+
+if __name__ == "__main__":
+ mcp.run(transport="streamable-http")
+```
+
+### Tool with Structured Output
+```python
+from pydantic import BaseModel, Field
+
+class WeatherData(BaseModel):
+ temperature: float = Field(description="Temperature in Celsius")
+ condition: str
+ humidity: float
+
+@mcp.tool()
+def get_weather(city: str) -> WeatherData:
+ """Get weather for a city"""
+ return WeatherData(
+ temperature=22.5,
+ condition="sunny",
+ humidity=65.0
+ )
+```
+
+### Dynamic Resource
+```python
+@mcp.resource("users://{user_id}")
+def get_user(user_id: str) -> str:
+ """Get user profile data"""
+ return f"User {user_id} profile data"
+```
+
+### Tool with Context
+```python
+from mcp.server.fastmcp import Context
+from mcp.server.session import ServerSession
+
+@mcp.tool()
+async def process_data(
+ data: str,
+ ctx: Context[ServerSession, None]
+) -> str:
+ """Process data with logging"""
+ await ctx.info(f"Processing: {data}")
+ await ctx.report_progress(0.5, 1.0, "Halfway done")
+ return f"Processed: {data}"
+```
+
+### Tool with Sampling
+```python
+from mcp.server.fastmcp import Context
+from mcp.server.session import ServerSession
+from mcp.types import SamplingMessage, TextContent
+
+@mcp.tool()
+async def summarize(
+ text: str,
+ ctx: Context[ServerSession, None]
+) -> str:
+ """Summarize text using LLM"""
+ result = await ctx.session.create_message(
+ messages=[SamplingMessage(
+ role="user",
+ content=TextContent(type="text", text=f"Summarize: {text}")
+ )],
+ max_tokens=100
+ )
+ return result.content.text if result.content.type == "text" else ""
+```
+
+### Lifespan Management
+```python
+from contextlib import asynccontextmanager
+from dataclasses import dataclass
+from mcp.server.fastmcp import FastMCP, Context
+
+@dataclass
+class AppContext:
+ db: Database
+
+@asynccontextmanager
+async def app_lifespan(server: FastMCP):
+ db = await Database.connect()
+ try:
+ yield AppContext(db=db)
+ finally:
+ await db.disconnect()
+
+mcp = FastMCP("My App", lifespan=app_lifespan)
+
+@mcp.tool()
+def query(sql: str, ctx: Context) -> str:
+ """Query database"""
+ db = ctx.request_context.lifespan_context.db
+ return db.execute(sql)
+```
+
+### Prompt with Messages
+```python
+from mcp.server.fastmcp.prompts import base
+
+@mcp.prompt(title="Code Review")
+def review_code(code: str) -> list[base.Message]:
+ """Create code review prompt"""
+ return [
+ base.UserMessage("Review this code:"),
+ base.UserMessage(code),
+ base.AssistantMessage("I'll review the code for you.")
+ ]
+```
+
+### Error Handling
+```python
+@mcp.tool()
+async def risky_operation(input: str) -> str:
+ """Operation that might fail"""
+ try:
+ result = await perform_operation(input)
+ return f"Success: {result}"
+ except Exception as e:
+ return f"Error: {str(e)}"
+```
diff --git a/prompts/python-mcp-server-generator.prompt.md b/prompts/python-mcp-server-generator.prompt.md
new file mode 100644
index 00000000..df17fbf6
--- /dev/null
+++ b/prompts/python-mcp-server-generator.prompt.md
@@ -0,0 +1,105 @@
+---
+mode: 'agent'
+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.