agentleFS
MicrosoftKnown publishermicrosoft/DebugMCP/AGENTS.md

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.

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
  1. Very specific:

    IMPORTANT: Keep docs/*.md files up to date when modifying components.

    line 26
  2. Distinctive:

    Do NOT duplicate detailed implementation in docs - that information should be inferred from the code itself.

    line 32
  3. Very specific:

    Logging: Use logger from ./utils/logger (not console.log).

    line 59
  4. Very specific:

    VS Code API: Import as import * as vscode from 'vscode'

    line 60

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 API

Key Components

ComponentResponsibilityDocs
DebugMCPServerMCP server, tool/resource registrationdocs/architecture/debugMCPServer.md
DebuggingHandlerOperation orchestration, state change detectiondocs/architecture/debuggingHandler.md
DebuggingExecutorVS Code debug API calls, DAP requestsdocs/architecture/debuggingExecutor.md
DebugStateDebug session state modeldocs/architecture/debugState.md
DebugConfigurationManagerLaunch configs, language detectiondocs/architecture/debugConfigurationManager.md
AgentConfigurationManagerAI agent auto-configurationdocs/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

CommandDescription
npm run compileCompile TypeScript to out/
npm run lintRun ESLint on src/
npm testRun all tests (src/test/*.test.ts)
npm run watchCompile 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), I prefix for interfaces
  • Types: Explicit types preferred, strict null checks, avoid any
  • Error Handling: try-catch with descriptive messages, throw Error objects
  • Formatting: Semicolons, curly braces for all control structures, tabs for indentation
  • Async: async/await, exponential backoff for retries
  • Logging: Use logger from ./utils/logger (not console.log). Simple wrapper providing info, warn, error methods 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 parameters
  • express: HTTP server for SSE transport

Entry Points

  • Extension activation: src/extension.ts → activate()
  • MCP endpoint: http://localhost:{port}/sse (default port: 3001)

Configuration

SettingDefaultDescription
debugmcp.serverPort3001MCP server port
debugmcp.timeoutInSeconds180Operation 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):

FilePurpose
agent-resources/debug_instructions.mdCore debugging workflow guide for AI agents
agent-resources/troubleshooting/*.mdLanguage-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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.