mcp-injector for Claude Code

Configure Claude Code CLI to communicate with mcp-injector and cut context costs on heavy terminal sessions.

Why use mcp-injector with Claude Code?

Claude Code is Anthropic's interactive command-line coding assistant. Because it runs directly inside your shell, Claude Code frequently pulls entire files into its context window for simple tasks. In large codebases, this adds up to high API bills. mcp-injector folds code bodies into lightweight signatures and forces byte-identical deterministic sorting. This guarantees maximum Anthropic KV cache hits and keeps context sizes to a fraction of the raw project size.

1. Install the daemon

Download and run the setup script:

curl -fsSL https://foldwork.dev/install | sh

2. Configure Claude Desktop/CLI

Claude Code reads MCP configuration from the standard Claude Desktop layout config file. To register mcp-injector, open or create your config file:

Add the server settings:

{
  "mcpServers": {
    "mcp-injector": {
      "command": "/usr/local/bin/mcp-injector",
      "env": {
        "MCP_WORKSPACE": "${workspaceFolder}"
      }
    }
  }
}

3. Start Claude Code with MCP

When starting your Claude Code session, make sure it is configured to discover local MCP servers. Launch it inside your project folder:

claude

Test the connection by asking Claude:

> Call get_project_map to check this codebase configuration.

Claude Code will fetch the folded signature catalog from the sqlite local daemon.