Weather MCP Server
A simple Model Context Protocol (MCP) server for retrieving weather information.
Built with Smithery SDK
Prerequisites
- Smithery API key: Get yours at smithery.ai/account/api-keys
- OpenWeatherMap API key: Get yours at openweathermap.org/api
Getting Started
Install dependencies:
npm installStart development server:
npm run dev
The server will open in your browser at http://localhost:8081 with an interactive Smithery playground.
Configuration
weatherApiKey(required): Your OpenWeatherMap API keytemperatureUnit(optional): Set to "celsius" or "fahrenheit" (default: "celsius")
Example connection URL:
http://localhost:8081/mcp?weatherApiKey=your_api_key&temperatureUnit=fahrenheit
Available Tools
get-weather
Get current weather for a location.
Input:
location(string, required): City name
Output:
- Location, temperature, and weather condition
Development
Your code is organized as:
src/index.ts- MCP server with toolssmithery.yaml- Runtime specification
Build
npm run build
Creates bundled server in .smithery/
Deploy
Ready to deploy? Push your code to GitHub and deploy to Smithery:
Create a new repository at github.com/new
Initialize git and push to GitHub:
git add . git commit -m "Initial commit" git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git git push -u origin mainDeploy your server to Smithery at smithery.ai/new