Get the FREE Ultimate OpenClaw Setup Guide →

MCP

MCP server from Ansh642/MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ansh642-mcp-server node C:/Users/91995/Desktop/mcpServer/index.js \
  --env OPENWEATHER_API_KEY="Your OpenWeatherMap API key"

How to use

This MCP server exposes a tool named getWeatherData that fetches live weather information for a specified city using the OpenWeatherMap API. The tool returns structured details including temperature, humidity, wind speed, and a brief description of the weather. The server is designed to be used with the MCP SDK and supports Stdio transport for CLI-style interactions.

To use it, ensure the server is running (the example uses node index.js as the entry point). Once running, you can invoke the getWeatherData tool by passing a city name, for example: call tool: getWeatherData with { "city": "Delhi" }. The response will include fields such as Temperature, Feels Like, Humidity, Weather, Description, and Wind Speed, formatted for agent consumption. You can integrate this tool into agents or workflows that rely on MCP-enabled weather data to inform decisions or responses.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to a OpenWeatherMap API key
  • Basic knowledge of MCP and how to run node scripts

Install and run:

  1. Clone the repository and install dependencies git clone https://github.com/Ansh642/MCP-Server.git cd mcp-weather-fetcher npm install

  2. Obtain and configure your OpenWeatherMap API key Create a file named .env in the project root and add: OPENWEATHER_API_KEY=your_api_key_here

  3. Run the MCP server node index.js

  4. Optional MCP configuration You can define the server in mcp.json to register the MCP server, for example: { "mcpServers": { "weatherData": { "command": "node", "args": ["path/to/your/index.js"] } } }

Additional notes

Tips and notes:

  • Ensure OPENWEATHER_API_KEY is set in your environment or in a .env file and properly loaded by your Node app.
  • If you modify the path in mcp.json, ensure it points to the actual index.js location.
  • Check OpenWeatherMap API rate limits; heavy automated queries may require a higher tier.
  • The tool is designed for CLI-like Stdio transport; if integrating with agents, ensure the agent framework supports the MCP call format getWeatherData and handles the returned structure.
  • If you encounter CORS or network issues, verify network access from the running environment.
  • Keep the MCP SDK up to date to ensure compatibility with newer MCP specifications.

Related MCP Servers

Sponsor this space

Reach thousands of developers