ThoughtDAG

Memory and knowledgeDesign and media

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

Your AI app calls the ThoughtDAG MCP server, which does the memory and knowledge and design and media work and sends the result back to the chat.

About ThoughtDAG

ThoughtDAG is a community MCP server from chenxiachan, filed in our directory under memory and knowledge and design and media. Search local AI conversations by file or phrase and recall source turns. Four read-only tools.

ThoughtDAG runs on your own machine: your AI app starts it with the command npx -y thoughtdag@0.2.2 mcp and talks to it over standard input and output.

ThoughtDAG is listed in the official MCP registry as io.github.chenxiachan/thoughtdag, version 0.2.2.

At a glance

Publisher
chenxiachan (community)
Runs
Locally on your machine
Install from
Node.js package on npm: thoughtdag
Written in
TypeScript
License
MIT
GitHub stars
821
Official MCP registry
io.github.chenxiachan/thoughtdag

How to set up ThoughtDAG

  1. Install Node.js on the machine that runs your AI app, because ThoughtDAG starts with npx and downloads its package on first run.
  2. Check the ThoughtDAG README for keys or settings; the registry lists none that ThoughtDAG requires.
  3. Add ThoughtDAG to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the ThoughtDAG tools to confirm the connection.
  5. Run one read-only task with ThoughtDAG first, and keep your app asking before each tool call until the results look right.

ThoughtDAG compared with similar servers

  • Wax by christopherkarani has fewer GitHub stars than ThoughtDAG (816 against 821); both are community servers, and both run locally.
  • Okf Agent Memory by okf-memory has more GitHub stars than ThoughtDAG (880 against 821); both are community servers, and both run locally.
  • Context Space by context-space has fewer GitHub stars than ThoughtDAG (814 against 821); both are community servers, and both run locally.

Before you connect ThoughtDAG

  • Give ThoughtDAG its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each ThoughtDAG tool call until you trust what it does with them.
  • Treat text that ThoughtDAG fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for ThoughtDAG on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for ThoughtDAG

How marketing and sales teams put ThoughtDAG to work, by company size. Pick the size closest to yours and start ThoughtDAG on one use case.

Small business

  • A small business can give ThoughtDAG its offers, FAQs and tone of voice once, so every draft starts from the same facts.
  • Founders can use ThoughtDAG to keep notes from calls and decisions, then ask what was agreed with a customer weeks later.
  • A small business can use ThoughtDAG to resize and adapt one design for every channel instead of hiring for each version.
  • ThoughtDAG runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect ThoughtDAG to positioning docs and past campaigns, so agents write on message without a long prompt each time.
  • Sales and marketing can share one knowledge base through ThoughtDAG, so answers about pricing and features match across teams.
  • Creative teams can connect ThoughtDAG so agents produce variants for testing while designers keep control of the master files.
  • Start ThoughtDAG on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use ThoughtDAG with permissions that follow the source documents, so an agent only recalls what the person asking may see.
  • Large orgs can make ThoughtDAG the approved memory layer for agents, with retention rules and a way to delete what shouldn't be kept.
  • Enterprises can use ThoughtDAG with brand rules and approved assets only, so generated work stays inside the brand system.
  • ThoughtDAG is a community server, so have security review the code and pin a version before ThoughtDAG touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

ThoughtDAG README

From chenxiachan/thoughtdag on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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 attached
thoughtdag recall <session> <n>
thoughtdag status
thoughtdag 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:

{
  "mcpServers": {
    "thoughtdag": {
      "command": "npx",
      "args": ["-y", "thoughtdag@0.2.2", "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:

docker build -f cli/Dockerfile -t thoughtdag-mcp cli
docker 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:

["npm install --global --ignore-scripts --no-audit --no-fund thoughtdag@0.2.2"]

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

["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:

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.

Questions about ThoughtDAG

What is the ThoughtDAG MCP server?

Search local AI conversations by file or phrase and recall source turns. Four read-only tools. ThoughtDAG is maintained by chenxiachan on GitHub at chenxiachan/thoughtdag, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the ThoughtDAG MCP server?

Add ThoughtDAG to your AI app's MCP config with the command npx -y thoughtdag@0.2.2 mcp. In Claude Code, run claude mcp add --transport stdio chenxiachan-cli -- npx -y thoughtdag@0.2.2 mcp. To run ThoughtDAG this way you need Node.js installed.

Does ThoughtDAG need an API key?

The registry lists no required keys for ThoughtDAG. Check the ThoughtDAG README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is ThoughtDAG an official MCP server?

No. ThoughtDAG is a community server maintained by chenxiachan. Community servers can be excellent; read the code and the open issues before you give ThoughtDAG access to company data.

What license is ThoughtDAG under?

ThoughtDAG is released under the MIT license, according to its GitHub repository. The license covers the code of ThoughtDAG; the service it connects to has its own terms.