Get an MCP server running in under 2 minutes! This repository contains complete, ready-to-run templates for single file self-contained MCP servers in both Python/uv and TypeScript/Deno.
- ⚡ Instant Setup: Copy, paste, run - no complex configuration needed
- 🎯 Production Ready: Both templates use official Anthropic SDKs
- 📚 Comprehensive Examples: Everything documented with working code
- 🔧 Easily Extensible: Add your own tools, resources, and prompts in minutes
- 💡 Perfect for Experimentation: The fastest way to test MCP ideas locally
Two functionally identical, battle-tested templates:
- ez-mcp.py - Python server using official MCP SDK with FastMCP
- ez-mcp.ts - TypeScript server using official MCP SDK with Deno
Each template demonstrates all core MCP features:
- 📊 Resources: Dynamic data sources for LLM context
- 🛠️ Tools: Functions LLMs can call to perform actions
- 📝 Prompts: Reusable templates for LLM interactions
- ⚙️ Configuration: Environment variable support
Want to see these servers in action? Pick your language and run:
Both servers will start immediately and show you what's available!
The fastest way to build your own MCP server is to copy one of our templates and customise it. Both templates are functionally identical and production-ready - just pick your preferred language!
-
Copy the template:
curl -O https://raw.githubusercontent.com/your-repo/ez-mcp/main/ez-mcp.py # Or just copy the ez-mcp.py file contents from this repo -
Rename and customise:
cp ez-mcp.py my-awesome-server.py -
Edit the server details (around line 160):
mcp = FastMCP( name="My Awesome Server", # <- Change this to your server name dependencies=["mcp>=1.9.0"] ) -
Add your own tools (copy this pattern anywhere in the file):
@mcp.tool() def my_custom_tool(input_text: str) -> str: """Describe what your tool does""" # Your logic here return f"Processed: {input_text}" -
Run your server:
uv run my-awesome-server.py
-
Copy the template:
curl -O https://raw.githubusercontent.com/your-repo/ez-mcp/main/ez-mcp.ts # Or just copy the ez-mcp.ts file contents from this repo -
Rename and customise:
cp ez-mcp.ts my-awesome-server.ts chmod +x my-awesome-server.ts -
Edit the server details (around line 160):
const server = new McpServer({ name: "My Awesome Server", // <- Change this to your server name version: "1.0.0" }); -
Add your own tools (copy this pattern anywhere in the file):
server.tool( "my-custom-tool", { input_text: z.string() }, async ({ input_text }) => ({ content: [{ type: "text", text: `Processed: ${input_text}` }] }) ); -
Run your server:
deno run --allow-all my-awesome-server.ts
You now have a working MCP server! The templates include extensive inline documentation and examples for adding:
- Database connections (SQLite, PostgreSQL, etc.)
- API integrations (REST APIs, GraphQL, etc.)
- File operations (reading, writing, searching)
- Web scraping
- Environment variables and configuration
- Error handling and validation
Just read through the template code - it's designed to teach you everything you need to know!
Once your server is running, connect it to any MCP client:
Add to your mcp.json file:
The MCP Inspector provides a web interface to test your server:
This opens a web interface where you can:
- 🔍 Browse available tools, resources, and prompts
- ▶️ Test tools with different parameters
- 📖 View resource contents
- 🧪 Experiment with prompts
Edit the dependencies section at the top of your .py file:
Simply import what you need - Deno handles the rest:
Both templates include identical functionality to demonstrate all MCP capabilities:
- server://info - Dynamic server information
- Shows how to create data sources that LLMs can access
- Perfect for configuration, documentation, or live data
- hello_someone (Python) / hello-someone (TypeScript)
- Demonstrates parameter validation and environment variables
- Template for any function you want LLMs to call
- greeting_prompt (Python) / greeting-prompt (TypeScript)
- Shows how to create reusable prompt templates
- Perfect for complex instructions or workflows
- Environment variable support (GREETING_PREFIX)
- Error handling and input validation
- Production-ready logging and startup messages
Perfect for:
- 🧪 Rapid Prototyping: Test MCP ideas in minutes
- 🔧 Personal Automation: Quick scripts for daily tasks
- 📊 Data Access: Connect LLMs to your databases/APIs
- 🌐 Web Integration: Scrape sites, call APIs, process data
- 📁 File Operations: Search, read, write, organise files
- 🔍 Development Tools: Code analysis, documentation, testing
- 💼 Business Logic: Custom workflows and integrations
- 📖 MCP Specification: https://modelcontextprotocol.io/
- 🐍 Python SDK Docs: https://github.com/modelcontextprotocol/python-sdk
- 📜 TypeScript SDK Docs: https://github.com/modelcontextprotocol/typescript-sdk
- � MCP Community: Join the discussions and get help
Both template files contain extensive inline documentation with:
- Line-by-line explanations
- Advanced usage patterns
- Integration examples (databases, APIs, file systems)
- Error handling best practices
- Performance optimisation tips
- Production deployment guidance
Read the source code - it's designed to teach you everything you need to know!
Found these templates helpful? Have ideas for improvements? We'd love to hear from you!
- 🐛 Report issues or suggest features
- 📝 Share your cool MCP server creations
- 🔧 Submit improvements to the templates
- 📚 Help improve documentation
MIT License - Use these templates however you want! See LICENSE file for details.
© Eleanor Berger — ai.intellectronica.net