Node MCP Server
MCP Server implemented in JavaScript using Node.js that demonstrates how to build an MCP server with a custom prompt and custom tools, including one that loads an environment variable from a configuration file, to integrate seamlessly with AI-assiste
What is Node MCP Server?
Node MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server implemented in javascript using node.js that demonstrates how to build an mcp server with a custom prompt and custom tools, including one that loads an environment variable from a configura...
MCP Server implemented in JavaScript using Node.js that demonstrates how to build an MCP server with a custom prompt and custom tools, including one that loads an environment variable from a configuration file, to integrate seamlessly with AI-assiste
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP Server implemented in JavaScript using Node.js that demo
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx nodeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Node MCP Server
The Node MCP Server is a reference implementation and learning template for building MCP servers in JavaScript using Node.js and the official MCP SDK. It demonstrates three concrete patterns: a numeric addition tool, an environment variable retrieval tool (getApiKey), and a predefined prompt (add_numbers) that shows how AI clients can discover and invoke tools. Developers use it as a starting point for building their own Node.js-based MCP servers or to understand how tools, resources, and prompts work in the MCP protocol.
Prerequisites
- Node.js 18 or later installed
- npm or npx available on your PATH
- An MCP-compatible client such as Claude Desktop or Cursor IDE
- Basic familiarity with JavaScript/ES modules
Clone the repository
Clone the mcp-server-node repository to your local machine to get the template source code.
git clone https://github.com/lucianoayres/mcp-server-node
cd mcp-server-nodeInstall dependencies
Install the required MCP SDK and Zod validation library.
npm installSet the API_KEY environment variable
The getApiKey tool reads an API_KEY from the environment. Export it before starting the server or include it in your client config.
# macOS / Linux
export API_KEY="your-test-key"
# Windows PowerShell
$env:API_KEY="your-test-key"Test with the MCP Inspector
Use the official MCP Inspector to interactively test all tools before connecting to a full AI client.
npx @modelcontextprotocol/inspector node ./mcp-server.jsConfigure your MCP client
Add the server to your Claude Desktop or Cursor configuration, pointing to the absolute path of mcp-server.js and passing the API_KEY environment variable.
Node MCP Server Examples
Client configuration
Add the Node MCP Server to Claude Desktop's claude_desktop_config.json using the node command with the absolute path to mcp-server.js.
{
"mcpServers": {
"mcp-server-node": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-node/mcp-server.js"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}Prompts to try
Test the three tools the server exposes using natural language.
- "Add 3 and 5"
- "What is 42 plus 58?"
- "What is my API key?"
- "Use the add_numbers tool to compute 100 + 200"Troubleshooting Node MCP Server
Server fails to start with 'Cannot use import statement' error
Ensure your package.json contains '"type": "module"' at the top level. The server uses ES module syntax and requires this flag to run correctly with Node.js.
getApiKey tool returns undefined or empty string
The API_KEY must be set in the environment before the server starts. Add it to the 'env' block in your MCP client configuration rather than relying on shell exports, as MCP clients start the server in a clean environment.
MCP Inspector shows no tools listed
Check that mcp-server.js is the correct entry point file. Run 'node mcp-server.js' directly first to check for syntax errors, then re-launch the inspector.
Frequently Asked Questions about Node MCP Server
What is Node MCP Server?
Node MCP Server is a Model Context Protocol (MCP) server that mcp server implemented in javascript using node.js that demonstrates how to build an mcp server with a custom prompt and custom tools, including one that loads an environment variable from a configuration file, to integrate seamlessly with ai-assiste It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Node MCP Server?
Follow the installation instructions on the Node MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Node MCP Server?
Node MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Node MCP Server free to use?
Yes, Node MCP Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Node MCP Server Alternatives — Similar Developer Tools Servers
Looking for alternatives to Node MCP Server? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Node MCP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Node MCP Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.