MCP Server
A minimal Python-based server that provides real-time weather data and a safe mathematical expression evaluator. It enables users to fetch current weather conditions and perform complex calculations using the Model Context Protocol.
README
MCP Server
Developed with Claude Code
A minimal Model Context Protocol server written in Python, with two example tools:
| Tool | Description |
|---|---|
get_weather |
Live weather for any city (powered by wttr.in — no API key needed) |
calculate |
Safe evaluation of math expressions (sqrt, sin, pi, **, …) |
Requirements
- Python 3.10+
- pip
Setup
1. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
2. Install dependencies
pip install -r requirements.txt
3. Run the server
MCP servers communicate over stdio, so you normally don't run the server directly — your MCP client launches it. See the client configuration section below.
To verify the server starts without errors:
python server.py
# The process will block waiting for MCP messages — that's expected.
# Press Ctrl+C to quit.
Connecting to Claude Desktop
Add the server to Claude Desktop's config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"example-server": {
"command": "/absolute/path/to/MCP-Server/.venv/bin/python",
"args": ["/absolute/path/to/MCP-Server/server.py"]
}
}
}
Replace the paths with the actual absolute paths on your machine. Restart Claude Desktop after saving.
Connecting via Claude Code (CLI)
claude mcp add example-server \
/absolute/path/to/MCP-Server/.venv/bin/python \
-- /absolute/path/to/MCP-Server/server.py
Tool reference
get_weather
Input: { "city": "Tokyo" }
Output: Weather for Tokyo, Japan:
Condition : Partly cloudy
Temp : 18°C / 64°F
Feels like: 17°C
Humidity : 60%
Wind : 15 km/h NE
calculate
Supported operators: +, -, *, /, **, %, //
Supported functions: abs, round, sqrt, ceil, floor, log, log10, sin, cos, tan
Constants: pi, e
Input: { "expression": "sqrt(2) * pi" }
Output: 4.442882938158366
Input: { "expression": "2 ** 10" }
Output: 1024
Project structure
MCP-Server/
├── server.py # MCP server with tool implementations
├── requirements.txt # Python dependencies
└── README.md
Extending the server
To add a new tool:
- Add a
types.Tool(...)entry insidehandle_list_tools(). - Add a matching
elif name == "your_tool":branch insidehandle_call_tool(). - Implement the tool logic as a plain function (sync) or
asynccoroutine.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.