For AI agents · VS Code

ClarifyDoc in VS Code. One command, then ask.

Give VS Code (GitHub Copilot’s agent mode) a map of your codebase: which screen calls an endpoint, which tables it touches, what an edit breaks. It asks ClarifyDoc’s MCP server and gets short answers with path:line references instead of reading whole files. Local, read-only, no account.

code --install-extension ClarifyDoc.clarifydoc-vscode
// .vscode/mcp.json — what clarifydoc install . --client vscode writes
{
  "servers": {
    "clarifydoc": {
      "type": "stdio",
      "command": "clarifydoc",
      "args": [
        "mcp"
      ]
    }
  }
}

SET IT UP

From install to the first answer

  1. Install the extension

    With the extension installed, there is nothing to configure: it publishes the server to Copilot’s agent mode for every workspace folder (VS Code 1.101 or later), pointed at the analysis the sidebar shows.

    code --install-extension ClarifyDoc.clarifydoc-vscode

    Without the extension, the CLI writes the same server into .vscode/mcp.json (it needs Node.js):

    npm install -g clarifydoc && clarifydoc install . --client vscode
  2. Where the entry goes

    .vscode/mcp.json in the project

    The entry names no project: the server serves the folder VS Code runs in, so the same file works for everyone who opens the project.

    {
      "servers": {
        "clarifydoc": {
          "type": "stdio",
          "command": "clarifydoc",
          "args": [
            "mcp"
          ]
        }
      }
    }
  3. Reload VS Code

    With the extension, the server is there as soon as the extension has started. With .vscode/mcp.json, VS Code starts the server when agent mode first needs it.

  4. Ask the first question

    Type this as it is. If the project has no analysis yet, the first call makes one; a large repository can take a few minutes, and every analysis after it reads only the files that changed. To have it ready first, run clarifydoc analyze . from the project root.

    Call clarifydoc_status, then use clarifydoc_routes to pick one API route. Tell me which screen calls it and which tables it reads and writes, with path:line for each.

    Then one about your own change:

    Before I change <a file you know>, what depends on it and which tests should I run?
  5. Check that it worked

    clarifydoc_status answers with the project root, when it was analyzed and how many routes, screens and tables were found. If it says no analysis was found, the server is looking at another folder: start VS Code from the project root.

    MCP: List Servers in the Command Palette shows clarifydoc and its state; in the Chat view, switch to agent mode and open the tools picker to see its tools.

  6. Keep it current

    Ask the agent to call clarifydoc_analyze, or run clarifydoc analyze . --incremental: either re-reads only the files that changed. clarifydoc install --git-hooks does it in the background after each commit, merge and branch checkout. To update ClarifyDoc itself, npm install -g clarifydoc@latest (the extension updates itself, and its launcher keeps its path), then reload VS Code.

  7. Remove it

    Uninstall the extension, or delete the clarifydoc entry from .vscode/mcp.json. If you added it: ~/.copilot/hooks/clarifydoc.json. Delete .clarifydoc/ in the project, and npm uninstall -g clarifydoc. If you asked for them, --guidance wrote between <!-- clarifydoc:start --> and <!-- clarifydoc:end --> in AGENTS.md, and --git-hooks between # clarifydoc:start and # clarifydoc:end in the repository’s git hooks. Nothing else is written.

OPTIONAL

More than the server

Each is a flag on the same clarifydoc install command, off unless you ask for it, and --print shows it before anything is written.

Hooks

--client vscode --hooks writes ~/.copilot/hooks/clarifydoc.json, which agent mode reads: after a search, the agent is told what the map knows about the name. A hook never blocks a tool call.

A section in AGENTS.md

--guidance adds a short, marked section to AGENTS.md that tells agents when to ask the map instead of searching text, and what this project’s analysis says to know first. It edits a file your team shares, so --print it first.

WHAT IT ANSWERS

23 tools, all read-only but two

Routes and who calls them, the tables a screen reads and writes, the call path between two functions, what a diff reaches, one function’s source instead of its file. Only clarifydoc_analyze and clarifydoc_diff write, and only to .clarifydoc/. Nothing leaves your machine — every network request any part can make.

OTHER HOSTS

The same server, elsewhere