# Whittle MCP

> Whittle MCP is a free MCP server for ai models and llm tooling. Trim test logs, JSON, diffs and OpenAPI files so agents read fewer tokens. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, API
- **Website:** https://huggingface.co/spaces/builditwithgk/whittle-mcp
- **Repository:** https://github.com/builditwithgk/whittle-mcp
- **MCP Registry name:** io.github.builditwithgk/whittle-mcp
- **Categories:** [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-22

## About

Whittle MCP shrinks the output that coding agents keep re-reading, such as test runs, logs, large JSON, git diffs and OpenAPI documents, while keeping the facts. Whatever it removes is replaced by a short marker, and an expand tool returns exactly the omitted part on request.

It works as an MCP server started with uvx, and as a shell filter so output can be piped through it, for example a test run into whittle tests. Tools take a file path, and a command mode exists only if the server is started with a flag. A receipt reports tokens before and after, and each trimmer is scored on tokens saved and on whether must-keep facts survive using a public corpus.

Trimmers handle test output from pytest, jest, go test, cargo test and others, logs with collapsed repeats, JSON masking and OpenAPI indexing. A web demo on Hugging Face lets you try it with nothing installed.

## Features

- **Test output trimming:** Keeps failures, assertions and locations plus the summary.
- **Log compaction:** Collapses repeats and shortens tracebacks while keeping distinct errors.
- **JSON masking:** Keeps keys and a sample of array items.
- **Diff and OpenAPI trimming:** Collapses lockfiles and generated files and indexes operations.
- **Expand on demand:** Returns any omitted part using the marker's id.
- **Token receipts:** Shows tokens before and after and a running report of savings.

## Good for

- Cutting token use from long pytest output
- Summarising a huge API response before an agent reads it
- Shrinking a git diff full of lockfile changes
- Indexing an OpenAPI spec by operation
- Measuring how many tokens trimming saved

## Install

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

```sh
claude mcp add whittle-mcp -- uvx whittle-mcp
```

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": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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 whittle-mcp -- uvx whittle-mcp
```

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

```toml
[mcp_servers.whittle-mcp]
command = "uvx"
args = ["whittle-mcp"]
```

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user whittle-mcp uvx -- whittle-mcp

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

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": {
    "whittle-mcp": {
      "command": "uvx",
      "args": [
        "whittle-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 3 names don't say. From the server's own tool labels and tool names; not verified by us.

- `trim_tests`: Trim test runner output to failures and summary
- `trim_log`: Collapse repeats and shorten tracebacks in logs
- `mask_json`: Mask large JSON while keeping keys

## FAQ

### How do I install Whittle MCP?

pip install whittle-mcp, or run it with uvx whittle-mcp.

### Does trimming lose information?

Removed parts are replaced by a marker and can be retrieved with expand.

### Can Whittle MCP run commands?

Only if you start the server with the allow-run flag; otherwise tools read file paths.

### Can I try Whittle MCP without installing?

Yes, a Hugging Face Space lets you paste a log, JSON or diff.

### Is Whittle MCP free?

Yes. Whittle MCP is free to use.

### How do I add Whittle MCP to Claude Code?

Run this command in your terminal: claude mcp add whittle-mcp -- uvx whittle-mcp

### What are the best alternatives to Whittle MCP?

The closest alternatives to Whittle MCP are llmtrim, ctxprune, Token Optimizer MCP, MoneyTools Slim and Tokenectomy Razor.

## Where this comes from

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

## Alternatives

- [llmtrim](https://ai-powered.com/mcp/llmtrim): llmtrim is an open-source MCP server for ai models and llm tooling.
- [ctxprune](https://ai-powered.com/mcp/ctxprune): ctxprune is an open-source MCP server for developer tools.
- [Token Optimizer MCP](https://ai-powered.com/mcp/token-optimizer-mcp): Token Optimizer MCP is an MCP server for ai models and llm tooling.
- [MoneyTools Slim](https://ai-powered.com/mcp/moneytools-slim): MoneyTools Slim is a freemium MCP server for ai models and llm tooling.
- [Tokenectomy Razor](https://ai-powered.com/mcp/tokenectomy-razor): Tokenectomy Razor is an open-source MCP server for developer tools.
- [ATR: Automation for Token Reduction](https://ai-powered.com/mcp/atr-automation-for-token-reduction): ATR: Automation for Token Reduction is a free MCP server for ai models and llm tooling.
- [Token Pilot](https://ai-powered.com/mcp/token-pilot): Token Pilot is an MCP server for developer tools.
- [Skim MCP](https://ai-powered.com/mcp/skim-mcp): Skim MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/whittle-mcp
