Skip to main content
Glama
README.md
# offload-mcp ๐Ÿชถ

๐Ÿ‡ฉ๐Ÿ‡ช [Deutsche Anleitung](README.de.md) ยท โญ If this saves you tokens, please star the repo!

**Stretch your Claude limits.** An MCP server that lets Claude Desktop / Claude Code hand bulky, routine work to **free LLM APIs** โ€” Groq, Google Gemini, Cerebras, Mistral, NVIDIA NIM, OpenRouter โ€” and read back only the short result.

- ๐Ÿ“„ **`offload_files`** โ€“ "summarize this 8 MB log" โ†’ the file goes to Gemini, Claude only sees the 20-line answer. *This is where most tokens are saved.*
- โœ๏ธ **`offload`** โ€“ drafts, translations, boilerplate, simple code.
- ๐Ÿ” **`offload_batch`** โ€“ the same instruction over 50 items in parallel.
- ๐Ÿ“Š **`list_providers`** โ€“ what's configured.
- ๐Ÿ’ฐ **`savings_report`** โ€“ Claude tokens saved, per session and all-time.
- ๐Ÿ”€ Automatic fallback: provider rate-limited? Next one takes over.
- ๐Ÿ”„ Self-healing models: if a provider retires a model, offload-mcp finds a current free one automatically.
- ๐Ÿ“ฆ **Zero dependencies.** Node โ‰ฅ 18, that's it.
- ๐ŸŒ Messages in your system language (English, German โ€“ more welcome).

## See what it brings ๐Ÿ’ฐ

Every offloaded task ends with a savings line, and Claude shows it to you:

```
Summary: 3 errors found in auth.log (lines 812, 1440, 2977) โ€ฆ
โ€” via gemini/gemini-2.5-flash
๐Ÿ’ฐ this call: ~11,723 ยท session: ~18,402 ยท total: ~240,118 Claude tokens (โ‰ˆ $3.60)
```

Ask Claude *"how much has offload saved me?"* for a full report. The all-time counter is stored in `~/.offload-mcp/stats.json`.

## How it saves tokens

Without it, Claude reads a 100k-token file into its context. With it, a free model reads the file and Claude gets a ~500-token answer. Your Claude usage goes to *thinking*, not to *reading*.

## โšก Quick setup (1 command)

Requires [Node.js](https://nodejs.org). Open a terminal (Windows: `cmd`) and run:

```bash
npx -y github:ok6416411-source/offload-mcp setup
```

A window opens in your browser โ†’ paste your free API keys โ†’ **Save**. Restart Claude Desktop. Done.
(Claude Code is configured automatically too, if installed.)

Or just tell Claude Code: *"Run `npx -y github:ok6416411-source/offload-mcp setup` for me."*

## Manual setup

### 1. Get at least one free API key
| Provider | Get a key | Good at |
|---|---|---|
| Groq | https://console.groq.com/keys | very fast |
| Google Gemini | https://aistudio.google.com/apikey | huge context (whole files) |
| Cerebras | https://cloud.cerebras.ai | very fast |
| Mistral | https://console.mistral.ai/api-keys | multilingual |
| NVIDIA NIM | https://build.nvidia.com | many open models |
| OpenRouter | https://openrouter.ai/keys | many `:free` models |

More keys = more free capacity and better fallback. Free-tier limits are set by each provider and change over time.

### 2. Add to Claude Desktop
Open *Settings โ†’ Developer โ†’ Edit Config* (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "offload": {
      "command": "npx",
      "args": ["-y", "github:ok6416411-source/offload-mcp"],
      "env": {
        "GEMINI_API_KEY": "...",
        "GROQ_API_KEY": "..."
      }
    }
  }
}
```
Restart Claude Desktop. Ask: *"list your offload providers"*.

**Claude Code:** `claude mcp add offload -e GEMINI_API_KEY=... -- npx -y github:ok6416411-source/offload-mcp`

### 3. Tell Claude to use it (optional but recommended)
Add to your project instructions / `CLAUDE.md`:
> For large files, logs or bulk text tasks, use the offload tools instead of reading content yourself.

## Configuration
| Env var | Effect |
|---|---|
| `OFFLOAD_ORDER` | Provider priority, e.g. `gemini,groq,cerebras` |
| `OFFLOAD_<ID>_MODEL` | Override a model, e.g. `OFFLOAD_GROQ_MODEL=...` |
| `OFFLOAD_MAX_FILE_CHARS` | Cap for `offload_files` input (default 400000) |
| `OFFLOAD_LANG` | Message language (`en`, `de`). Default: your system language |
| `OFFLOAD_NO_STAR=1` | Hide the one-time โญ reminder |

## Honest notes
- Free models are weaker than Claude. Offload *grunt work*, keep reasoning with Claude.
- Files you offload are sent to that provider. Don't offload secrets; check each provider's data policy (some free tiers may use data for training).
- Respect each provider's terms โ€” one account per provider, no key farming.

## Development
```bash
npm test
```
PRs welcome โ€” especially new providers (any OpenAI-compatible endpoint is a ~8-line addition in `src/providers.js`).

## License
MIT