Skip to main content
Glama
README.md
# toolbox-mcp

[Português (Brasil)](README.pt-BR.md)

**One MCP server that keeps your other MCP servers switched off and starts them only when an agent needs them.**

Every conversation in Claude Code, Codex or Claude Desktop launches its own copy of every MCP server you registered. With a
handful of servers that are only used now and then (3D tools, game engines, design apps, rarely used APIs), that adds up fast:
in the setup this project was built for, it was about **330 MB of RAM per conversation**, for tools that were idle most of the
time. toolbox-mcp replaces all of them with a single, small server. The real servers run only while they are in use.

It is for people who use several MCP servers with AI coding agents and want to keep memory, context and startup time under
control, without giving up the servers they only need once in a while.

![Overview tab of the control panel](docs/screenshots/overview.jpg)

## How it works

1. Your client (Claude Code, Codex, Claude Desktop) registers only `toolbox`.
2. The agent sees a short list of managed servers and their descriptions, and calls `toolbox_enable` when it needs one.
3. The toolbox starts that server and exposes its tools in the same conversation as `<server>__<tool>`.
4. Idle servers stop on their own; everything stops when the conversation ends.
5. New servers, or changes to how a server is launched, are proposed by the agent and **approved by a human** in the panel.

## Quick start

Requirements: Node.js 20 or newer. Windows is the main target (tray icon, administrator helper); the gateway and panel also run
on macOS and Linux, but those are not supported targets yet.

**1. Install**

```sh
git clone https://github.com/CarlosVFAlves/toolbox-mcp.git
cd toolbox-mcp
npm ci
```

**2. Register the toolbox in your client** (use the absolute path of your clone)

Claude Code:

```sh
claude mcp add --scope user toolbox -- node "C:\path\to\toolbox-mcp\toolbox.mjs"
```

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

```toml
[mcp_servers.toolbox]
command = "node"
args = ["C:\\path\\to\\toolbox-mcp\\toolbox.mjs"]
tool_timeout_sec = 400
```

`tool_timeout_sec` matters: Codex's default (60 s) cuts off slow tool calls and administrator approvals.

Claude Desktop: add the same `command` and `args` under `mcpServers` in `claude_desktop_config.json`.

**3. Ask your agent to set it up**

Open a new conversation and say something like:

> Set up my toolbox. Call `toolbox_configure` with action `guide` and follow it.

You do not edit configuration files. The agent reads the setup guide ([docs/AGENT-SETUP.md](docs/AGENT-SETUP.md)), finds the MCP
servers you already have in Claude Code, Claude Desktop and Codex, imports the ones you pick (secret values are copied by the
toolbox, not shown to the agent), writes good descriptions and opens the panel. **You approve each server in the Approvals tab.**
When everything works, the agent can offer to remove the old registrations (with a backup, and only after you confirm).

## MCP tools

| Tool | Parameters | What it does |
| --- | --- | --- |
| `toolbox_list` | `name` (optional) | Lists managed servers and whether each is running. With `name`: full description and tool names, without starting it. |
| `toolbox_enable` | `name` | Starts a server (only if approved). Its tools appear as `<server>__<tool>`; the result lists them. |
| `toolbox_disable` | `name` | Stops a server and frees its memory. |
| `toolbox_configure` | `action` + per-action fields | Configures the toolbox itself. Actions: `view`, `guide`, `import_candidates`, `import_server` (`candidate_id`, `name`, `description`), `add_server` / `update_server` (`name`, `definition`), `remove_server` (`name`), `set_profile` (`client`, `always_visible`), `refresh_cache` (`name`), `open_panel`, `set_language` (`language`). |
| `admin_run` | `command`, `reason`, `impact`, `worst_case`, `undo`, `writes`; optional `shell`, `timeout_sec`, `write_limit_gb` | Windows only, listed only when administrator access is enabled. Asks to run **one** command as administrator; a human decides in a dialog. |
| `admin_result` | `id` (optional) | Results of administrator requests already decided (kept 24 h), for when an `admin_run` call dropped. |

Tool names from managed servers are shortened with a hash when they would exceed the client's length limit, so renaming a server
changes its tool names.

What an agent can change through `toolbox_configure`:

| Change | Mode `propose` (default) | Mode `free` | Mode `off` |
| --- | --- | --- | --- |
| New server, or a change to `command`, `args`, `cwd`, `url`, env/header names **or values**, or `description` | Proposal, a human approves | Applied and approved | Refused |
| `autostart`, `idleMinutes` | Applied immediately | Applied | Refused |
| Profiles, language, removing a server | Applied immediately | Applied | Refused |
| Agent mode, administrator access | Never | Never | Never |

At most 20 proposals can wait for a decision at a time; `open_panel` opens the panel at most once every 30 seconds per conversation.

## The control panel

A local web page (loopback only, random port and token) that opens in an app-style window. Open it from the tray menu,
with `npm run panel`, or by asking the agent (`toolbox_configure` → `open_panel`). It closes itself after 20 minutes without use.

- **Overview:** one column per connected conversation, one switch per server. Turning a switch on starts the server in that
  conversation. The Defaults columns set `autostart` and the Codex/Claude profiles. Clicking a server name opens a dialog to edit
  its description and idle time.
- **Approvals:** what agents proposed, with a diff against the current definition, the full command line and heuristic warnings
  (unpinned `npx` packages, shells, remote hosts, temp folders, risky environment variable names such as `NODE_OPTIONS` or
  `*_PROXY`, env values that point to a remote host, changed env/header values, a changed description). Env and header **values**
  are never shown, only which ones changed. Approve stays locked for a moment after a card appears or changes, and an approval is
  refused if the proposal changed after you opened it.
- **Activity:** who enabled what, which tools were called and how long they took. Tool arguments, results and administrator
  command text are not logged here.
- **Admin:** the administrator switch, the helper's install state with the manual install steps and the SHA-256 of the installer
  and helper, requests waiting for a decision and recent decisions. You cannot approve an administrator command here, and the
  panel cannot run the installer: both only happen outside it.
- **Settings:** language (English / Português), agent configuration mode (`off` / `propose` / `free`), tool cache.

![Approvals tab](docs/screenshots/approvals.jpg)

## Tray icon (Windows)

The first toolbox process starts a small tray icon. It never shows pop-ups; it only changes color:
gray = no conversation, blue = toolbox open in an agent, orange = a tool call in the last 3 seconds, red = an administrator
request is waiting. Right click: open the panel, switch servers per conversation, open the configuration folder. It closes
itself 3 minutes after the last conversation ends. Set `TOOLBOX_NO_TRAY=1` in the toolbox's environment to disable it.

## Profiles and Codex

Claude-style clients see new tools as soon as a server starts (`tools/list_changed`). **Codex freezes its tool list at the start
of each response**, so a server enabled mid-response is invisible to it until the next one.

For servers you use from Codex, add them to the Codex profile:

```json
{ "action": "set_profile", "client": "codex", "always_visible": ["my-server"] }
{ "action": "refresh_cache", "name": "my-server" }
```

Their tools are then listed from a cache (`cache/<server>.json`) from the start of every Codex conversation; the real server
starts on the first call and stops after 10 idle minutes (unless `idleMinutes` says otherwise). Each listed tool costs context
in every conversation, so be selective. The same works for `"client": "claude"`.

The cache is written whenever a server runs. To rebuild it from the command line (approved servers only):

```sh
node toolbox.mjs --refresh-cache            # every server
node toolbox.mjs --refresh-cache my-server  # one server
```

## Administrator access (Windows, optional)

> **Warning.** This feature gives an AI model a path to running commands as **administrator** on your computer. Every command
> needs a human click in an elevated dialog, but the dialog can only show you the command: it cannot tell you whether it is
> safe, and the agent's explanation is not verified. It is **off by default** and **experimental**. If you are not sure you need
> it, leave it off. Read [SECURITY.md](SECURITY.md) before turning it on.

![Admin tab](docs/screenshots/admin.jpg)

How it works: the agent calls `admin_run`; the toolbox writes a request file to `C:\ProgramData\ToolboxAdmin\pending` and starts
the scheduled task `ToolboxAdmin`. That task runs an elevated helper from `C:\Program Files\ToolboxAdmin`, which validates the
request and shows a dialog with, in this order: the exact command; facts it measures itself (free disk space, disk and CPU load,
RAM); known risks matched by a fixed table; and, clearly labeled as *not verified*, what the agent declared (reason, impact, worst
case, how to undo, what it writes).

- The command box wraps long lines, and the last part of the command is always repeated on its own line, so padding cannot push
  anything out of sight. Commands with hidden or look-alike characters, control characters or a lone carriage return are refused;
  runs of 15+ spaces and long commands (more than 8 lines or 600 characters) get a warning.
- Enter and Esc deny. Allow needs a mouse click, a short delay (2.5 s; 10 s and a tick box when a risk or alert is shown) and the
  mouse over the dialog. Unanswered requests are denied after 90 s (120 s with risks). There is no "always allow".
- The command runs from memory, in `System32`, with a clean environment, a time limit (5 to 600 s, default 120) and a write
  watchdog that aborts it if the disks lose more than the declared limit (default 2 GB) or the system disk drops below 2 GB free.
- At most 5 requests per minute; 3 denied or unanswered requests in a row pause requests for 5 minutes (withdrawing a request
  does not reset that count; only an allowed command does).
- Every request and decision goes to `C:\ProgramData\ToolboxAdmin\results\audit.log`, which only administrators can write.

To turn it on (there is deliberately no button for this: the installer runs elevated, so you start it yourself):

1. Read `windows/admin/install-admin.ps1` and `windows/admin/admin-helper.ps1`.
2. Compare their SHA-256 with `windows/admin/SHA256SUMS.txt` **and** with the values published in the release notes of a release
   you trust. A folder an agent can edit can also have an edited `SHA256SUMS.txt`, so the release notes are the reference that
   counts. In PowerShell: `Get-FileHash windows\admin\install-admin.ps1, windows\admin\admin-helper.ps1`.
3. Open PowerShell **as administrator** and run the installer:
   `powershell -NoProfile -ExecutionPolicy Bypass -File "C:\path\to\toolbox-mcp\windows\admin\install-admin.ps1"`.
   It prints the SHA-256 of the helper and of itself and asks you to type `YES`. Options: `-Language en|pt-BR`, `-RunAsUser`,
   `-AgentUser` (the separate-account setup is not validated end to end yet; see SECURITY.md).
4. Turn on **Allow administrator requests** in the panel's Admin tab. (If you turn it on before installing, the tab shows these
   steps, the command and the hashes of the files in your toolbox folder.)

Uninstall: `windows\admin\uninstall-admin.ps1`, elevated. It removes the task, the helper and its data folder, and copies the
audit log to your user folder first.

Never ask an agent to run the installer for you.

## Configuration

Everything personal lives in the data folder: `~/.toolbox` (on Windows `%USERPROFILE%\.toolbox`), or the folder in the
`TOOLBOX_HOME` environment variable. Nothing personal is stored in the repository. The configuration is reloaded within about a
second of any change; a broken file keeps the last good configuration and the error is shown by `toolbox_list` and in the panel.

`toolbox.json` (see [toolbox.example.json](toolbox.example.json)):

```json
{
  "version": 1,
  "language": null,
  "agentConfig": { "mode": "propose" },
  "admin": { "enabled": false },
  "profiles": {
    "codex": { "alwaysVisible": ["my-server"] }
  },
  "servers": {
    "my-server": {
      "description": "Does X. USE when the user asks for Y. Needs app Z open.",
      "command": "npx",
      "args": ["-y", "some-mcp-package@1.2.3"],
      "env": { "SOME_API_KEY": "..." },
      "idleMinutes": 15
    },
    "my-remote-server": {
      "description": "...",
      "url": "https://mcp.example.com/mcp",
      "headers": { "Authorization": "Bearer ..." }
    }
  }
}
```

| Field | Meaning |
| --- | --- |
| `version` | Format version, currently `1`. |
| `language` | `"en"`, `"pt-BR"` or `null` (follow the system). Used by the panel, tray and administrator dialog. |
| `agentConfig.mode` | `off`, `propose` (default) or `free`: what agents may change (table above). Change it in the panel. |
| `admin.enabled` | `true` lists `admin_run` / `admin_result` to agents. It does nothing unless the helper is installed. |
| `profiles.<client>.alwaysVisible` | For `codex` or `claude`: servers whose cached tools are listed from the start of every conversation. |
| `servers.<name>` | Name: 1 to 32 characters, lowercase letters, digits, `-`, `_`. |
| `…command`, `args`, `cwd` | A local stdio server. `args` is an array of strings. |
| `…url`, `headers` | An HTTP (Streamable HTTP) server, instead of `command`. |
| `…env` | Extra environment variables for the server. Child servers do **not** inherit your whole environment, only a minimal set (`PATH`, `SYSTEMROOT`, `APPDATA`, `USERPROFILE`, `TEMP` and a few more) plus this. |
| `…description` | What agents read to decide whether to start it (up to 600 characters). Say what it does, when to use it, what must be running, and any cost. Part of what a human approves. |
| `…autostart` | `true` starts it in every conversation as soon as the toolbox connects. |
| `…idleMinutes` | Stop after this many idle minutes (0 to 10080). `0` = never, except for always-visible servers, which default to 10. A call in progress is never cut. |

Other files in the data folder: `approvals.json` (what a human approved: a hash of each server's command, args, cwd, url, env and
header names and values, and description),
`proposals/` (pending proposals, expire after 7 days), `cache/` (tool lists), `logs/<server>.log` (stderr of each server, capped
at 1 MB), `usage.jsonl` (activity log: names and timings), `state/` and `control/` (one file per running conversation),
`ui.json` (the running panel's port and token), `tray.pid` and `tray.status.json` (tray icon), `ui-profile/` (the panel window's browser profile), `toolbox.json.bak` (previous
configuration).

Secret values in `env` and `headers` are stored in plain text, as MCP clients do in their own configuration files. Protect the
data folder like you protect those. Because values are part of the approval, **rotating an API key needs a new approval**: have
the agent propose the new value with `update_server` (or `import_server` again from the client where you changed it), then approve
it in the panel. Editing the value by hand in `toolbox.json` leaves the server unapproved, and the panel has no "approve as is"
button.

## Security in short

- toolbox-mcp protects against **mistakes, over-eager agents and prompt injection**. It does **not** contain a malicious program
  that already runs as your Windows user: such a program can edit `toolbox.json`, `approvals.json` and call the panel's API.
- A server runs only if its definition (`command`, `args`, `cwd`, `url`, env/header names and values, `description`) matches a
  human approval. Only `autostart` and `idleMinutes` are outside it.
- The panel listens only on `127.0.0.1`, requires a random token and checks `Host` and `Origin`. It cannot change how a server
  is launched and has no button that runs the administrator installer.
- Administrator access is off by default, needs an elevated installation started by a human (check the published SHA-256 first),
  and every command needs a click in an elevated dialog. Running agents under a separate standard Windows account gives stronger
  isolation, but that setup has not been validated end to end yet.

The full threat model, what each protection does and does not do, and how to report a vulnerability: [SECURITY.md](SECURITY.md).

## Known limitations

- Only MCP **tools** pass through the toolbox. Resources, prompts, sampling and elicitation of managed servers do not.
- Codex cannot see tools added mid-response: use the Codex profile and a generous `tool_timeout_sec`.
- Without approval, an agent can still switch `autostart` and idle time, change profiles and language, remove a server, start
  and stop approved servers, and refresh their tool cache (which starts them once).
- In a proposal you see the names of env vars and headers whose values changed, never the values. Approve a value change only
  if you know why it happened.
- `import_candidates` and `view` hide env and header values and mask parts of arguments and URLs that look like secrets, but that
  masking is a heuristic: prefer `env` or `headers` for secrets.
- A server added or changed by editing `toolbox.json` by hand stays "not approved"; ask an agent to propose it, or remove it.
- Windows-first. On macOS and Linux there is no tray, no administrator helper and no orphan cleanup.
- The administrator risk table is a text heuristic and is easy to evade. Read the command.

## Development

```sh
npm ci
npm test                 # node scripts/test.mjs (all test/*.test.mjs)
npm start                # node toolbox.mjs (an MCP server on stdio: run it from a client, not by hand)
npm run panel            # node ui/server.mjs --open
npm run hashes           # rewrites windows/admin/SHA256SUMS.txt after changing a Windows script
node toolbox.mjs --version
node ui/dev/mock-server.mjs   # the panel with fake data on port 5177, for UI work
```

The tests use the Node.js test runner, a fake MCP server (`test/fixtures/echo-server.mjs`) and a fake administrator helper that
drives the request folder (`TOOLBOX_ADMIN_DIR`, `TOOLBOX_NO_TASK_TRIGGER`). The helper's validation is tested on Windows through
its `-SelfTest` switch; nothing is run elevated. A test fails if `windows/admin/SHA256SUMS.txt` is out of date (run
`npm run hashes` and publish the same lines in the release notes). CI runs the tests on Windows and Ubuntu with Node 20 and 22
([.github/workflows/ci.yml](.github/workflows/ci.yml)).

How the pieces fit together: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). Changes: [CHANGELOG.md](CHANGELOG.md).

## License

[MIT](LICENSE)

TDQS

A3.7/5.0

Scored across 4 tools

Disambiguation4/5

The three lifecycle tools (list/enable/disable) are clearly distinct in purpose and target different state transitions. The only soft overlap is between toolbox_enable and toolbox_configure's add_server/import_server actions, but the descriptions clarify that configure changes configuration while enable controls runtime state.

Naming Consistency5/5

All four tools use the same toolbox_ prefix followed by a short, consistent verb (list, enable, disable, configure). There is no mixing of casing or verb styles, so the naming is fully predictable.

Tool Count4/5

Four tools is a tight, well-scoped surface for a server manager, and each tool has a clear role. However, toolbox_configure is a mega-tool bundling eleven actions (add/update/remove/import/profile/language/panel), which makes the effective surface much larger than the raw count suggests.

Completeness4/5

The surface covers discovery, runtime control, and full server configuration CRUD plus import and profile management. Minor gaps exist around diagnostics (logs, health/error inspection, explicit restart, though restart is achievable via disable+enable), but core workflows are all reachable.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues