Weather MCP Server
Enables retrieving weather data through curl commands for current weather, forecasts, alerts, and location searches
Provides a fetch interface for JavaScript applications to access weather data including current conditions, forecasts, and alerts
Runs as a Node.js application with HTTP API endpoints for weather data, requiring Node.js 18 or later
Uses pnpm as the package manager for installation and dependency management
Developed with TypeScript, providing type-safe interfaces for weather data interaction
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 MCP Serverwhat's the forecast for Tokyo this week?"
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 MCP Server
A weather MCP (Model Context Protocol) server developed with TypeScript, providing simulated weather data and related functionality.
Features
π€οΈ Get current weather information
π Multi-day weather forecast
β οΈ Weather alert system
π Location search functionality
π Weather statistics
π Mock data support
Related MCP server: MCP API Server
Install Dependencies
pnpm installπ Usage
Installation and Build
# Install dependencies
pnpm install
# Build project
pnpm run buildStartup Methods
1. MCP Protocol (stdio)
# For MCP client integration
pnpm start2. HTTP API Server π
# Start HTTP server (default port 8080)
pnpm run start:http
# Start HTTP server (specified port 3001)
pnpm run start:http:3001
# Or specify port directly
node dist/http-server.js 80803. Simple HTTP Server (Recommended) π
# Start with default port 8080
pnpm run start:simple
# Start with specific ports
pnpm run start:simple:3000 # Development port
pnpm run start:simple:5000 # Alternative port
pnpm run start:simple:9000 # High port
# Or use the serve commands
pnpm run serve # Default port 8080
pnpm run serve:dev # Development port 3000
pnpm run serve:prod # Production port 8080
# Or specify any port directly
node dist/simple-http-server.js 4000Dynamic Port Support
The simple HTTP server supports dynamic port configuration:
# Use any port you want
node dist/simple-http-server.js 3000
node dist/simple-http-server.js 5000
node dist/simple-http-server.js 9000
node dist/simple-http-server.js 12345The server will automatically:
Use port 8080 as default if no port is specified
Accept any valid port number as a command line argument
Display the actual port in the startup message and documentation
HTTP API Usage Examples
Once the HTTP server is started, you can use it in the following ways:
Browser Access
Open
http://localhost:8080to view API documentationClick links directly to test various APIs
curl Commands
# Get current weather for Hong Kong
curl "http://localhost:8080/weather?location=Hong Kong"
# Get 5-day weather forecast for Tokyo
curl "http://localhost:8080/forecast?location=Tokyo&days=5"
# Get weather alerts
curl "http://localhost:8080/alerts?location=Hong Kong"
# Search locations
curl "http://localhost:8080/locations?q=kong"
# Get statistics
curl "http://localhost:8080/stats"JavaScript/Fetch
// Get weather data
const response = await fetch('http://localhost:8080/weather?location=Tokyo');
const weather = await response.json();
console.log(weather);Development Mode
# Watch mode compilation
pnpm run devAvailable Tools
1. get_current_weather
Get current weather information for a specified location
Parameters:
location(string): Location name
Example:
{
"location": "Hong Kong"
}2. get_weather_forecast
Get weather forecast for a specified location
Parameters:
location(string): Location namedays(number, optional): Forecast days (1-7 days, default 3 days)
Example:
{
"location": "Tokyo",
"days": 5
}3. get_weather_alerts
Get weather alert information
Parameters:
location(string, optional): Location name
Example:
{
"location": "Hong Kong"
}4. search_locations
Search supported locations
Parameters:
query(string): Search keyword
Example:
{
"query": "kong"
}5. get_weather_stats
Get weather statistics
Parameters: None
Supported Locations
Currently supports detailed weather data for the following locations:
Hong Kong
Tokyo, Osaka, Kyoto, Hiroshima, Sapporo, Fukuoka (Japan)
London (UK)
New York (USA)
Sydney (Australia)
Other locations will return randomly generated mock data.
Technical Specifications
Language: TypeScript
Package Manager: pnpm
MCP SDK: @modelcontextprotocol/sdk
Node.js: >=18
Project Structure
src/
βββ index.ts # MCP server main file (stdio)
βββ http-server.ts # HTTP API server
βββ simple-http-server.ts # Simple HTTP server
βββ weather-service.ts # Weather service logic
βββ mock-data.ts # Mock data
βββ types.ts # TypeScript type definitionsHTTP API Endpoints
Endpoint | Method | Parameters | Description |
| GET | - | API documentation page |
| POST | JSON-RPC 2.0 | MCP protocol endpoint |
| GET | location (required) | Get current weather |
| GET | location (required), days (optional) | Get weather forecast |
| GET | location (optional) | Get weather alerts |
| GET | q (required) | Search locations |
| GET | - | Get statistics |
License
MIT License
Available Tools
5 toolsget_current_weatherC
Get current weather information for a specified location
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | Location name (e.g., Hong Kong, Tokyo, London) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions nothing about rate limits, authentication needs, data freshness, error conditions, or response format. 'Get current weather information' implies a read-only operation, but this isn't explicitly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise - a single sentence that communicates the core functionality without any wasted words. It's front-loaded with the essential information and earns its place efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'current weather information' includes, how recent the data is, potential limitations, or what format the response takes. Given the lack of structured metadata, the description should provide more operational context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds minimal value beyond the input schema, which already has 100% coverage with a clear parameter description. The description mentions 'for a specified location' which aligns with the schema's 'location' parameter, but provides no additional semantic context about location formats or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get current weather information') and target resource ('for a specified location'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like get_weather_forecast or get_weather_alerts, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like get_weather_forecast or get_weather_alerts. It simply states what the tool does without context about appropriate use cases or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_alertsC
Get weather alert information
| Name | Required | Description | Default |
|---|---|---|---|
| location | No | Location name (optional, if not provided, get all alerts) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal insight. It doesn't describe whether this is a read-only operation, potential rate limits, authentication needs, data sources, or what 'weather alert information' entails (e.g., severity levels, expiration times). The agent must infer behavior from the generic 'get' verb.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose, though it could be more informative. The brevity is appropriate but risks under-specification rather than true conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns structured alert data. It doesn't explain return values (e.g., list of alerts, timestamps, types), error handling, or how optional location filtering affects results. For a tool with potential complexity in weather data, this leaves significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the parameter 'location' documented as optional for retrieving all alerts. The description adds no parameter-specific details beyond what the schema provides, such as format examples (e.g., city names, coordinates) or how location filtering works. Baseline 3 is appropriate since the schema handles parameter documentation adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get weather alert information' restates the tool name with minimal added specificity. While it includes the verb 'get' and resource 'weather alert information', it doesn't distinguish this tool from its siblings (like get_current_weather or get_weather_forecast) beyond the general alert focus. This is borderline tautological with the name.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention its siblings (e.g., get_current_weather for current conditions, get_weather_forecast for predictions, or search_locations for location lookup), nor does it specify contexts like emergency planning or risk assessment where alerts are most relevant.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_forecastC
Get weather forecast for a specified location
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Forecast days (1-7 days, default is 3 days) | |
| location | Yes | Location name |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe important traits: whether it's read-only or has side effects, authentication requirements, rate limits, error handling, or what the forecast includes (e.g., temperature, precipitation). This leaves significant gaps for a tool that likely queries external data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the core purpose immediately. Every word earns its place without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is incomplete for a weather forecast tool. It doesn't explain what the forecast returns (e.g., time periods, metrics), potential limitations (e.g., accuracy, data sources), or error cases (e.g., invalid location). For a tool with external dependencies and likely structured output, this leaves the agent under-informed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully documents both parameters ('location' and 'days'). The description adds no additional parameter semantics beyond what's in the schema. It mentions 'for a specified location' which aligns with the 'location' parameter but provides no extra context about format or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Get') and resource ('weather forecast'), and specifies the target ('for a specified location'). It distinguishes from sibling 'get_current_weather' by focusing on forecast rather than current conditions. However, it doesn't explicitly differentiate from 'get_weather_stats' which might also involve forecast data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'get_weather_forecast' over 'get_current_weather' or 'get_weather_stats', nor does it specify prerequisites or exclusions. The agent must infer usage from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_statsC
Get weather statistics information
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does at a high level ('Get weather statistics information') without revealing any behavioral traits such as whether it requires authentication, has rate limits, returns historical or aggregated data, or what format the output takes. This leaves critical operational aspects undocumented.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise ('Get weather statistics information'), which is efficient but under-specified. While it avoids unnecessary words, it fails to provide enough context to be useful, making it feel more like under-specification than effective brevity. It's front-loaded but lacks substance, so it doesn't fully earn its place as a helpful description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity implied by 'weather statistics' (which could involve historical data, aggregates, or comparisons), the lack of annotations, no output schema, and a vague description, this is incomplete. The description doesn't clarify what 'statistics' entails, how data is returned, or any operational constraints, leaving significant gaps for an agent to understand and use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and the schema description coverage is 100% (since there are no parameters to describe). With no parameters, the description doesn't need to add semantic details beyond what the schema provides. The baseline for 0 parameters is 4, as there's no parameter information to compensate for or elaborate upon.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get weather statistics information' is a tautology that essentially restates the tool name 'get_weather_stats' with minimal elaboration. While it indicates the general domain (weather statistics), it lacks specificity about what statistics are retrieved, what time periods are covered, or what geographical scope applies. It doesn't distinguish this tool from its siblings like 'get_current_weather' or 'get_weather_forecast' beyond the vague term 'statistics'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions. With siblings like 'get_current_weather', 'get_weather_alerts', and 'get_weather_forecast', there's no indication of when 'statistics' are appropriate versus 'current', 'alerts', or 'forecast' data, leaving the agent to guess based on the tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_locationsC
Search supported locations
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keyword |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It only states the action ('search') without disclosing behavioral traits like what 'supported locations' means, whether results are paginated, if authentication is needed, or any rate limits. This is inadequate for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and a simple but vague purpose, the description is incomplete. It doesn't explain what 'supported locations' are, what the search returns, or how it fits into the server context with sibling weather tools, leaving significant gaps for agent understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the parameter 'query' documented as 'Search keyword'. The description adds no additional meaning beyond this, as it doesn't elaborate on query syntax, examples, or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Search supported locations' states a clear verb ('search') and resource ('locations'), but it's vague about what type of locations and lacks specificity about the search scope. It doesn't distinguish from sibling weather tools, which are unrelated but share the same server context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: get_current_weather for current conditions, get_weather_alerts for alerts, get_weather_forecast for forecasts, get_weather_stats for statistics, and search_locations for location lookup. There is no overlap in functionality that would cause confusion.
All tools follow a consistent verb_noun pattern with 'get_' or 'search_' prefixes, using snake_case throughout. The naming is predictable and easy to understand, with no deviations in style.
With 5 tools, this server is well-scoped for a weather service, covering core needs like current weather, alerts, forecasts, statistics, and location search. Each tool earns its place without being overwhelming or insufficient.
The toolset covers essential weather operations comprehensively, including current conditions, forecasts, alerts, and statistics, with a location search to support them. A minor gap might be historical weather data, but the core workflows are well-covered.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automatiβ¦
MCP server for weather with reasoning β umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA TypeScript-based MCP server that provides weather information through resources and tools, allowing users to access current weather data and forecast predictions for different cities.5
- FlicenseCqualityDmaintenanceA modular MCP server that connects to external APIs, providing tools for weather data, user management, and company operations. Features a scalable architecture with TypeScript support, HTTP client abstraction, and robust error handling.5
- FlicenseNot gradedqualityDmaintenanceA weather simulation MCP server that provides deterministic mock weather data for any city, including current conditions and forecasts.
- AlicenseNot gradedqualityDmaintenanceAn MCP server that offers arithmetic operations (addition and division) and current weather data from OpenWeatherMap. It serves as a learning project for building MCP servers with Node.js and TypeScript, supporting both stdio and Streamable HTTP transports.11ISC
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/bobbyyng/weather-mcp-ts'
If you have feedback or need assistance with the MCP directory API, please join our Discord server