MCP
MCP server from Ansh642/MCP-Server
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:
-
Clone the repository and install dependencies git clone https://github.com/Ansh642/MCP-Server.git cd mcp-weather-fetcher npm install
-
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
-
Run the MCP server node index.js
-
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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.