Weather-MCP-Server
A Weather MCP Server that provides weather data using the Model Context Protocol (MCP). Built with TypeScript and runs on Node.js.
Added on 3/28/2025
Weather MCP Server
This is a Weather MCP Server that provides weather data using the Model Context Protocol (MCP). It is built with TypeScript and runs on Node.js.
๐ Features
- Fetches and processes weather data.
- Uses Model Context Protocol (MCP) SDK.
- Built with TypeScript for type safety.
- Configurable via environment variables.
๐ Installation
1๏ธโฃ Clone the Repository
git clone https://github.com/your-username/weather-mcp-server.git
cd weather-mcp-server
2๏ธโฃ Install Dependencies
npm install
3๏ธโฃ Build the Project
npm run build
4๏ธโฃ Run the Server
npm start
Alternatively, you can run the compiled JavaScript directly:
node build/index.js
๐ง Configuration
This project uses environment variables for configuration. You can create a .env file in the root directory:
API_KEY=your_weather_api_key
PORT=3000
๐ Scripts
| Command | Description |
|---------------|-------------|
| npm run build | Compiles TypeScript into JavaScript |
| npm start | Runs the compiled server |
| npm run lint | Lints TypeScript files using ESLint |
๐ Project Structure
weather-mcp-server/
โโโ src/
โ โโโ index.ts # Main entry point
โโโ build/ # Compiled JavaScript output
โโโ package.json # Project dependencies and scripts
โโโ tsconfig.json # TypeScript configuration
โโโ .eslintrc.js # ESLint configuration
๐ Troubleshooting
- If
npm run builddoesn't produce output, check TypeScript logs:npx tsc --diagnostics - If Node.js cannot find
index.js, ensurebuild/contains compiled files:ls build/ - If running on Windows,
chmodwill fail inpackage.json. Removechmod 755 build/index.jsfrom the build script.
๐ License
This project is licensed under the ISC License.
๐ง Developed by Moiz Ghuman
Similar Resources
Developer Tools