MCP Weather
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Weather What's the weather in Paris?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Weather
An MCP server that fetches real-time weather for any city — caching popular cities locally and falling back to a live Serper web search formatted by DeepSeek V4 Pro for everything else.
Architecture
┌──────────────┐
Claude / client │ │ MCP tool call
────────────────▶│ get_weather │──────────────┐
│ ("city") │ │
└──────────────┘ │
▼
┌────────────────────┐
│ models.WeatherInput│
│ Pydantic validation │
│ strip / reject junk │
└────────┬───────────┘
│
┌──────────▼──────────┐
│ cache.get(city) │
│ case-insensitive │
└──────┬──────┬────────┘
HIT │ │ MISS
│ │
▼ ▼
┌──────────┐ ┌────────────────────┐
│ return │ │ providers.lookup │
│ summary │ │ _live(city) │
└──────────┘ └────────┬───────────┘
│
┌──────────▼───────────┐
│ Serper Google Search │
│ "weather in {city}" │
│ (retries on failure) │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ DeepSeek V4 Pro │
│ JSON extraction │
│ (OpenRouter) │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ WeatherData model │
│ structured response │
└──────────────────────┘Related MCP server: SteadyFetch
Quick start
1. Install
cd mcp_weather
uv sync2. Set your API keys
Edit .env (or export the env vars):
# OpenRouter — used by DeepSeek V4 Pro to format search results
OPENROUTER_API_KEY="sk-or-v1-..."
# Serper — Google Search API (free tier at https://serper.dev)
SERPER_API_KEY="..."3. Verify with the smoke test
uv run python tests/test_imports.py4. Wire it into Claude Code
Add this to your claude_desktop_config.json or Claude Code MCP config:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"run",
"--directory",
"/Users/konst/Documents/mcp_start/mcp_weather",
"python",
"-m",
"mcp_weather"
]
}
}
}Then restart Claude Code — get_weather will appear in your tool list.
Tool reference
get_weather(city: str) -> str
Returns a one-sentence weather summary for the requested city.
Behaviour | Description |
Cache hit | 12 major cities served instantly from an in-memory cache |
Cache miss | Serper searches Google for current conditions; DeepSeek V4 Pro extracts structured data from the snippets. Retries on transient failures. |
Validation | Pydantic rejects blank, |
Cached cities: Copenhagen, London, New York, Tokyo, Paris, Sydney, Berlin, Dubai, Moscow, Rio de Janeiro, Mumbai, Cape Town.
Project layout
mcp_weather/
├── .env # API keys (git-ignored)
├── .gitignore
├── pyproject.toml # uv project metadata + dependencies
├── README.md
├── src/
│ └── mcp_weather/
│ ├── __init__.py # version
│ ├── __main__.py # python -m entry-point
│ ├── config.py # .env auto-discovery
│ ├── models.py # Pydantic input / output schemas
│ ├── cache.py # in-memory weather cache
│ ├── providers.py # Serper search + DeepSeek formatting (with retries)
│ └── server.py # MCP server definition + main()
└── tests/
└── test_imports.py # offline smoke testDependencies
Package | Purpose |
| MCP server framework |
| Input validation & structured output |
| HTTP client for Serper API (with retries) |
| OpenRouter client (DeepSeek V4 Pro) |
| Fast DataFrames (available for data tasks) |
|
|
License
MIT
Available Tools
1 toolget_weatherA
Get the current weather for a city.
Checks a local cache first. On a cache miss performs a live web search via Serper and formats the result with DeepSeek V4 Pro.
Inputs: city (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly defined as retrieving current weather for a city.
The single tool name 'get_weather' follows a clear verb_noun pattern. While there are no other tools to compare against, the naming is predictable and conventional.
A single tool for a weather server is extremely thin. Users would expect at least a forecast tool, and possibly historical data or location-based lookup, making the count feel inadequate for the domain.
The server only provides current weather, leaving obvious gaps such as forecasts, historical weather, or multi-day outlooks. Agents needing basic weather workflows will hit dead ends quickly.
Related MCP Connectors
Free, keyless real-time weather and 7-day forecasts for any city worldwide.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
Paid web research, news, company briefs, fact-checks and US weather data for AI agents
Current temperature for a city via Open-Meteo. Query discarded after the call.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceUnified real-time search engine skill for AI agents.2,062Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides AI agents with reliable web fetching capabilities, handling retries, caching, and anti-bot bypass automatically.MIT
- AlicenseAqualityDmaintenanceEnables real-time internet searches via DuckDuckGo Lite with automatic retry, smart caching, and category detection for reliable results.1MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to run real-time searches across Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay and other engines, returning results such as answer boxes, news, images, shopping, weather and stock data. Responses are automatically detected and formatted as structured JSON or token-saving Markdown, with optional interactive UI tools for tabular and dashboard views.-