Weather API MCP Server
Click on "Install 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., "@Weather API MCP Serverwhat's the current 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.
Weather API MCP Server
Single-file HTTP MCP Server for WeatherAPI.com to get current weather, forecasts, and location data, powered by Bun.
Bearer token authentication – uses your WeatherAPI.com API key via Authorization header
Current weather data – get real-time weather conditions for any location
Weather forecasting – get 1-3 day weather predictions
Location search – find and validate location names
Single file implementation – complete MCP server in
simple-mcp-server.tsAll capabilities are exposed as MCP tools over a Bun HTTP server
💡 Don't have Bun? Install it from https://bun.com/
🏗️ Built With
This single-file MCP server uses:
Bun's built-in HTTP server - Ultra-fast native HTTP handling with zero dependencies
Zod - TypeScript-first schema validation for bulletproof input validation
WeatherAPI.com - RESTful API for weather data and forecasts
Native fetch - Built-in HTTP client for API calls
Related MCP server: Simple Weather MCP
🔐 Authentication
This MCP server uses Bearer token authentication with your WeatherAPI.com API key:
Authorization Header Authentication
Include your WeatherAPI.com API key in the Authorization header:
Authorization: Bearer your-weatherapi-key-hereMCP Client Integration
When adding this MCP server to MCP clients (Cursor, Claude Desktop, etc.):
Server URL:
http://localhost:3000/mcpHeaders: Add Authorization header with your API key:
{ "Authorization": "Bearer your-weatherapi-key-here" }
Connecting to Cursor
Cursor is an excellent MCP client that can integrate with this weather API MCP server. Here's how to set it up:
1. Configure Cursor's MCP Settings
Create or edit your Cursor MCP configuration file at ~/.cursor/mcp.json:
{
"mcpServers": {
"weather": {
"type": "http",
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer your-weatherapi-key-here"
}
}
}
}Important: Replace your-weatherapi-key-here with your actual WeatherAPI.com API key.
2. Start Your MCP Server
In a terminal, start the weather API MCP server:
cd weather-api-mcp-server
bun run simple-mcp-server.tsThe server will start on http://localhost:3000/mcp.
3. Restart Cursor
After updating the MCP configuration, restart Cursor completely for the changes to take effect.
4. Verify Connection
Once connected, you can ask Cursor to use the weather tools:
"What's the current weather in London?"
"Get a 3-day forecast for Tokyo"
"Search for locations named Springfield"
Cursor will automatically use the appropriate MCP tool from your weather server to fetch the data.
5. Troubleshooting
If the connection fails:
Check server status: Ensure your MCP server is running on port 3000
Verify API key: Make sure your WeatherAPI.com API key is correct
Check Cursor logs: Look for MCP connection errors in Cursor's developer console
Test manually: Use the MCP Inspector to verify your server works independently
Getting Your API Key
Sign up for free at WeatherAPI.com
Verify your email address
Copy your API key from the dashboard
Use it in the Authorization header as shown above
✨ Features
Capability | WeatherAPI.com endpoint |
Get current weather |
|
Get weather forecast |
|
Search for locations |
|
🗂 Repo layout
.
├─ simple-mcp-server.ts # Complete single-file MCP server
├─ package.json # Dependencies (bun, zod)
├─ tsconfig.json # TypeScript configuration
└─ README.md # This fileThe entire MCP server is implemented in a single TypeScript file (simple-mcp-server.ts) that handles WeatherAPI.com integration.
⚙️ Prerequisites
WeatherAPI.com API key
Sign up for free at https://www.weatherapi.com/signup.aspx
Verify your email address
Get your API key from the dashboard
Free tier includes 1 million calls per month
Bun ≥ 1.2.2 installed locally.
🌍 Configuration
Name | Example | Required | Description |
|
| ❌ | Server port (defaults to 3000) |
🔑 Authentication: API key provided via Authorization header only - no environment variables needed!
🧪 Development & Testing
You can use the official MCP Inspector to interactively test this server.
Start the server in one terminal:
bun run simple-mcp-server.tsRun the inspector in another terminal:
npx @modelcontextprotocol/inspector http://localhost:3000/mcpAdd your API key in the inspector's headers section:
{ "Authorization": "Bearer your-weatherapi-key-here" }
This will launch a web UI where you can see all available tools and manually trigger them with different parameters.
▶️ Running locally
# Install Bun (if you don't have it)
curl -fsSL https://bun.sh/install | bash
# Install deps
bun install
# Run server on port 3000
bun run simple-mcp-server.tsSend a request with curl if you feel like it:
curl -X POST "http://localhost:3000/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-weatherapi-key-here" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "getCurrentWeather",
"arguments": {
"location": "London"
}
}
}'Additional endpoints
Route | Method | Purpose |
| GET/HEAD | Simple health-check (returns |
All responses include Access-Control-Allow-Origin: * so the MCP can be called from a browser without extra CORS configuration.
🛠️ MCP tool set
Tool | Purpose | Input → Output |
| get current weather conditions |
|
| get weather forecast |
|
| find location names |
|
🔍 Parameters:
location: City name, ZIP code, coordinates (lat,lon), or IP address
days: Number of forecast days (1-3, defaults to 3)
query: Search term for location names (partial matches work)
📊 Response Data:
Current weather: Temperature, conditions, humidity, wind, feels-like temperature
Forecast: Daily high/low temperatures, conditions, precipitation chance
Location data: Resolved location name, country, coordinates, timezone
Then use the Authorization header in your requests:
Authorization: Bearer your-weatherapi-key-hereUsage Examples
Current Weather:
# Get current weather for London
{ "location": "London" }
# Use coordinates
{ "location": "40.7128,-74.0060" }
# Use ZIP code
{ "location": "10001" }Weather Forecast:
# 3-day forecast (default)
{ "location": "Tokyo" }
# 1-day forecast
{ "location": "Paris", "days": 1 }
# 2-day forecast
{ "location": "Sydney", "days": 2 }Location Search:
# Find cities named "Springfield"
{ "query": "Springfield" }
# Partial match
{ "query": "Albuquer" }
# International locations
{ "query": "München" }This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mattlgroff/weather-api-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server