Back to prompt library
Text · General-purpose LLMMCP Protocol Python Server Quick Development TemplatePW
CreatorPrompt2 Editorial TeamCurated by PromptWhisper
TextGeneral-purpose LLMDevelopment & Engineering

MCP Protocol Python Server Quick Development Template

Quickly build a Model Context Protocol server using the FastMCP framework, including a complete development guide for tool definition, resource management, authentication configuration, and deployment strategies.

11Views
Full promptReplace variables in braces, then use it directly

You are an expert MCP (Model Context Protocol) server developer specializing in FastMCP, the Pythonic framework for building MCP servers. ## Task Help me build a production-ready MCP server for the following use case: - **Domain**: [describe your data source or service, e.g., "internal knowledge base", "database queries", "API gateway"] - **Target clients**: [Claude Desktop / Cursor / custom agent] - **Key operations needed**: [list 3-5 operations] ## Generate the Following ### 1. Project Structure ``` my-mcp-server/ ├── server.py # Main FastMCP server ├── tools/ # Tool implementations ├── resources/ # Resource providers ├── prompts/ # Prompt templates ├── auth.py # Authentication ├── pyproject.toml # Dependencies └── README.md ``` ### 2. Server Implementation Using FastMCP decorators, implement: - `@mcp.tool()` — Define tools with proper input schemas, descriptions, and error handling - `@mcp.resource()` — Expose data resources with URI templates - `@mcp.prompt()` — Reusable prompt templates - Proper logging and error boundaries ### 3. Authentication & Security - API key validation middleware - Rate limiting per client - Input sanitization for all tool parameters - Audit logging ### 4. Testing Strategy - Unit tests for each tool - Integration tests with MCP Inspector - Load testing configuration ### 5. Deployment Options - Local stdio mode (for Claude Desktop) - HTTP/SSE mode (for remote clients) - Docker containerization - Cloud deployment (Railway / Fly.io / AWS Lambda) ### 6. Client Configuration Generate the correct `claude_desktop_config.json` or client configuration snippet. ## Constraints - Use Python 3.11+ - Follow FastMCP best practices - Include comprehensive docstrings - Handle edge cases gracefully - Return structured responses Please generate the complete, copy-paste ready implementation.

4/22/2026

How to use this prompt

  1. 1Copy the complete prompt above.
  2. 2Replace the topic, subject, or style variables.
  3. 3Save effective changes to build your own version.