ThoughtDAG

io.github.chenxiachanPublished by GitHub account chenxiachanv0.2.2Updated Oct 24, 2026

Search local AI conversations by file or phrase and recall source turns. Four read-only tools.

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Read-only MCP server that indexes local AI coding sessions and lets an assistant find which past turns read, wrote or edited a given file, or search phrases.

What you can do
  • Check whether a file has any recorded session history
  • List the turns that read, wrote or edited a file, with timing, changes and the question asked
  • Search exact phrases across questions, answers or attachments
  • Recall the full text of a specific turn in a session
When to use it
Useful when you want an assistant to explain why code looks the way it does, or to check for prior conversation history before editing a file, using agent sessions already stored on the same machine.
Requirements
Runs locally over stdio via npx; needs Node.js 20 or newer and supported session logs (Claude Code, Codex, DeepSeek Harness, Pi) on the machine. Start it in the relevant project directory so file queries use the intended workspace. No API keys or accounts.
Before you install
Retrieved conversation text is returned to the calling agent and may enter its model context, so review the client's provider settings before exposing private history. The index is written under the user's home directory and can be purged. Session files are only read, never written; the tools cannot edit sessions or canvases.

Installation

In SourceWeft

  1. Open ThoughtDAG in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

thoughtdag

Find the conversations that shaped a file.

npx thoughtdag why src/lib/api.ts

Indexes the agent sessions already on your machine (Claude Code, Codex, DeepSeek Harness, Pi) by the files each turn read, wrote or edited, and lists those turns: when, what changed, what was asked, what the answer said about the file. Every hit links back to the conversation.

  • Facts come straight off tool calls, never from free text or a model.
  • Session files are read, never written. The index lives in ~/.thoughtdag (0700/0600) and can be deleted with thoughtdag purge.
  • Δ lines are observed changes; ≈ lines are read from the answer and are candidate explanations, not verified reasons.
thoughtdag index [--full] [--canvas <dir>]thoughtdag why <path> [--include-read] [--all] [--limit N] [--json]thoughtdag why --check <path>            # one line, exit 0/1: is there history here?thoughtdag find "<phrase>" [--in q|a|m]  # where these exact words were asked, answered or attachedthoughtdag recall <session> <n>thoughtdag statusthoughtdag purge [--cache]thoughtdag mcp                           # the same questions as MCP tools (stdio, read-only)thoughtdag setup [mcp | rules [--remove]]

Let the agent ask on its own

thoughtdag setup mcp registers the server for Claude Code in this project's .mcp.json and for Codex in the user-level ~/.codex/config.toml; the agent then has why_check, why_file, find and recall_turn as tools. thoughtdag setup rules adds two lines to this project's CLAUDE.md and AGENTS.md — check for history before editing a file; query before explaining why code is the way it is — as a marked block, --remove takes it out. Rule changes are per project and explicit; nothing is written unless you ask.

MCP clients and directories

The server's MCP Registry name is io.github.chenxiachan/thoughtdag. A client that supports local stdio servers can start it with:

json
{  "mcpServers": {    "thoughtdag": {      "command": "npx",      "args": ["-y", "[email protected]", "mcp"]    }  }}

Requires Node.js 20 or newer and supported session logs on the machine running the server. Start it in the relevant project directory so file queries use the intended workspace. Clients use different configuration formats; the example above is for clients that accept mcpServers JSON.

The four tools search and recall history; they cannot edit a canvas, modify source sessions, or replace the client's conversation. Derived indexes and caches are written under ~/.thoughtdag. Retrieved text is returned to the calling agent and may enter that agent's model context; review the client's provider settings before using private history.

Container and directory checks

The Dockerfile installs the published CLI version as a non-root stdio server. It does not copy the repository or any session data into the image. From the repository root:

bash
docker build -f cli/Dockerfile -t thoughtdag-mcp clidocker run --rm -i --network none thoughtdag-mcp

An empty container answers MCP initialization and tools/list; history queries have no results until you explicitly provide local data. No model key, private session, or hosted endpoint is needed for the directory check.

Glama generates its own Dockerfile from the listing's Admin → Dockerfile form. Use Node.js 22 and these build steps:

json
["npm install --global --ignore-scripts --no-audit --no-fund [email protected]"]

Use these CMD arguments (Glama adds its own mcp-proxy wrapper):

json
["env", "THOUGHTDAG_HOME=/tmp/thoughtdag-index", "THOUGHTDAG_SESSION_ROOTS=/data/sessions", "THOUGHTDAG_CANVAS_ROOTS=/data/canvases", "THOUGHTDAG_MEMORY_ROOTS=", "thoughtdag", "mcp"]

Leave placeholder credentials empty, then build and release. The repository root builds the web frontend; it does not produce dist/thoughtdag.mjs. Keep the pinned CLI version in this configuration aligned with the version you intend to list. Glama's generated image is separate from the non-root image above.

For actual local use, mount only the history directories you choose, read-only, at /data/sessions and optionally /data/canvases. The derived index is stored separately at /home/node/.thoughtdag. Query absolute artifact paths recorded in those sessions; the container's default working directory is not your host project's path. The native npx configuration above is the simpler option for project-relative queries. A cloud-hosted copy cannot see the history on your computer.

Optional Codex skill

The repository also contains a Codex skill for opening a session in the desktop app or running CLI history queries:

bash
npx skills add chenxiachan/thoughtdag --skill thoughtdag --agent codex

This installs a skill in the current project. Opening a session needs the ThoughtDAG desktop app or its local bridge; CLI queries use the npm package. It is separate from MCP registration and does not provide a canvas-writing MCP tool.

Source: cli/README.md at commit 53585b4

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.2LatestSep 27, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts