Weather MCP Server
Click on "Deploy 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 Server what's the weather in Tokyo?"
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 Model Context Protocol (MCP) server that provides weather information and time utilities for AI assistants and applications.
Overview
This MCP server implements a simple weather service with two main tools:
Weather Information: Get current weather data for any city
Time Service: Retrieve the current timestamp
Built with TypeScript and the official MCP SDK, this server demonstrates how to create custom tools that can be used by Claude Desktop and other MCP-compatible clients.
Related MCP server: Weather MCP Server
Features
π€οΈ Weather Data: Fetch weather information for any city worldwide
β° Time Service: Get current timestamp in ISO format
π Input Validation: Robust parameter validation using Zod schemas
π TypeScript: Full type safety and modern JavaScript features
π‘ stdio Transport: Communicates via standard input/output for seamless integration
Installation
Prerequisites
Node.js 18+
npm or yarn package manager
Setup
Clone the repository
git clone <repository-url> cd my-mcp-serverInstall dependencies
npm installBuild the project
npm run build
Usage
Development
Run the server in development mode:
npm run devProduction
Start the built server:
npm startIntegration with Claude Desktop
Add this server to your Claude Desktop configuration:
{
"mcpServers": {
"weather-server": {
"command": "node",
"args": ["/path/to/my-mcp-server/build/index.js"]
}
}
}Available Tools
get_weather
Retrieves weather information for a specified city.
Parameters:
city(string, required): The city to get weather forunits(string, optional): Temperature units - "metric" or "imperial" (defaults to "metric")
Example Response:
Weather in London:
Temperature: 18Β°C
Conditions: Partly cloudy
Humidity: 65%get_time
Returns the current timestamp in ISO 8601 format.
Parameters: None
Example Response:
Current time: 2025-01-08T14:30:25.123ZProject Structure
my-mcp-server/
βββ index.ts # Main server implementation
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ build/ # Compiled JavaScript output
βββ README.md # This fileTechnical Details
Dependencies
@modelcontextprotocol/sdk: Official MCP SDK for server implementation
axios: HTTP client for external API calls
zod: Runtime type validation and parsing
Architecture
The server follows the MCP specification:
Tool Registration: Tools are registered via
ListToolsRequestSchemahandlerTool Execution: Tool calls are handled via
CallToolRequestSchemahandlerError Handling: Proper MCP error codes and validation
Transport: Uses stdio transport for communication
Weather Data
Currently returns mock weather data for demonstration purposes. To integrate with a real weather API:
Sign up for a weather service (e.g., OpenWeatherMap)
Replace the mock data generation in the
get_weathercaseAdd proper API key handling and HTTP requests
Scripts
npm run build- Compile TypeScript to JavaScriptnpm run dev- Build and run in development modenpm start- Run the compiled server
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Build and test (
npm run build)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is open source and available under the MIT License.
Learn More
Built with β€οΈ using TypeScript and the Model Context Protocol
Available Tools
2 toolsget_timeA
Get the current time
Inputs: no named parameters.
get_weatherB
Get current weather information for a city
Inputs: city (required), units.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: get_weather retrieves current weather data, while get_time retrieves the current time. There is no overlap or ambiguity between them.
Both tool names follow the same get_<noun> pattern with snake_case, creating a predictable and consistent naming convention.
With only 2 tools, the server feels thin for its stated weather domain. While not extreme, the count is borderline and the inclusion of get_time suggests a broader utility scope than the name implies.
The weather domain is significantly under-coveredβonly current conditions are included, with no forecast, historical data, or location search. The get_time tool is also unrelated to weather, leaving obvious gaps for any weather-related workflow.
Maintenance
Related MCP Connectors
Get current weather for any city and create images from your prompts. Streamline planning, reportsβ¦
Current weather and forecast lookup as an agent tool.
Current time, timezone conversion & date math for AI agents. On Cloudflare Workers.
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time weather information and forecasts, connecting AI assistants with live weather data for current conditions and multi-day forecasts for any location worldwide.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch current weather conditions and forecasts for any city using the Open-Meteo API. Provides temperature, precipitation, and hourly forecast data through natural language queries.ISC
- FlicenseNot gradedqualityDmaintenanceProvides weather information through OpenWeather API, enabling users to get current weather conditions, 5-day forecasts, and perform temperature conversions for any city. Offers a secure interface for AI assistants to access comprehensive weather data including temperature, humidity, wind, and pressure information.-
- AlicenseNot gradedqualityDmaintenanceProvides real-time weather data and forecasts for locations worldwide using the OpenWeatherMap API. It enables AI assistants to retrieve current conditions, temperature, and forecasts through a simple tool-based interface.MIT