
ThoughtDAG
io.github.chenxiachan由 GitHub 帳號 chenxiachan 發布v0.2.2更新於 Oct 24, 2026
Search local AI conversations by file or phrase and recall source turns. Four read-only tools.
概覽
唯讀 MCP 伺服器,會索引本機 AI 程式開發工作階段,讓助理查出哪些歷史輪次讀取、寫入或編輯過某個檔案,或依片語檢索。
- 可以做什麼
- 檢查某個檔案是否有工作階段歷史紀錄
- 列出讀取、寫入或編輯過該檔案的輪次,包含時間、變更與當時的提問
- 在提問、回答或附件中檢索完全相符的片語
- 回看某個工作階段中指定輪次的完整內容
- 適用情境
- 適合讓助理說明程式碼為何是現在這樣,或在修改檔案前先確認是否有相關歷史討論,資料來自同一台機器上既有的代理工作階段。
- 執行需求
- 透過 npx 以 stdio 在本機執行;需要 Node.js 20 或更新版本,以及本機支援的工作階段日誌(Claude Code、Codex、DeepSeek Harness、Pi)。請在相關專案目錄中啟動,讓檔案查詢對應正確的工作區。不需要帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ThoughtDAG,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
thoughtdag
Find the conversations that shaped a file.
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 withthoughtdag purge. Δlines are observed changes;≈lines are read from the answer and are candidate explanations, not verified reasons.
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:
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:
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:
Use these CMD arguments (Glama adds its own mcp-proxy wrapper):
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:
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.
來源:cli/README.md,提交 53585b4
工具
0版本歷史
1- v0.2.2最新Sep 27, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分

