Other MCP clients (unofficial)
A generic, best-effort guide to running context-mode in any MCP-capable client that is not officially supported yet: register the MCP server and steer routing with an AGENTS.md file.
context-mode is a standard MCP server, so any client that speaks the Model Context Protocol can run it. This page is a generic, best-effort setup for hosts context-mode does not officially support yet. Those clients are unverified, so treat everything here as a starting point:
- Register context-mode as an MCP server.
- Steer the agent toward the
ctx_*tools with a routing instruction file the host reads.
This is an unofficial, generic MCP setup. It has not been verified on your specific client and may have bugs. Routing is advisory only — unsupported clients expose no hooks, so the agent is never forced to send large output through the sandbox. If you hit a problem, please report it so the team can add first-class support.
Install
context-mode runs as an MCP server in any compatible client. The only required work is adding it to the client's MCP configuration; a global install is optional.
(Optional) Install the global binary
Skip this step to run context-mode with npx and no global install. Install it
globally only if you prefer a fixed binary on your PATH.
npm install -g context-modeRegister the MCP server
Add context-mode to your client's MCP server configuration. Most MCP clients use
a standard mcpServers block; consult your client's docs for the exact file
path. Use the npx form for no global install, or the context-mode command if
you installed it globally.
{
"mcpServers": {
"context-mode": {
"command": "npx",
"args": ["-y", "context-mode"]
}
}
}{
"mcpServers": {
"context-mode": {
"command": "context-mode",
"args": []
}
}
}The npx form needs Node 22.5+ or Bun available on your PATH.
Add a routing instruction file
Unsupported clients expose no hooks, so the only way to steer the agent toward
the ctx_* tools is an instruction file the host reads. Drop an AGENTS.md at
your project root telling the model to route data-heavy work through the sandbox.
Most MCP clients read AGENTS.md natively; if yours uses a different convention,
use that filename instead.
# Routing rules for context-mode
Use the context-mode MCP tools instead of dumping raw output into context:
- Analyze, count, filter, parse, or transform data → write code with
`ctx_execute` and `console.log` only the answer.
- Gather lots of state at once → `ctx_batch_execute`.
- Follow-up questions over indexed data → `ctx_search`.
- Fetch a URL → `ctx_fetch_and_index`, then `ctx_search`.
Do not read large files or raw command output into context to analyze them.See tool selection for the full routing hierarchy this file is summarizing.
What you get on this host
The ctx_* tools are fully available once the server is registered:
| Tool | What it does |
|---|---|
ctx_execute | Runs code in the sandbox. |
ctx_batch_execute | Gathers lots of state at once. |
ctx_search | Searches prior results. |
ctx_index | Indexes content for later search. |
What differs from a supported host is enforcement. On a hooked host,
routing of large output is mandatory; here it is advisory, carried only by the
AGENTS.md file. Savings depend on how closely the agent follows that file, so
they vary by client and by session.
Verify your savings
Confirm context-mode is actually saving you tokens, not just registered.
Check the savings in chat
In any host, type ctx stats in chat — the model calls the ctx_stats MCP tool
and reports the tokens saved and savings ratio for the session. On an unsupported
client there is no hook layer, so savings depend on how closely the agent follows
your AGENTS.md; ctx stats is the way to confirm routing is actually happening.
Confirm the MCP server is registered
If your client exposes a terminal, run the doctor to confirm the MCP server is registered. It checks language runtimes, the FTS5 knowledge base, and MCP server registration, then reports anything that needs attention. There is no hook or status line to confirm on an unsupported host — only MCP.
Run the command that matches your install:
npx -y context-mode doctorcontext-mode doctorA clean run means the MCP server is reachable. If your client supports slash
commands, you can also try a ctx_* tool directly to confirm the agent can
reach them.