MCP server for fetching and parsing METAR aviation weather data from NOAA's Aviation Weather Center.
poetry installdocker-compose up -dAdd to your MCP client configuration file:
{
"mcpServers": {
"metar": {
"command": "poetry",
"args": ["run", "python", "/path/to/metarmcp/server.py"],
"cwd": "/path/to/metarmcp"
}
}
}Add to your MCP client configuration file:
{
"mcpServers": {
"metar": {
"command": "docker",
"args": ["exec", "-i", "metar-mcp-server", "python", "server.py"]
}
}
}poetry run pytest test_metar.py -v# Build and start
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down
# Rebuild
docker-compose up -d --buildFetch raw METAR data for an airport by ICAO code.
Parameters:
icao_code(string): Airport code (e.g., EFHK, KJFK, EGLL)
Parse raw METAR string into structured JSON.
Parameters:
metar(string): Raw METAR string
Returns:
{
"station": "EFHK",
"time": "021720Z",
"wind": {"direction": 180, "speed_kt": 12},
"visibility": "9999",
"temperature": 12,
"dewpoint": 8,
"pressure_hPa": 1013,
"clouds": ["FEW020", "BKN050"]
}Get METAR data with 30-minute caching.
Parameters:
icao_code(string): Airport code
Returns:
- Cached data if fresh (<30 min)
- Fresh data from API if cache expired
- Fetch real-time METAR and TAF data from NOAA
- Parse METAR/TAF into structured JSON
- Human-readable formatting with descriptions
- SQLite caching (30-minute TTL)
- Full test coverage
- Docker support with security best practices
NOAA Aviation Weather Center: https://aviationweather.gov/
MIT