BC Code Intelligence MCP Server
Business Central and AL development guidance from a bundled knowledge base of specialist personas
Local stdio server that caches, diffs and compresses what a coding agent reads to cut context use
By Franklin Moormann (individual) TypeScript Local · stdio Developer toolsKnowledge and memoryFiles and storage
71 popularity score ★ 576 ↓ 5.5k/wk
Opens the app, which asks before it adds the server.
claude mcp add token-optimizer -- npx -y @ooples/token-optimizer-mcp@latest{
"mcpServers": {
"token-optimizer": {
"command": "npx",
"args": [
"-y",
"@ooples/token-optimizer-mcp@latest"
]
}
}
}{
"mcpServers": {
"token-optimizer": {
"command": "npx",
"args": [
"-y",
"@ooples/token-optimizer-mcp@latest"
]
}
}
}{
"servers": {
"token-optimizer": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@ooples/token-optimizer-mcp@latest"
]
}
}
}[mcp_servers.token-optimizer]
command = "npx"
args = ["-y", "@ooples/token-optimizer-mcp@latest"]gemini mcp add --scope user token-optimizer npx -- -y @ooples/token-optimizer-mcp@latestTOKEN_OPTIMIZER_TOOL_PROFILE |
Optional: Which tools are offered: core (19 tools), files, continuity, cognitive, attestation or full (all tools). |
|---|---|
TOKEN_OPTIMIZER_CACHE_DIR |
Optional: Cache location instead of ~/.token-optimizer-cache/. |
TOKEN_OPTIMIZER_HOME |
Optional: Folder for sessions, configuration and stored OrcaRouter keys. |
DO_NOT_TRACK |
Optional: Set to 1 to turn off local counting and upload whatever else is set. |
ORCAROUTER_API_KEY secret |
Optional: OrcaRouter key for the optimizer's own model calls; takes precedence over a stored key. |
| Set together: telemetry | |
TOKEN_OPTIMIZER_TELEMETRY |
Optional: Set to 1 to aggregate anonymous usage counts into a local file; off by default. |
TOKEN_OPTIMIZER_BEACON |
Optional: Set to 1, together with TOKEN_OPTIMIZER_TELEMETRY, to upload those counts; off by default. |
Token Optimizer MCP is a Node.js server that sits between a coding agent and the files and output it keeps pulling into its context. Its file tools (smart_read, smart_edit, smart_grep and the like) cache what they return, so reading an unchanged file again gives back a diff instead of the whole file, and searches come back as matches or paths only. Text the agent wants out of its window can be compressed and parked in a local cache with optimize_text and fetched back with get_cached or expand.
Alongside the cache it keeps a per-project knowledge graph that the agent writes to and reads from (wiki_write, wiki_read, wiki_query), so findings survive into later sessions, plus a set of audit tools that report token spend, prompt-cache waste and savings, per project or across the whole machine. Everything is stored on the user's own disk; there is no account and no hosted service.
The README's tool reference is headed 74 tools, yet a client sees far fewer. Unless TOKEN_OPTIMIZER_TOOL_PROFILE picks another profile, the server advertises a core set of 19 tools and turns away calls to anything else by name (src/server/tool-profile.ts). That includes cache_warmup, smart_cache and clear_cache, which the README's own troubleshooting steps tell you to call. Those only work with the profile set to full, which the README says brings 104 tools and roughly 30,000 tokens of schemas, against about 4,800 for core.
The server alone only offers tools the model may ignore. The makers recommend their Claude Code plugin or the hooks that the separate token-optimizer-install command writes, which deny built-in reads, greps and edits and point the agent to the cached tools.
| Runtime | Node.js 22.14.0+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| Also |
|
Runs through npx; any MCP client that speaks stdio. Enforcing hooks are a separate step: npm install -g @ooples/token-optimizer-mcp@latest and then token-optimizer-install, or the Claude Code plugin via /plugin marketplace add ooples/token-optimizer-mcp. Model calls through OrcaRouter need an OrcaRouter key or account.
Under the default core profile only 19 tools are offered and any other tool name is refused; set TOKEN_OPTIMIZER_TOOL_PROFILE=full for the rest, at a much larger schema cost. An unknown profile value stops the server at start. Its own pages say small text (under about 500 characters) and one-off content gain nothing, cached entries are cleaned up after 7 days, and the core token counting uses a GPT-4 tokenizer, so counts for Claude are an approximation. Without the plugin or hooks the model is free to keep using its built-in tools.
It suits developers who run long sessions in Claude Code, Codex, Gemini CLI, Copilot CLI or OpenCode and want fewer tokens spent on re-reading files and logs, with numbers to show the saving, all kept on their own machine. It is most useful with its hooks installed; as a bare MCP server it is advisory. Those who only want plain file access with no cache, no hooks editing client settings, and no local analytics database are better served by a simpler file server. It is a community project, not from any AI vendor.
14 only read, 5 change things. A ? marks an optional parameter.
smart_readsmart_write changessmart_edit changessmart_globsmart_grepoptimize_text changestext: stringkey: stringquality?: numberget_cachedkey: stringoptimize_session changessessionId?: stringmin_token_threshold?: numberget_optimization_reportwiki_write changeswiki_readwiki_queryexpandwaste_auditcache_auditmodel_routingtoken_auditinstall_doctorfleet_audit