mcp-server-node
by lucianoayres·★ 75·Score 43
A Node.js MCP server implementation with simple math tools and environment variable retrieval.
Overview
This MCP server demonstrates how to build a custom server in JavaScript using Node.js, featuring two tools: 'add' for mathematical operations and 'getApiKey' for retrieving environment variables. The server includes proper input validation using Zod and supports standard I/O transport for seamless integration with AI-assisted environments like Cursor IDE.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this if you're looking for a clear Node.js example of how to implement MCP tools with validation and environment variable integration.
When NOT to choose this
Don't choose this if you need production-ready features or more complex tool implementations, as it's primarily a demonstration/example.
Tools this server exposes
2 tools extracted from the READMEaddTakes two numeric inputs and returns their sum
getApiKeyRetrieves the API key from the API_KEY environment variable
Comparable tools
Installation
Installation
- Clone the repository:
git clone <repository_url>
cd <repository_directory>- Install dependencies:
npm install- Run the server with MCP Inspector:
npm run inspectorClaude Desktop Configuration
Add to your Claude Desktop config.json:
{
"mcpServers": {
"node-mcp-server": {
"command": "node",
"args": ["/path/to/mcp-server-node/mcp-server.js"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}FAQ
- What is the purpose of this MCP server?
- This server demonstrates how to build an MCP server in Node.js with custom tools and prompts, serving as an educational example for developers looking to extend AI environments with custom functionality.
- How do I integrate this with Cursor IDE?
- Add the server configuration to Cursor's settings under Tools & Integrations, specifying the node command, path to mcp-server.js, and any required environment variables like API_KEY.
Compare mcp-server-node with
Last updated · Auto-generated from public README + GitHub signals.