mcp-poc
A proof-of-concept MCP server that provides weather information using the Open-Meteo API, with tools for greeting, getting weather by coordinates, and by location name.
README
MCP Weather Server POC
A proof of concept MCP (Model Context Protocol) server that integrates with external REST APIs to provide weather information.
Features
- hello: Simple greeting tool
- get_weather: Get weather by latitude and longitude coordinates
- get_weather_by_location: Get weather by city/location name
Weather Data
This POC uses the Open-Meteo API (free, no API key required):
- Forecast data: https://api.open-meteo.com/v1/forecast
- Geocoding: https://geocoding-api.open-meteo.com/v1/search
Setup
1. Create Virtual Environment (if not already created)
python -m venv venv
2. Activate Virtual Environment
On Windows (PowerShell):
(Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& .\venv\Scripts\Activate.ps1)
On Windows (CMD):
venv\Scripts\activate
On macOS/Linux:
source venv/bin/activate
3. Install Dependencies
pip install -r requirements.txt
Running the Server
python server.py
The server will start and be ready to receive requests from MCP clients.
Usage Examples
In an MCP Client
Get weather by location name
Tool: get_weather_by_location
Parameters:
- location: "London"
Response:
Current Weather in London, United Kingdom:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Temperature: 15.2°C
Humidity: 72%
Condition: Partly cloudy
Wind Speed: 12.5 km/h
Time: 2024-06-25T14:30
Get weather by coordinates
Tool: get_weather
Parameters:
- latitude: 51.5074
- longitude: -0.1278
Simple greeting
Tool: hello
Parameters:
- name: "World"
Testing with curl (if exposed via HTTP)
curl http://localhost:8000/tools/call \
-X POST \
-H "Content-Type: application/json" \
-d '{"tool": "get_weather_by_location", "params": {"location": "Tokyo"}}'
Supported Weather Codes
The server uses WMO weather codes and interprets them as:
- 0: Clear sky
- 1-3: Various cloud coverage
- 45-48: Fog conditions
- 51-82: Various precipitation types
- 95-99: Thunderstorm conditions
Architecture
┌──────────────────┐
│ MCP Client │
└────────┬─────────┘
│
│ (MCP Protocol)
│
┌────────▼─────────────────┐
│ MCP Server (FastMCP) │
│ ┌──────────────────────┐│
│ │ Tools: ││
│ │ - hello ││
│ │ - get_weather ││
│ │ - get_weather_... ││
│ └──────────────────────┘│
└────────┬─────────────────┘
│
│ (REST API)
│
┌────────▼──────────────────┐
│ Open-Meteo API │
│ - Weather Data │
│ - Geocoding │
└───────────────────────────┘
Error Handling
The server includes error handling for:
- Network timeouts
- Connection errors
- Invalid locations
- HTTP errors
- Malformed responses
License
MIT License
Future Enhancements
- Add historical weather data
- Add weather forecasts (multi-day)
- Add severe weather alerts
- Add precipitation probability
- Support multiple weather providers
- Add caching for repeated requests
- Add UV index information
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.
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.
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.
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.