M
My MCP
by @tareq199923
MCP server by tareq199923
Created 5/19/2026
Updated about 4 hours ago
README
Repository documentation and setup instructions
my-mcp
A small demonstration repository showing how to build Model Context Protocol (MCP) servers in Node.js using the @modelcontextprotocol/sdk package.
This project includes two example server scripts:
mcp.js- a minimal MCP server exposing a simple addition tool.weather.js- an MCP server exposing a weather lookup tool using the Open-Meteo API.
Features
-
mcp.js- Registers an
addtool that accepts two numbers and returns their sum. - Demonstrates basic MCP server setup and tool registration.
- Registers an
-
weather.js- Registers a
get_weathertool that fetches current weather for a latitude/longitude pair. - Uses
openmeteoandzodfor API calls and input validation. - Returns both human-readable text and structured output.
- Registers a
Prerequisites
- Node.js 18+ installed
- Internet access for the weather example
Install
npm install
Usage
Run the addition server:
node mcp.js
Run the weather server:
node weather.js
Each script starts an MCP server using StdioServerTransport, so it expects MCP-compatible client communication over standard input/output.
File Overview
mcp.js- MCP server example registering anaddtool.weather.js- MCP server example registering aget_weathertool.package.json- project metadata and dependencies.
Dependencies
@modelcontextprotocol/sdk- MCP server SDKopenmeteo- helper for Open-Meteo weather API requestszod- runtime schema validation
Notes
- The
weather.jsexample uses Open-Meteo query parameters to request current weather variables. - The example returns structured data for temperature, humidity, wind, precipitation, and day/night state.
Extending this project
- Add more MCP tools to either server.
- Add a client implementation to send MCP requests and receive tool results.
- Replace the default
StdioServerTransportwith another transport for different integration patterns.
Quick Setup
Installation guide for this server
Install Package (if required)
npx @modelcontextprotocol/server-my-mcp
Cursor configuration (mcp.json)
{
"mcpServers": {
"tareq199923-my-mcp": {
"command": "npx",
"args": [
"tareq199923-my-mcp"
]
}
}
}