mcp-nodejs
A Node.js MCP server example for the OpenWeather API, requiring an API key.
Bring the model context protocol (MCP) in action:
- Generate an MCP server (Node.js) from Postman
- Deploy the server locally
- Test the server from a local MCP client (Cursor)
The MCP server in this example connects to the OpenWeather API.
Actions:
Develop
Generate an MCP server, using Postman.
See the sections below for a description of the actions taken.
Install Postman
sudo snap install postman
Start Postman
postman
Login with an account > free plan.
Generate
In Postman:
- API network > MCP Generator
- Search > Openweathermap (by API Evangelist)
- Select APIs > Add Requests
- Generate
- Download ZIP
- Unzip
The API requests in this example serve as the "tools" that an LLM can use.
Build
In the ./src directory:
npm install
Deploy (MCP server)
Start the MCP server and configure it with an API key to access the underlying API.
See the sections below for a description of the actions taken.
Start
In the ./src directory:
node mcpServer.js
Configure
In this example, we use the OpenWeather API.
In OpenWeather:
- Create an account or sign-in
- Save the API key
- https://openweathermap.org/api
Copy the API key into src/.env (not checked in in this repo):
- OPENWEATHERMAP_API_KEY=your_copied_key
Restart
In the ./src directory:
node mcpServer.js
Deploy (MCP client)
Install and configure Cursor as an MCP client that embeds the above deployed MCP server into its models.
In this example, no specific model binding is selected (we just use the Cursor defaults).
See the sections below for a description of the actions taken.
Install Cursor
Install:
Observe preconfigured models:
- Cursor settings > Models
Configure Cursor
Add the running MCP server to Cursor.
- In Cursor, select Cursor Settings > Tools & Integrations > MCP tools > New MCP Server
- Add args: "your-parent-dirs/mcpServer.js"
{ "mcpServers": { "weather-mcp-agent": { "command": "node", "args": ["your-parent-dirs/mcp-nodejs/src/mcpServer.js"] } } }
Observe a green dot, indicating that the MCP-server is ready to use.

Sometimes it seems additionally selecting the disable/enable switch is required.
Test
Ask a question to the models:
- Ctrl-I > "What's the weather in Amsterdam" > Accept
Based on the question, the LLM internally reasons and decides which tool to use in order to produce an answer.

Credits
This example is based on:
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
AgentExecMCP
A secure, Docker-based server providing core execution capabilities for AI agents.
Dify Workflows
An MCP server for executing Dify workflows, configured via environment variables or a config file.
MCPJam Inspector
A developer tool for testing and debugging MCP servers, supporting STDIO, SSE, and Streamable HTTP protocols.
Percepta MCP Server
An AI-driven platform for frontend semantic cognition and automation.
MCP Server
A cross-platform MCP server implementation for Amazon Q and Claude, providing multiple tools in a single executable.
UseGrant MCP Server
Interact with the UseGrant API for programmatic access control and permissions management.
MCP Todo Server
A demo Todo application server built with a clean architecture using MCPServer and JSON Placeholder.
Flutter MCP
A real-time MCP server providing Flutter/Dart documentation and pub.dev package information to AI assistants, supporting over 50,000 packages on demand.
Decoupler MCP
A natural language interface for biological activities analysis using the decoupler tool.
TrueNAS Middleware MCP Server
Accesses optimized documentation from the TrueNAS middleware repository to understand its codebase and APIs.