src/web/mcp/bridges/stdio-nodejs/README.md
This Node.js bridge converts MCP stdio communication to Netdata's MCP over WebSocket.
The easiest way to set up the Node.js bridge is to use the included build script:
# Make the build script executable (if needed)
chmod +x build.sh
# Run the build script
./build.sh
The script will:
Alternatively, you can set it up manually:
# Create a package.json file (optional)
npm init -y
# Install the WebSocket library
npm install ws --save
The script can be run directly as an executable (the shebang line will use the system's Node.js):
./nd-mcp.js ws://<ip>:19999/mcp
Or explicitly with Node.js:
node nd-mcp.js ws://<ip>:19999/mcp
Where <ip> is either localhost or the IP address where a Netdata instance is listening.
To use this bridge with Claude Desktop:
node /path/to/stdio-nodejs/nd-mcp.js ws://localhost:19999/mcp
localhost with the appropriate IP address.The bridge:
This bridge implements robust connection handling:
The reconnection algorithm starts with a 1-second delay and doubles the wait time with each attempt, up to a maximum of 60 seconds. Random jitter is added to prevent connection storms.