Nexera Debugger MCP
OfficialREADME.md
<!--
MIT License
Copyright (c) 2026 Nexera Digital (https://nexeradigital.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
[](https://github.com/NexeraDigital/oss-nexera-debugger-mcp/actions/workflows/ci.yml)
# Nexera Debugger MCP
A VS Code extension that gives AI agents the ability to **interactively debug** applications — the same way a human developer would — through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Works with **VS Code**, **Antigravity**, and any MCP-compatible AI client.
Instead of relying on `console.log` statements scattered through code and parsing log files after the fact, agents using Nexera Debugger MCP can set breakpoints, pause execution at the exact point of failure, step through code line by line, inspect variables in their live runtime state, evaluate expressions in context, and navigate the call stack. This is the difference between *guessing* what went wrong from a log and *seeing* it happen in real time.
## Why Interactive Debugging for AI?
| | `console.log` Debugging | Interactive Debugging (MCP) |
|---|---|---|
| **Precision** | Requires pre-guessing which variables to log | Inspect *any* variable at *any* point, on demand |
| **Iteration speed** | Change code → re-run → read logs → repeat | Pause → inspect → step → continue, no code changes |
| **Async & concurrency** | Logs interleave, hard to follow execution order | Step through exact execution path, one thread at a time |
| **Root cause depth** | Surface-level: you see values, not *why* | Full call stack, scopes, closures, and live evaluation |
| **Browser debugging** | `console.log` can't inspect DOM state or network | CDP mode: screenshots, DOM snapshots, network activity |
| **Code pollution** | Leftover `console.log` litters the codebase | Zero instrumentation — breakpoints are ephemeral |
Nexera Debugger MCP transforms an AI agent from a *code generator that guesses at bugs* into a **reasoning debugger that observes, hypothesizes, and verifies** — the same feedback loop that makes experienced developers effective.
## Check it out
https://github.com/user-attachments/assets/bc632185-6668-43df-be30-215fac79380a
## Why We Built This
We wanted to answer one big question: **how do AI agents reason when they can interact with running code?**
This project gives agents the same debugging tools a human developer uses — breakpoints, stepping, variable inspection, live evaluation — and lets them navigate a codebase to find and fix bugs through observation rather than guesswork.
We built this because:
- 🔬 **We're exploring** how agents interact with the SDLC — not just writing code, but understanding it at runtime
- 🤝 **We want community input** — contributions, ideas, and feedback are welcome
- 🎯 **It's genuinely useful** — watching an AI agent step through code, reason about state, and zero in on a bug is kind of amazing
If you see ways to make it better — PRs are welcome. 🚀
## ⚠️ Security Considerations
Before enabling this extension, understand the risks:
### Arbitrary Code Execution
Some tools in this MCP allow the agent to **execute arbitrary code** in the context of your running application. These are classified as **Tier 3** tools:
| Tier 3 Tool | What it does |
|-------------|-------------|
| `eval_expression` | Evaluate any expression in the debug context |
| `eval_repl` | Execute code in the REPL with side effects |
| `eval_set_variable` | Modify variable values in live memory |
By default, **all tiers are enabled**. If you want to restrict the agent to read-only inspection and standard debugging controls, disable Tier 3 in your VS Code settings:
```jsonc
{
// Only allow read-only (tier1) and standard debugging (tier2) tools
"debugAutomation.security.allowedTiers": ["tier1", "tier2"]
}
```
See [MCP_TOOLS_REFERENCE.md](docs/MCP_TOOLS_REFERENCE.md) for the full tier breakdown.
### Sensitive Data Exposure
When an agent inspects variables, evaluates expressions, or reads memory, it may encounter **sensitive information** — API keys, tokens, passwords, PII, or other secrets that exist in your application's runtime state. Be aware that:
- Variable values returned by `inspect_variables` and `eval_expression` are sent back to the agent (and potentially logged or forwarded to other tools in the chain)
- The extension **does not filter or redact** sensitive values — it returns exactly what the debugger sees
- Console output captured by `observe_console` may also contain sensitive data
**Recommendation**: Use this tool in development environments with test data. Be cautious when debugging applications that handle production secrets or real user data.
### Token Usage & Cost
> [!CAUTION]
> **Active debugging sessions are token-intensive.** Be aware of the impact on your AI usage quotas and costs before starting extended debugging sessions.
Interactive debugging is inherently **chatty**. Every step, breakpoint hit, variable inspection, scope enumeration, and expression evaluation is a separate MCP tool call — each one a round-trip that sends structured data back to the agent and consumes input and output tokens. A single debugging session that steps through 10 lines, inspects 3 scopes, and evaluates a few expressions can easily generate **dozens of tool calls** with substantial response payloads.
This means:
- **VS Code Copilot / GitHub Copilot**: Debugging sessions will consume your premium request allocation significantly faster than normal code generation or chat interactions. If you're on a usage-limited plan, a single thorough debugging session could use a meaningful portion of your quota.
- **Antigravity**: Model selection matters — debugging with a frontier model (e.g., Claude Opus, GPT-5.2, Gemini 3.0 Pro) will cost considerably more per session than using a smaller model. Consider whether the bug requires deep reasoning or if a lighter model would suffice.
- **Any MCP client with metered API access**: The same applies. Each tool call response — especially `inspect_variables` with large objects, `browser_dom_snapshot`, or `browser_screenshot` — can return large payloads that inflate token counts.
**Tips to manage usage:**
- 🎯 **Be targeted** — give the agent a clear description of the bug and which file/function to investigate, rather than asking it to "explore the entire app"
- ⏱️ **Set boundaries** — ask the agent to stop after finding the first bug, rather than exhaustively testing everything
- 📉 **Use lighter models for triage** — save frontier models for complex bugs that require deep reasoning
- 🔍 **Use `console.log` for breadth, MCP debugging for depth** — if you're not sure where the bug is, narrow it down with logs first, then attach the debugger to the specific area
## MCP Tool Surface — 34 Tools
The extension exposes **34 MCP tools** organized into 8 categories. All tools work across both DAP (VS Code debugger) and CDP (Chrome DevTools Protocol) modes where applicable.
### Session Management (4 tools)
| Tool | Description |
|------|-------------|
| `session_start` | Start a new debug session (DAP or CDP). Auto-detects child sessions and returns agent-friendly guidance. |
| `session_stop` | Stop a debug session. |
| `session_list` | List active sessions. Parent/launcher sessions are hidden by default for simplicity. |
| `session_info` | Get detailed session information and automation context. |
### Execution Control (7 tools)
| Tool | Description |
|------|-------------|
| `exec_continue` | Resume execution. Thread IDs are auto-resolved. |
| `exec_pause` | Pause execution. |
| `exec_step_over` | Step over the current line. |
| `exec_step_into` | Step into a function call. |
| `exec_step_out` | Step out of the current function. |
| `exec_run_to` | Run to a specific file and line (DAP only). |
| `exec_paused_state` | Get detailed paused state including pause reason and hit breakpoints. |
### Inspection (6 tools)
| Tool | Description |
|------|-------------|
| `inspect_threads` | List all threads in the debug session (DAP only). |
| `inspect_stack_trace` | Get the call stack. Thread ID auto-resolved if omitted. |
| `inspect_scopes` | Get variable scopes for a call frame. |
| `inspect_variables` | Get variables from a scope, or by path. |
| `inspect_watch` | Add a watch expression (DAP only). |
| `inspect_memory` | Read memory or disassembly (DAP only). |
### Breakpoints (5 tools)
| Tool | Description |
|------|-------------|
| `breakpoint_add` | Add line, function, data, or log breakpoints. Supports conditions and hit counts. |
| `breakpoint_remove` | Remove one or all breakpoints. |
| `breakpoint_list` | List all breakpoints. |
| `breakpoint_toggle` | Enable or disable breakpoints. |
| `breakpoint_exceptions` | Configure exception breakpoints (caught/uncaught). |
### Evaluation (3 tools)
| Tool | Description |
|------|-------------|
| `eval_expression` | Evaluate an expression in the current debug context. |
| `eval_repl` | Evaluate an expression in REPL context for side effects (DAP only). |
| `eval_set_variable` | Set a variable value in the current context. |
### Browser & CDP (7 tools)
| Tool | Description |
|------|-------------|
| `browser_launch` | Launch a browser with remote debugging enabled. |
| `browser_tab_create` | Create a new browser tab. |
| `browser_tab_list` | List all open browser tabs. |
| `browser_tab_get` | Get details for a specific tab. |
| `browser_tab_refresh` | Refresh a browser tab. |
| `browser_screenshot` | Take a screenshot of the browser page. |
| `browser_dom_snapshot` | Get a DOM structure snapshot. |
### Observability (2 tools)
| Tool | Description |
|------|-------------|
| `observe_console` | Get console output from the debug session. |
| `observe_network` | Get network request activity (CDP only). |
> For full parameter documentation, see [MCP Tools Reference](docs/MCP_TOOLS_REFERENCE.md).
## Architecture Overview
The extension is organized into focused modules:
- **VS Code extension entrypoint** (`src/extension.ts`) — wires up commands, configuration, and the UI surface.
- **MCP server + bridge** (`src/mcpServer.ts`, `src/websocketServer.ts`, `src/bridge/`) — handle MCP request processing and WebSocket transport.
- **Debug session orchestration** (`src/debugManager.ts`, `src/models/`) — manages session lifecycle and state.
- **Tool surface** (`src/tools/consolidated/`) — 34 MCP tools for session control, breakpoints, evaluation, inspection, and browser interaction.
- **CDP integration** (`src/cdp/`) — Chrome DevTools Protocol tooling for browser debugging.
- **Security** (`src/security/`) — authorization tiers and validation rules.
- **UI Views** (`src/views/`) — MCP control panel in VS Code.
## Getting Started
### Prerequisites
- Node.js (current LTS recommended)
- VS Code 1.96+ or VS Code Insiders
### Install Dependencies
```bash
npm install
```
### Build the Extension
```bash
npm run compile
```
### Package a VSIX
```bash
npx vsce package --no-dependencies
```
### Install the VSIX
```bash
code --install-extension nexera-debugger-mcp-*.vsix
```
## MCP Server & Configuration
The MCP server starts automatically (configurable via settings). You can also control it from the **Debug Automation** view in the VS Code Activity Bar.
### VS Code MCP Configuration
Use one of these commands:
- **Debug Automation: Configure mcp.json** (writes a file to your chosen location).
- **Debug Automation: Copy MCP Config (VS Code)** (copies a JSON snippet to the clipboard).
A typical VS Code config looks like:
```json
{
"servers": {
"nexera-debugger": {
"command": "node",
"args": ["<path-to>/nexera-mcp-launcher.js"]
}
}
}
```
### Antigravity MCP Configuration
Use **Debug Automation: Copy MCP Config (Antigravity)** to copy the Antigravity-specific configuration. Antigravity uses the `mcpServers` key instead of `servers`:
```json
{
"mcpServers": {
"nexera-debugger": {
"command": "node",
"args": ["<path-to>/nexera-mcp-launcher.js"]
}
}
}
```
## Test Project & Quick Verification
A small Node.js test project is included in `test-app-to-debug/`.
1. Open this repository in VS Code.
2. Start debugging `test-app-to-debug/test.js` using the Node.js debugger.
3. Confirm the MCP server is running in the **Debug Automation** panel.
4. From your MCP client, call `session_list` to verify the session is visible.
5. Set a breakpoint with `breakpoint_add` and use `exec_continue` to hit it.
6. Inspect variables with `inspect_stack_trace` → `inspect_scopes` → `inspect_variables`.
## License
MIT License. See [LICENSE](./LICENSE).
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues