A Node.js MCP server example for the OpenWeather API, requiring an API key.
Bring the model context protocol (MCP) in action:
The MCP server in this example connects to the OpenWeather API.
Actions:
Generate an MCP server, using Postman.
See the sections below for a description of the actions taken.
sudo snap install postman
postman
Login with an account > free plan.
In Postman:
The API requests in this example serve as the "tools" that an LLM can use.
In the ./src directory:
npm install
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.
In the ./src directory:
node mcpServer.js
In this example, we use the OpenWeather API.
In OpenWeather:
Copy the API key into src/.env (not checked in in this repo):
In the ./src directory:
node mcpServer.js
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:
Observe preconfigured models:
Add the running MCP server to Cursor.
{
"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.
Ask a question to the models:
Based on the question, the LLM internally reasons and decides which tool to use in order to produce an answer.
This example is based on:
A Next.js-based MCP server with OAuth 2.1 authentication support using Google as the default provider. Requires a PostgreSQL database and optionally Redis for SSE transport.
A tool for interacting with Jenkins CI/CD servers, requiring environment variables for configuration.
Interact with the Hyperliquid decentralized exchange by integrating its SDK.
Provides sarcastic and cynical code reviews from the perspective of a grumpy senior developer.
connects QGIS Desktop to Claude AI through the MCP. This integration enables prompt-assisted project creation, layer loading, code execution, and more.
A starter project for building MCP servers with TypeScript and Bun.
A TypeScript boilerplate for building MCP servers with streamable HTTP and OAuth proxy support.
A Model Context Protocol (MCP) server that enables AI assistants to integrate with Prometheus Alertmanager
Manage DDEV projects, enabling LLM applications to interact with local development environments through the MCP protocol.
Convert Figma designs into React Native components.