# toolc MCP server

> Compiles multiple MCP servers and REST APIs into a single, optimized tool endpoint to reduce context usage and improve agent accuracy.

- Repository: https://github.com/toolc-dev/toolc
- Page: https://hostedmcp.org/servers/toolc-dev/toolc
- Transport: stdio
- Stars: 0
- License: Apache-2.0
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc -- npx -y @toolc/cli
```

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

```json
{
  "mcpServers": {
    "toolc": {
      "command": "npx",
      "args": [
        "-y",
        "@toolc/cli"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "toolc": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@toolc/cli"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"toolc","type":"stdio","command":"npx","args":["-y","@toolc/cli"],"env":{"ANTHROPIC_API_KEY":"<YOUR_ANTHROPIC_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "toolc": {
      "command": "npx",
      "args": [
        "-y",
        "@toolc/cli"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add toolc --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' -- npx -y @toolc/cli
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.toolc]
command = "npx"
args = ["-y", "@toolc/cli"]

[mcp_servers.toolc.env]
ANTHROPIC_API_KEY = "<YOUR_ANTHROPIC_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc npx -- -y @toolc/cli
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "toolc": {
      "command": "npx",
      "args": [
        "-y",
        "@toolc/cli"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `ANTHROPIC_API_KEY` | no | yes | Enables the LLM-assisted compile passes (rewrite, consolidate). Without it, toolc serves a mirror of the original tool surface. |

## FAQ

### Can I use my own REST APIs with toolc?

Yes, you can include REST APIs by providing an OpenAPI spec or by using a drafted spec synthesized from documentation.

### Does toolc support local deployment?

Yes, the engine is Apache-2.0 licensed and allows you to compile and serve tool surfaces locally using the CLI.

### How much can toolc reduce costs?

Benchmarks show that compiled and consolidated tool surfaces can be up to 6.4 times cheaper than using raw tools.
