Node MCP Server

v1.0.0Developer Toolsstable

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

aicursormcp-servernodejs
Share:
75
Stars
0
Downloads
0
Weekly
0/5

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

Node.js MCP server template
Custom prompt and tool implementation
JavaScript-based server framework
lucianoayres

Maintainer

LicenseMIT
Languagejavascript
Versionv1.0.0
UpdatedMay 10, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx node

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-node
2

Install dependencies

Install the required MCP SDK and Zod validation library.

npm install
3

Set 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"
4

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.js
5

Configure 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.

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.

Quick Config Preview

{ "mcpServers": { "node": { "command": "npx", "args": ["-y", "node"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides