mcp-server-template
Verified Safeby fast-ish
Overview
A template for building Model Context Protocol (MCP) servers, enabling AI assistants to interact with external tools, data, and reusable prompts in a structured way.
Installation
npx @modelcontextprotocol/inspector python -m src.serverEnvironment Variables
- MCP_ALLOWED_DIR
- OAUTH_CLIENT_ID
- OAUTH_CLIENT_SECRET
- OAUTH_ISSUER_URL
- DATABASE_URL
- LOG_LEVEL
- DEBUG
Security Notes
The server template explicitly incorporates strong security principles outlined in its 'SECURITY.md'. Key measures include: strict input validation (Zod/Pydantic), robust path traversal prevention for file system access via `MCP_ALLOWED_DIR` environment variable, comprehensive URL validation (blocking private networks, enforcing HTTPS) for HTTP client tools, guidance on parameterized queries for database interactions to prevent SQL injection, and a focus on secure error handling. Authentication via OAuth 2.1 is advised for HTTP transport. No 'eval' or malicious patterns were found, and it avoids hardcoded secrets by directing users to use environment variables.
Similar Servers
mcp-server-python-template
This server acts as a template for building Model Context Protocol (MCP) servers in Python, specifically demonstrating how to expose weather-related tools (get_alerts, get_forecast) by integrating with an external API (National Weather Service) to provide context and actions for AI models.
mcp-typescript-starter
A feature-complete Model Context Protocol (MCP) server template in TypeScript demonstrating all major MCP features for AI assistant interaction.
mcp_server
This server template provides a foundation for building Model Context Protocol (MCP) servers to integrate with AI assistants and other MCP clients, offering tools for GitHub, Microsoft Graph, weather data, and JWT decoding.
mcp-example
A Model Context Protocol (MCP) server that acts as a bridge between Claude Desktop and the Rick and Morty GraphQL API, demonstrating MCP functionality with HTTPS transport.