# Weft

> Weft is an open-source MCP server for developer tools. Local MCP server that searches your past AI coding sessions by file or phrase. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows, Self-hosted
- **Repository:** https://github.com/chenziyaos/weft/tree/HEAD/cli
- **MCP Registry name:** io.github.chenziyaos/weft
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-19

## About

The README says Weft indexes the agent sessions already stored on your machine, including Claude Code, Codex, DeepSeek Harness and Pi, and records which files each turn read, wrote or edited. Queries return the conversation turns tied to a given file or exact phrase, with a link back to the original session.

The MCP server runs over stdio and exposes four read-only tools: why_check, why_file, find and recall_turn. Session files are read but never written, and the derived index is kept under ~/.weft, where it can be deleted with a purge command. Facts about file changes come from tool calls rather than model-generated text, while lines drawn from answers are flagged as candidate explanations.

It suits developers who want their coding agent or themselves to recall why a file looks the way it does, drawing on earlier Claude Code or Codex work. The package requires Node.js 20 or newer and the local session logs on the machine running it.

## Features

- **File-based history lookup:** Lists the conversation turns that read, wrote or edited a given file, with timestamps and what changed.
- **Exact phrase search:** Finds where specific words were asked, answered or attached across indexed sessions.
- **Read-only session access:** Session files are never written, and the index can be removed with a single purge command.
- **Stdio MCP tools:** Four tools, why_check, why_file, find and recall_turn, are registered for MCP clients that accept mcpServers JSON.
- **Traceable results:** Every hit links back to the originating conversation so results can be checked in context.

## Good for

- Check whether earlier agent sessions already touched a file before editing it
- Recall the reasoning behind a past code change from an earlier Claude Code or Codex session
- Search old prompts and answers for a specific phrase or term
- Give a coding agent read-only access to prior project history through MCP

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add weft -- npx -y weft-canvas
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "weft": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add weft -- npx -y weft-canvas
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.weft]
command = "npx"
args = ["-y", "weft-canvas"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user weft npx -- -y weft-canvas

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "weft": {
      "command": "npx",
      "args": [
        "-y",
        "weft-canvas"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 4 tools read data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `why_check` (name suggests: reads): Checks whether there is conversation history for the current context.
- `why_file`: Returns the conversations that shaped a given file.
- `find` (name suggests: reads): Finds where exact words were asked, answered or attached.
- `recall_turn`: Recalls a specific turn from a session.

## FAQ

### Does Weft modify my agent session files?

No. The README says session files are read, never written, and the index is stored separately in ~/.weft.

### Which agent session formats are indexed?

The README lists Claude Code, Codex, DeepSeek Harness and Pi sessions found on the local machine.

### How do I install the MCP server?

Install the npm package weft-canvas globally, then configure an MCP client to run the weft command with the mcp argument.

### Does Weft send my history to a cloud service?

The README says the index is local, but retrieved text is returned to the calling agent and may enter that agent's model context, so provider settings should be reviewed.

### Is Weft free?

Yes. Weft is open source, so you can use and self-host it for free.

### How do I add Weft to Claude Code?

Run this command in your terminal: claude mcp add weft -- npx -y weft-canvas

### What are the best alternatives to Weft?

The closest alternatives to Weft are ThoughtDAG, Coding Tools MCP, MCP Token Optimizer, Industry Pulse and Edit MCP.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [ThoughtDAG](https://ai-powered.com/mcp/thoughtdag): ThoughtDAG is an open-source MCP server for developer tools.
- [Coding Tools MCP](https://ai-powered.com/mcp/coding-tools-mcp): Coding Tools MCP is an open-source MCP server for developer tools.
- [MCP Token Optimizer](https://ai-powered.com/mcp/mcp-token-optimizer-2): MCP Token Optimizer is an open-source MCP server for developer tools.
- [Industry Pulse](https://ai-powered.com/mcp/industry-pulse): Industry Pulse is a free MCP server for developer tools.
- [Edit MCP](https://ai-powered.com/mcp/edit-mcp): Edit MCP is an open-source MCP server for developer tools.
- [Lens MCP](https://ai-powered.com/mcp/lens-mcp-2): Lens MCP is an open-source MCP server for developer tools.
- [Nelly the Elephant](https://ai-powered.com/mcp/nelly-the-elephant): Nelly the Elephant is an open-source MCP server for developer tools.
- [Imperal MCP](https://ai-powered.com/mcp/imperal-mcp): Imperal MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/weft-2
