mcp-server-python-template
Verified Safeby Cris-0k
Overview
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.
Installation
uv run server.py --transport stdioSecurity Notes
The server interacts with an external API (api.weather.gov). While 'httpx' is generally safe for making HTTP calls, any external interaction always carries inherent risks (e.g., API compromise, data integrity). The input parameters for tools (state, latitude, longitude) are expected to be validated by the FastMCP framework's type hinting, mitigating basic injection risks. There are no 'eval' or direct 'subprocess.run' calls without sanitization. No hardcoded sensitive API keys are present for this specific weather API (which is public). The use of 'request._send' in 'create_starlette_app' is a private API access in Starlette, which is not a security vulnerability but can lead to fragility.
Similar Servers
zeromcp
A minimal, pure Python Model Context Protocol (MCP) server for exposing tools, resources, and prompts via HTTP/SSE and Stdio transports.
mcp-python-starter
A feature-complete Model Context Protocol (MCP) server template in Python for developing AI applications and agents.
tenets
Provides intelligent, token-optimized code context and automatically injects guiding principles to AI coding assistants for enhanced understanding and consistent interactions.
mcp-go-starter
A feature-complete Model Context Protocol (MCP) server template in Go demonstrating tools, resources, and prompts for AI agent interaction.