# ThoughtDAG [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/chenxiachan/thoughtdag  
**GitHub Stars:** 814  
**npm Downloads (last month):** 424  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/thoughtdag

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

## Tools
Capabilities this server exposes over MCP:

- **why_check** — Cheap first question before editing a file: does this artifact have any history in local agent sessions? One line; history true/false.
- **why_file** — The turns across local Claude Code, Codex, DeepSeek Harness, Pi and ThoughtDAG sessions that touched a file, URL or paper: when, what changed (Δ, observed), what was asked, what the answer said about it (≈, a candidate explanation, not a verified reason). Each hit carries a deep link.
- **find** — Where these exact words were asked (Q), answered (A) or attached (M) across local sessions, canvases and the memories Claude Code and Codex keep for themselves. Exact, case-insensitive match; every hit is a verbatim snippet with a pointer.
- **recall_turn** — One turn in full — the question, the answer, the tool calls with their diffs — by session id (or prefix) and turn number as shown by why_file.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What ThoughtDAG does

ThoughtDAG exposes local AI conversation history to an MCP-compatible agent. Its focus is retrieval rather than conversation editing: an agent can search session data by a file path or phrase, then recall the original turns associated with the result.

The server is useful when relevant context is distributed across earlier coding or research sessions. Instead of relying on a model to remember prior work, an agent can look up matching local records and inspect where the information came from. The MCP interface is read-only, so these operations are intended for discovery and reference rather than changing conversations.

ThoughtDAG is part of a larger local application that represents exchanges as connected nodes and makes context paths editable. The MCP use case is narrower: it provides an agent-facing way to search and recall history.

## How it works

The server reads local conversation history and exposes four read-only tools over MCP. Searches can be based on a file or on a phrase. Recall returns relevant source turns so an agent can use the original discussion instead of only a matching fragment.

The repository describes local sessions from Claude Code, Codex, DeepSeek Harness, and Pi as supported sources within ThoughtDAG. The history index, like the application's canvases and documents, stays on the local machine. This makes the server appropriate for workflows where an agent needs access to locally stored project discussions.

## Setup and configuration

The project can be run from source after installing dependencies with `npm install`, followed by `npm run server` and, when using the full application, `npm run dev`. The command-line entry point also supports local usage, including the example `npx thoughtdag why src/lib/api.ts`.

ThoughtDAG is also described as a CLI and read-only MCP option. The desktop application can be installed on macOS, Windows, or Linux, but the MCP workflow is distinct from the graphical canvas. Local sessions and recall require the desktop application or a local run; the browser demo does not provide those local-history capabilities.

## Tools and capabilities

- Search local conversation history by file.
- Search local conversation history by phrase.
- Recall source turns related to search results.
- Expose four read-only operations through MCP.
- Work with local session history associated with Claude Code, Codex, DeepSeek Harness, and Pi.

## Limitations and notes

The MCP interface is read-only, so it is not intended for editing, deleting, branching, or reconnecting conversation nodes. It operates on local history rather than providing a hosted conversation archive. Remote model providers are not required for the search and recall function described here, while the broader ThoughtDAG application can send relevant content to configured model providers.

The server is best suited to agents that need source-linked historical context. If the goal is to manipulate a canvas or control which graph connections reach a model, those functions belong to the broader ThoughtDAG application rather than the four read-only MCP tools.

_Full upstream README: https://allmcps.com/mcp/thoughtdag/readme_

