UK Weather & Travel Outfit Recommender MCP Server
Combines UK Met Office weather forecasts with travel routing to provide outfit recommendations for walking, cycling, or driving journeys.
README
UK Weather & Travel Outfit Recommender MCP Server
A Model Context Protocol (MCP) server that combines Met Office weather data with travel routing to recommend what to wear for your journey.
Features
- Outfit Recommendations: Get personalised clothing suggestions based on weather conditions and your travel plans
- Weather Forecasts: Detailed hourly weather forecasts for UK locations
- Travel Information: Calculate travel time and distance between locations
- Supports multiple travel modes: walking, cycling, and driving
- Real-time UK weather data from the Met Office DataHub API
- Intelligent clothing recommendations based on temperature, precipitation, wind, and UV index
Prerequisites
- Python 3.12 or higher
- uv package manager
- Met Office DataHub API key (register at https://datahub.metoffice.gov.uk/)
Installation
- Clone the repository:
git clone <repository-url>
cd commute_mcp
- Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
- Set up your Met Office API key:
export MET_OFFICE_API_KEY="your-api-key-here"
Usage
Running as an MCP Server
Start the server using stdio transport:
python -m src.server
The server provides three tools:
1. Get Outfit Recommendation
Analyses your journey and provides clothing recommendations:
{
"name": "get_outfit_recommendation",
"arguments": {
"origin": "Bristol",
"destination": "Bath",
"travel_mode": "walking",
"hours_until_departure": 0
}
}
Parameters:
origin(required): Starting location (e.g., "Bristol", "London Bridge")destination(required): Destination locationtravel_mode(optional): "walking", "cycling", or "driving" (default: "walking")hours_until_departure(optional): Hours until you leave, 0 for now (default: 0)
2. Get Weather Forecast
Get detailed hourly weather forecast for a UK location:
{
"name": "get_weather_forecast",
"arguments": {
"location": "Manchester",
"hours": 12
}
}
Parameters:
location(required): Location name (e.g., "Bristol", "Edinburgh")hours(optional): Number of hours to forecast (default: 12)
3. Get Travel Information
Calculate travel time and distance:
{
"name": "get_travel_info",
"arguments": {
"origin": "London",
"destination": "Cambridge",
"mode": "driving"
}
}
Parameters:
origin(required): Starting locationdestination(required): Destination locationmode(optional): "walking", "cycling", or "driving" (default: "walking")
Using with Claude Desktop
To use this MCP server with Claude Desktop, add it to your Claude configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"commute-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/commute_mcp", "run", "python", "-m", "src.server"],
"env": {
"MET_OFFICE_API_KEY": "your-api-key-here"
}
}
}
}
Then restart Claude Desktop. You can now ask Claude questions like:
- "What should I wear for a walk from Bristol to Bath?"
- "What's the weather forecast for Edinburgh for the next 6 hours?"
- "How long would it take to cycle from Manchester to Salford?"
How It Works
- Geocoding: Converts location names to coordinates using OpenStreetMap's Nominatim API
- Routing: Calculates travel time and distance using OSRM (Open Source Routing Machine)
- Weather Data: Fetches hourly forecasts from the Met Office DataHub API
- Analysis: Analyses weather conditions for your journey window
- Recommendations: Generates clothing suggestions based on:
- Temperature and "feels like" temperature
- Precipitation probability
- Wind speed and gusts
- UV index
- Travel mode and duration
Development
Running Tests
pytest tests/
Project Structure
commute_mcp/
├── src/
│ ├── __init__.py
│ ├── server.py # MCP server and tool handlers
│ ├── location.py # Geocoding and routing
│ ├── weather.py # Weather data and outfit recommendations
│ └── preferences.py # User preferences management
├── tests/
│ ├── test_api.py
│ └── test_geocode.py
├── pyproject.toml
└── README.md
APIs Used
- Met Office DataHub: Weather forecasts for UK locations
- OSRM: Open-source routing engine for travel calculations
- Nominatim: OpenStreetMap geocoding service
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。