DebugMCP
AGENTS.md540 starsChanged 9 months agoMITView on GitHub
DebugMCP is a VS Code extension that embeds an MCP (Model Context Protocol) server, enabling AI coding agents to control VS Code's debugger via DAP (Debug Adapter Protocol). AI agents can start/stop debugging, step through code, set breakpoints, inspect variables, and evaluate expressions. IMPORTANT: Keep docs/*.md files up to date when modifying components. These docs should remain high-level: - Purpose and motivation - Responsibility scope - Key concepts and patterns - Pointers to relevant code sections Do NOT duplicate detailed…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- debug-liveSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
IMPORTANT: Keep docs/*.md files up to date when modifying components.
- Distinctive: line 32
Do NOT duplicate detailed implementation in docs - that information should be inferred from the code itself.
- Very specific: line 59
Logging: Use logger from ./utils/logger (not console.log).
- Very specific: line 60
VS Code API: Import as import * as vscode from 'vscode'
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Guidelines for DebugMCP
Project Overview
DebugMCP is a VS Code extension that embeds an MCP (Model Context Protocol) server, enabling AI coding agents to control VS Code's debugger via DAP (Debug Adapter Protocol). AI agents can start/stop debugging, step through code, set breakpoints, inspect variables, and evaluate expressions.
Architecture
AI Agent (Cline/Copilot/Cursor) → MCP/SSE → DebugMCPServer → DebuggingHandler → DebuggingExecutor → VS Code Debug APIKey Components
| Component | Responsibility | Docs |
DebugMCPServer | MCP server, tool/resource registration | docs/architecture/debugMCPServer.md |
DebuggingHandler | Operation orchestration, state change detection | docs/architecture/debuggingHandler.md |
DebuggingExecutor | VS Code debug API calls, DAP requests | docs/architecture/debuggingExecutor.md |
DebugState | Debug session state model | docs/architecture/debugState.md |
DebugConfigurationManager | Launch configs, language detection | docs/architecture/debugConfigurationManager.md |
AgentConfigurationManager | AI agent auto-configuration | docs/architecture/agentConfigurationManager.md |
Documentation Maintenance
IMPORTANT: Keep docs/*.md files up to date when modifying components. These docs should remain high-level:
- Purpose and motivation
- Responsibility scope
- Key concepts and patterns
- Pointers to relevant code sections
Do NOT duplicate detailed implementation in docs - that information should be inferred from the code itself.
File Header
Include in each source file:
// Copyright (c) Microsoft Corporation.Build/Lint/Test Commands
| Command | Description |
npm run compile | Compile TypeScript to out/ |
npm run lint | Run ESLint on src/ |
npm test | Run all tests (src/test/*.test.ts) |
npm run watch | Compile in watch mode |
Code Style & Conventions
- TypeScript: Strict mode, ES2022 target, Node16 modules
- Imports: vscode → external packages → internal modules
- Naming: camelCase (variables/functions), PascalCase (classes/interfaces),
Iprefix for interfaces - Types: Explicit types preferred, strict null checks, avoid
any - Error Handling: try-catch with descriptive messages, throw
Errorobjects - Formatting: Semicolons, curly braces for all control structures, tabs for indentation
- Async: async/await, exponential backoff for retries
- Logging: Use
loggerfrom./utils/logger(notconsole.log). Simple wrapper providinginfo,warn,errormethods with consistent formatting. - VS Code API: Import as
import * as vscode from 'vscode'
Key Dependencies
@modelcontextprotocol/sdk: Official MCP server framework (McpServer,SSEServerTransport)zod: Schema validation for tool parametersexpress: HTTP server for SSE transport
Entry Points
- Extension activation:
src/extension.ts→activate() - MCP endpoint:
http://localhost:{port}/sse(default port: 3001)
Configuration
| Setting | Default | Description |
debugmcp.serverPort | 3001 | MCP server port |
debugmcp.timeoutInSeconds | 180 | Operation timeout |
Documentation Resources
The docs/ folder contains two types of documentation:
Component docs (referenced in Key Components table above): Developer documentation for understanding the codebase architecture.
AI Agent resources (served via MCP at runtime):
| File | Purpose |
agent-resources/debug_instructions.md | Core debugging workflow guide for AI agents |
agent-resources/troubleshooting/*.md | Language-specific debugging tips (Python, JavaScript, Java, C#) |
These resource files are loaded by DebugMCPServer and exposed as MCP resources that AI agents can read to learn how to use the debugging tools effectively.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

