# threadctx-dev/threadctx-mcp [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/threadctx-dev/threadctx-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 258  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/threadctx-dev-threadctx-mcp

## Description
Shared team memory for AI coding agents. Decisions, fixes, and gotchas persist per repo and are shared across Claude Code, Cursor, and any MCP client — what one teammate's agent learns, everyone's agents remember. Local-first, zero-dependency. npx -y threadctx-mcp

## Tools
Capabilities this server exposes over MCP:

- **memory_write** — Store a learning, decision, fix, or gotcha for this repository so other agents and teammates can find it later. Call this whenever you resolve a non-obvious bug, make an architectural decision, or discover something that would save someone time in the future.
- **memory_query** — Retrieve relevant past learnings, fixes, decisions, or gotchas from the team's shared memory before starting risky or repeated work — e.g. touching a service that has caused incidents before, or implementing something similar to past work. Call this before, not after.

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

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

**Requires environment variables:** `THREADCTX_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What threadctx-dev/threadctx-mcp MCP server does

threadctx-dev/threadctx-mcp MCP server provides two MCP tools for retaining engineering knowledge per repository. `memory_write` stores a decision, fix, learning, or gotcha, while `memory_query` searches previous entries for a task description. The intended workflow is to query before risky or repeated work and write after discovering information that could help another agent or teammate.

The server identifies the current repository from its Git remote unless configured otherwise. In local mode, entries are stored as plain JSON at `~/.threadctx/local.json`. In cloud mode, memory is shared across people working on the repository and uses semantic search through threadctx.dev or a self-hosted deployment.

## How it works

The default local mode needs no signup and has no native dependencies. It uses keyword matching and makes no network calls beyond the LLM provider used by an agent. Cloud mode requires a threadctx API key and provides shared team storage with semantic search.

On its first start in a project, threadctx-dev/threadctx-mcp MCP server adds a small instruction encouraging agents to query memory before work and write useful findings afterward. It can update `AGENTS.md`, `CLAUDE.md`, and Cursor rules, and conditionally creates instructions for Copilot, Windsurf, Cline, or Gemini CLI when their project footprints are present. The server also sends the instruction in the MCP initialization response. Rule updates are idempotent, and automatic changes can be disabled.

The optional `capture` command reads commits since its previous run, asks the configured Anthropic or OpenAI provider to identify reusable knowledge, removes duplicates, and stores the remaining entries. Capture is disabled by default and sends data directly to the selected provider rather than through threadctx services.

## Setup and configuration

Run `npx threadctx-mcp` with Node.js 18 or newer for local mode. `npx threadctx-mcp init` creates committable `.threadctx.json`, `.mcp.json`, and `.cursor/mcp.json` files. `npx threadctx-mcp join` helps a teammate configure another MCP client. Cloud mode can be initialized with `--mode=cloud --api-key=...`; the key is read at runtime from `THREADCTX_API_KEY` and is not written to committed files.

Useful settings include:

- `THREADCTX_MODE`: selects `local` or `cloud`.
- `THREADCTX_API_KEY`: supplies the cloud credential.
- `THREADCTX_API_URL`: changes the cloud endpoint, including for self-hosting.
- `THREADCTX_REPO`: overrides Git-based repository detection.
- `THREADCTX_DB_PATH`: changes the local JSON path.
- `THREADCTX_NO_AUTO_RULES=1`: disables automatic rule injection.
- `THREADCTX_CAPTURE_ENABLED=1`: enables LLM-backed capture.

## Tools and capabilities

threadctx-dev/threadctx-mcp MCP server exposes:

- `memory_write(content, tags?)` for saving repository-specific knowledge.
- `memory_query(task_description, max_results?)` for retrieving relevant entries.
- `init`, `join`, and `list` commands for setup and local inspection.
- `capture` commands for optional commit-history extraction, previews, date or tag ranges, and GitHub Actions workflow scaffolding.

## Limitations and notes

Local storage is machine-local, so it is not automatically shared with teammates. Shared cross-user memory requires cloud mode or a self-hosted deployment. Semantic search is a cloud-mode feature; local matching is keyword-based. Automatic capture can incur charges from the configured LLM provider and remains off unless explicitly enabled or forced. The server writes or updates project rule files unless that behavior is disabled with `THREADCTX_NO_AUTO_RULES=1` or `--no-rules` during initialization.

_Full upstream README: https://allmcps.com/mcp/threadctx-dev-threadctx-mcp/readme_

