Skip to content
MCP server

ThoughtDAG

Read-only MCP server that finds past AI coding conversations by file or phrase

Runs locallyStatus and history
Pricing
Open source
Platforms
CLI, self-hosted, macOS
Runs
Locally
Version
0.2.2
Listing updated
1 day ago

About ThoughtDAG

ThoughtDAG is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

ThoughtDAG builds a local index of agent sessions already on your machine, from Claude Code, Codex, DeepSeek Harness, Pi and ThoughtDAG canvases, keyed by the files each turn read, wrote or edited. Facts come straight from tool calls rather than free text or a model. Observed edits are marked separately from candidate explanations inferred from an answer, which the docs say are not verified reasons.

The MCP server offers four read-only tools and cannot edit a canvas or a source session. thoughtdag setup mcp registers it for Claude Code in the project's .mcp.json and for Codex in the user config; thoughtdag setup rules can add a marked block to CLAUDE.md and AGENTS.md asking agents to check history before editing a file, and removes it again on request.

It needs Node.js 20 or newer. Derived indexes live under ~/.thoughtdag and can be deleted with thoughtdag purge. Retrieved history is returned to the calling agent, which may pass it to its model provider, so private history deserves a check of the client's settings.

Install

Run in a terminal

claude mcp add thoughtdag -- npx -y thoughtdag

Add to claude_desktop_config.json

{
  "mcpServers": {
    "thoughtdag": {
      "command": "npx",
      "args": [
        "-y",
        "thoughtdag"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "thoughtdag": {
      "command": "npx",
      "args": [
        "-y",
        "thoughtdag"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "thoughtdag": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "thoughtdag"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "thoughtdag": {
      "command": "npx",
      "args": [
        "-y",
        "thoughtdag"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "thoughtdag": {
      "command": "npx",
      "args": [
        "-y",
        "thoughtdag"
      ]
    }
  }
}

Tools this server provides (4)

Taken from the project documentation; the running server may differ.

why_check
One-line yes/no check whether a path has history
why_file
Matching turns and observed file changes for a path
find
Exact matches in questions, answers or materials
recall_turn
Full question, answer and tool trail for one turn

What it does

File history lookup
Lists the turns that touched a file, URL or arXiv paper.
Exact phrase search
Finds a phrase across questions, answers or attached materials.
Full turn recall
Prints a single turn's question, answer and tool trail.
Observed versus inferred
Separates recorded edits from candidate explanations.
Local index
Derived data stays in ~/.thoughtdag with restrictive permissions.
Project rules helper
Optionally adds and removes a history-check block in CLAUDE.md and AGENTS.md.

Good for

  • Ask why a file looks the way it does before editing it
  • Find the conversation where a specific phrase was discussed
  • Check whether a file has any past agent history
  • Recover the full tool trail of an earlier turn

Pricing

Open source

Free npm package

Prices change. Check chenxiachan.github.io before you buy.

ThoughtDAG FAQ

Can it modify my sessions?

No. Session files are read, never written, and the MCP tools are read-only.

Which agents' history does it read?

Claude Code, Codex, DeepSeek Harness, Pi and ThoughtDAG canvas conversations.

How do I start the server?

Run npx -y thoughtdag@0.2.2 mcp, or thoughtdag setup mcp inside a project.

How do I remove its data?

thoughtdag purge deletes all derived data, or only rebuildable caches with --cache.

Is ThoughtDAG free?

Yes. ThoughtDAG is open source, so you can use and self-host it for free.

How do I add ThoughtDAG to Claude Code?

Run this command in your terminal: claude mcp add thoughtdag -- npx -y thoughtdag

What are the best alternatives to ThoughtDAG?

The closest alternatives to ThoughtDAG are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to ThoughtDAG

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools