abhinav2525/meto_weather_mcp_server
If you are the rightful owner of meto_weather_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Weather MCP Server provides real-time weather information for cities worldwide, integrating seamlessly with AI assistants and IDEs.
Weather MCP Server
A Model Context Protocol (MCP) server that provides real-time weather information for any city worldwide. This server integrates with AI assistants and IDEs to fetch live weather data through simple tool calls.
Features
- Real-time weather data using Open-Meteo APIs
- Global city support with geocoding lookup
- Comprehensive weather info including temperature, humidity, precipitation
- MCP protocol compliance for seamless AI integration
- Error handling for invalid city names
Data Sources
This server fetches data from Open-Meteo, a free weather API service:
- Geocoding API:
https://geocoding-api.open-meteo.com/v1/search- Converts city names to coordinates - Weather API:
https://api.open-meteo.com/v1/forecast- Provides current and hourly weather data - No API key required - Open-Meteo is completely free to use
- High reliability with global coverage
Installation
- Clone or download this repository
- Install dependencies:
npm install
Usage
Running the Server Standalone
npx tsx main.ts
The server will start and listen for MCP protocol messages via stdin/stdout.
Testing with MCP Inspector
To test the server interactively in a web browser:
npx @modelcontextprotocol/inspector npx -y tsx main.ts
This will:
- Start a proxy server (usually on port 6277)
- Provide a session token
- Open a web interface where you can test the
get-weathertool
Integration with IDEs
Cursor IDE
Create a .cursor/mcp.json file in your project root:
{
"mcpServers": {
"weather-server": {
"command": "npx",
"args": [
"-y",
"tsx",
"/absolute/path/to/your/main.ts"
]
}
}
}
Replace /absolute/path/to/your/main.ts with the full path to your main.ts file.
VS Code (with MCP extension)
Install an MCP-compatible extension and configure it to use:
- Command:
npx - Args:
["-y", "tsx", "/absolute/path/to/your/main.ts"]
Other MCP Clients
Any MCP-compatible client can connect to this server using stdio transport. Configure your client to run:
npx -y tsx /path/to/main.ts
Available Tools
get-weather
Fetches current weather information for a specified city.
Parameters:
city(string): Name of the city to get weather for
Example usage:
Tool: get-weather
Input: { "city": "London" }
Response includes:
- Current temperature and humidity
- Precipitation data
- Hourly forecasts
- Weather conditions
Development
Project Structure
main.ts- Main MCP server implementationpackage.json- Dependencies and project config.cursor/mcp.json- Cursor IDE integration config
Requirements
- Node.js 18+
- TypeScript support (via tsx)
Making Changes
- Edit
main.tsto modify server behavior - Restart your MCP client to pick up changes
- Test changes using the MCP inspector
Troubleshooting
"Top-level await not supported"
This project uses ES modules ("type": "module"). The async code is properly wrapped in a main() function.
"Connection Error" in MCP Inspector
- Ensure no other process is using the proxy port
- Check that the server starts without TypeScript errors
- Verify the session token is correct
City Not Found
The server handles unknown cities gracefully and returns a helpful error message. Make sure to use common city names or try alternative spellings.
License
MIT License - Feel free to use and modify as needed.