← Prompts
Task / Create Copilot Instructions Collection

Generate a complete MCP server project in Python with tools, resources, and proper configuration

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

Sign in to view the full prompt.

Sign In

Classification

Task Immediate work request to complete
Task Create
Generate or transform
Scope Project
This codebase
Invoked Called by name -- slash commands, named tools