MCP Node.js Debugger
workbackai/mcp-nodejs-debugger ยท 300 stars ยท JavaScript
MCP server ๐ MCP Node.js debugger
Install
claude mcp add nodejs-debugger npx @hyperdrive-eng/mcp-nodejs-debuggerThese repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.
Files
MCP Node.js Debugger
An MCP server that gives Cursor or Claude Code access to Node.js at runtime to help you debug: @hyperdrive-eng/mcp-nodejs-debugger.
Demo
Cursor
https://github.com/user-attachments/assets/c193a17e-b0e6-4c51-82aa-7f3f0de17e1a
Claude Code
https://github.com/user-attachments/assets/adb7321b-3a6a-459b-a5c9-df365710d4d8
Quick start
Cursor
- Add to Cursor (
~/.cursor/mcp.json)
+ {
+ "mcpServers": {
+ "nodejs-debugger": {
+ "command": "npx",
+ "args": ["@hyperdrive-eng/mcp-nodejs-debugger"]
+ }
+ }
+ }
- Run a Node.js server in debug mode (i.e. with the
--inspectflat)
node --inspect {file.js}
- Ask Cursor to debug your Node.js server at runtime
Claude Code
- Add to Claude Code
claude mcp add nodejs-debugger npx @hyperdrive-eng/mcp-nodejs-debugger
- Start Claude Code
claude
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โป Welcome to Claude Code research preview! โ
โ โ
โ /help for help โ
โ โ
โ Found 1 MCP server (use /mcp for status) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
- Run a Node.js server in debug mode (i.e. with the
--inspectflat)
# In another terminal
node --inspect {file.js}
- Ask Claude Code to debug your Node.js server at runtime
> I'm getting a runtime error in Node.js
{YOUR_RUNTIME_ERROR}
Please help me debug this error at runtime using the nodejs-debugger mcp.
Usage
Claude Code
- Add to Claude Code
claude mcp add nodejs-debugger npx mcp-nodejs-debugger
- Verify connection
> /mcp
โฟ MCP Server Status
โข nodejs-debugger: connected
- Remove from Claude Code
claude remove nodejs-debugger
Cursor
- Add to Cursor (
~/.cursor/mcp.json)
+ {
+ "mcpServers": {
+ "nodejs-debugger": {
+ "command": "npx",
+ "args": ["@hyperdrive-eng/mcp-nodejs-debugger"]
+ }
+ }
+ }
- Verify connection:
- Remove from Cursor (
~/.cursor/mcp.json):
- {
- "mcpServers": {
- "nodejs-debugger": {
- "command": "npx",
- "args": ["@hyperdrive-eng/mcp-nodejs-debugger"]
- }
- }
- }
Example
Cursor
- Run this simple Node.js app: github.com/mdn/express-locallibrary-tutorial:
node --inspect ./bin/www
- Ask Cursor to set a breakpoint
- Create a book at
localhost:3000/catalog/book/create
- Watch Cursor capture runtime state
Claude Code
- Here is a buggy Node.js server:
node --inspect index.js
Debugger listening on ws://127.0.0.1:9229/2862f5a2-8618-4516-8429-1248b397e9b4
#######################
## THE RUNTIME ERROR ##
#######################
MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (/Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/node_modules/mongoose/lib/connection.js:1110:11)
at NativeConnection.openUri (/Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/node_modules/mongoose/lib/connection.js:1041:11)
at async main (/Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/app.js:35:3) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(3) {
'ac-8e6hgk7-shard-00-01.cojoign.mongodb.net:27017' => [ServerDescription],
'ac-8e6hgk7-shard-00-02.cojoign.mongodb.net:27017' => [ServerDescription],
'ac-8e6hgk7-shard-00-00.cojoign.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'atlas-5syy8t-shard-0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
- Claude Code debugs the Node.js server at runtime:
> I'm getting a runtime error connecting to mongoose. Please help me debug by checking the value of
the mongodb configs at runtime using the nodejs-debugger mcp.
โบ I'll help you debug the mongoose connection issue using the Node.js debugger. Let's first understand where the
MongoDB connection is configured.
โบ Search(pattern: "**/*.js")โฆ
โฟ ย Found 100 files
โบ Let's set a breakpoint at the mongoose connection point and continue:
โบ nodejs-debugger:set_breakpoint (MCP)(file: โฆ
"/Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/app.js",
line: 35)
ย ย โฟ ย Breakpoint set successfully. ID:
2:34:0:file:///Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/app\.js
โบ Let's list all our breakpoints:
โบ nodejs-debugger:list_breakpoints (MCP)
ย ย โฟ ย [
{
"file": "/Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/app.js",
"line": 35,
"id": "2:34:0:file:///Users/arthur/Documents/thirdparties/mdn/express-locallibrary-tutorial/app\\.js"
}
]
โบ Let's try to execute a specific piece of code to check the connection variables:
โบ nodejs-debugger:nodejs_inspect (MCP)(js_code: "// Get the mongoose module and inspect connection\nconst mongoose = โฆ
require('mongoose');\nconsole.log('Current mongoose version:',
mongoose.version);\nconsole.log('Current mongoose connection state:',
mongoose.connection.readyState);\n// Log connection string safely (without
password)\nconst connectionString = process.env.MONGODB_URI || \n
\"mongodb+srv://cooluser:coolpassword@cluster0.cojoign.mongodb.net/local_library?retryWr
ites=true&w=majority&appName=Cluster0\";\nconsole.log('Connection string
(masked):', connectionString.replace(/(?<=mongodb\\+srv:\\/\\/\\w+:)(.+?)(?=@)/,
'*****'));")
ย ย โฟ ย Console output:
[log] Current mongoose version: 8.9.5
[log] Current mongoose connection state: 0
[log] Connection string (masked): mongodb+srv://cooluser:coolpassword@cluster0.cojoign.mongodb.net/local_library?retryWri
tes=true&w=majority&appName=Cluster0
โบ The runtime error you're seeing in your application is related to MongoDB
Atlas connection issues. Based on your error message, the problem is:
1. You're using placeholder credentials ("cooluser:coolpassword")
To fix this, you have two options:
1. Use a local MongoDB instance by changing line 29-30 in app.js to:
const dev_db_url = "mongodb://127.0.0.1:27017/local_library";
2. Or correctly set up MongoDB Atlas:
- Log into Atlas at https://cloud.mongodb.com
- Go to Network Access and add your current IP to whitelist
- Create proper database credentials
- Update the connection string with real credentials
Which option would you like to proceed with?Facts
- Kind
- MCP server
- Repo
- workbackai/mcp-nodejs-debugger
- Group
- Uncategorized
- Stars
- 300
- Language
- JavaScript
- Last push
- 2025-11-13
- Forks
- 17
- Topics
- debugger, mcp, mcp-server, nodejs
- 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
- 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
- 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
- 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
- 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k