
Threadctx Mcp
io.github.threadctx-dev由 GitHub 帳號 threadctx-dev 發布v0.5.0更新於 Oct 24, 2026
Shared memory MCP server for AI coding agents — local by default, team-shared via threadctx.dev.
概覽
為編碼代理提供共享記憶儲存,讓它們能跨工作階段與團隊成員保存並取回專案決策與經驗教訓。
- 可以做什麼
- Threadctx 提供 memory_write 與 memory_query 工具,讓代理記錄不易察覺的修正、架構決策與經驗,並在開始有風險或重複性的工作前查詢。本機模式把記憶存在電腦上一個純 JSON 檔案中,以目前儲存庫為範圍並以關鍵字比對。雲端模式透過語意搜尋在團隊間共享記憶。capture 指令可用你自己的 LLM 供應商金鑰把最近的 git 提交濃縮成記憶。
- 適用情境
- 當多個代理或團隊成員在同一個儲存庫中工作,且你希望決策與經驗能在工作階段之間延續、而不是被反覆重新發現時,適合加入。本機模式適合不想註冊、不依賴網路的單一開發者;雲端模式適合需要一份共享記憶的團隊。
- 執行需求
- 需要 Node.js 18 或更新版本,透過 npx 在本機執行。本機模式不需要帳號、金鑰,除你自己的 LLM 供應商外不需要網路。雲端模式需要設定 THREADCTX_MODE=cloud 以及由 threadctx.dev 核發的 THREADCTX_API_KEY。選用的 capture 指令需要 THREADCTX_CAPTURE_ENABLED=1 以及你自己的 ANTHROPIC_API_KEY 或 OPENAI_API_KEY。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Threadctx Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
threadctx-mcp
Shared memory MCP server for AI coding agents. Works identically with
Claude Code, Cursor, and any MCP client — same package, same config
shape, no per-client integration work. On first start it also drops a
"check team memory" instruction into whichever agents' rule files your repo
uses (AGENTS.md, CLAUDE.md, Copilot, Windsurf, Cline, Gemini) so the
memory actually gets read, not just exposed.
This repo runs on itself: its own
AGENTS.mdandCLAUDE.mdwere set up withnpx threadctx-mcp init, the same command you'd run — check the git history if you want to see it happen.
Modes
- Local (default, free, no signup): memory stored as a plain JSON file
at
~/.threadctx/local.json— zero native dependencies, sonpx threadctx-mcpinstalls instantly on any machine with Node 18+ (no compiler, no node-gyp step). No network calls except to whichever LLM provider your agent already uses. Matching is keyword-based, scoped to the current repo (detected viagit remote). Runnpx threadctx-mcp listany time to see exactly what your agents have stored. - Cloud (paid Team tier+): memory shared across everyone on the repo,
with real semantic search. Requires an API key from
threadctx.dev (or your own self-hosted
deployment — see
../cloud/README.md).
Quick start
init writes three committable, secret-free files: .threadctx.json
(just { "mode": ... }), .mcp.json (Claude Code project config), and
.cursor/mcp.json (Cursor project config). Commit all three — every
teammate who then opens the repo in Claude Code or Cursor is prompted to
enable threadctx automatically, with nothing to install or configure.
Teammates on other MCP clients run npx threadctx-mcp join, which sets up
their machine the same way and prints the config block for their client.
Your API key never appears in any committed file. It is read from the
THREADCTX_API_KEY environment variable at runtime (export it in your
shell profile), so secrets stay out of version control by construction.
threadctx also adds a small, clearly-marked instruction to your project
rules telling the agent to call memory_query before a task and
memory_write after. It writes the two universal files every time —
AGENTS.md (the cross-tool standard read by Copilot,
Cursor, Windsurf, Zed, Codex, Aider, and ~24 others) and CLAUDE.md
(Claude Code's richer native format) — plus .cursor/rules/threadctx.mdc.
It then adds a tool-specific file only when that tool's footprint is
detected in the repo, so it never litters your project with rule files for
tools you don't use:
Shared files (AGENTS.md, CLAUDE.md, Copilot, Gemini) get a marker-fenced
block spliced in, preserving your own content around it; dedicated files are
owned in full. This happens automatically the first time the server starts
in a project — you don't need to run init for it. Running init just
triggers it explicitly and prints the result; either way it's idempotent
(safe to re-run, never duplicates). Opt out entirely with
THREADCTX_NO_AUTO_RULES=1, or per-init-call with --no-rules.
The same instruction is also sent as part of the MCP initialize handshake
itself (the protocol's instructions field), so it reaches the model even
before any rules file exists, and for clients that don't read project-rules
files at all. The file-based rules are belt-and-suspenders on top of that,
since not every MCP client is guaranteed to surface instructions
prominently.
Claude Code setup
Add to your Claude Code MCP config (claude mcp add or edit
~/.claude/mcp.json directly):
Cursor setup
Add the same block to .cursor/mcp.json in your project root (or via
Cursor Settings → Tools & MCP):
That's it — the same package and config work in both clients because MCP is a portable, open protocol.
Passive capture — turn git history into memory
Memory shouldn't depend on an agent remembering to call memory_write.
threadctx capture reads the commits landed since its last run, uses your
own LLM provider key to distill the genuinely reusable decisions and
gotchas (skipping trivial commits), dedups them against what's already
stored, and writes the survivors. It's tool-agnostic — it doesn't matter
whether the work happened in Claude Code, Cursor, Copilot, or a plain editor.
Capture calls your LLM provider directly — nothing is routed through
threadctx's servers, so local mode keeps its "no network call beyond your own
LLM provider" promise. It is off unless THREADCTX_CAPTURE_ENABLED=1 (or
a one-off --force), so it can never run up token cost as a side effect.
Environment variables
Local development
How the tools work
memory_write(content, tags?)— the agent calls this after resolving a non-obvious bug, making an architectural decision, or learning something worth remembering.memory_query(task_description, max_results?)— the agent calls this before starting risky or repeated work. Results are returned with a consistent attribution footer (· via threadctx — shared team memory (N hits)) so the same string is recognizable whether you're reading Claude Code's terminal output or Cursor's agent panel.
Tool descriptions are written to bias the model toward calling
memory_query proactively, and — as of 0.3.0 — the server reinforces this
two more ways with zero setup required: the MCP initialize response
carries the same instruction to every connecting client, and CLAUDE.md /
.cursor/rules/threadctx.mdc get it auto-injected on first start. MCP tools
are still fundamentally pull-based (no mechanism can force a tool call), but
these three layers together are the strongest guarantee we can build.
CLI subcommands
Browse, search, edit, and prune team (cloud) memory in a human dashboard at threadctx.dev/dashboard — sign in with your team API key.
來源:README.md,提交 1a8fb01
工具
0版本歷史
1- v0.5.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分