CtxSlim
Allows CtxSlim to aggregate and proxy the GitHub MCP server, exposing GitHub-related tools while compressing schemas and reducing context overhead.
Allows CtxSlim to connect to the Notion MCP server and expose Notion-related tools through a single context-efficient proxy.
Allows CtxSlim to proxy a PostgreSQL MCP server, exposing database-related tools with compressed schemas and on-demand discovery.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CtxSlimsearch for tools related to database queries"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CtxSlim
Your MCP servers are eating your context. Put them on a diet.
One config entry. Every MCP server you already have. A fraction of the context.
Every MCP server you connect dumps its entire tool catalog into your LLM's context โ every name, every description, every JSON Schema property. Connect a database server, a browser server and a GitHub server and you can burn 30,000+ tokens before you've asked a single question. Your responses get slower, your bill gets bigger, and your agent gets dumber because it's drowning in tool definitions it doesn't need.
CtxSlim is a proxy that fixes this. It sits between your MCP client and your servers, exposes only the tools that matter for the current task, and compresses the schemas of what it does expose โ with zero API keys, zero cloud calls, zero config rewriting.
๐ Measured savings
Real numbers from the bundled benchmark (npm run bench), measured through actual MCP transports โ not marketing math:
Setup | Context before | After compression | With top-24 ranking |
2 servers ร 8 tools | 7.4k tokens | โ17.7% | โ17.7% |
4 servers ร 10 tools | 18.5k tokens | โ17.7% | โ50.6% |
6 servers ร 12 tools | 33.4k tokens | โ17.7% | โ72.6% |
The more servers you stack, the more Slim saves. And that's with modest schemas โ real-world servers (GitHub, Notion, browser automation) ship far heavier definitions.
Related MCP server: mcp-proxy
โก Quick start
Option 1 โ the one-liner. Let CtxSlim wire itself into your client:
npx -y ctxslim init # shows what it found on your machine
npx -y ctxslim init --client cursor --yes # writes it (with a backup first)Option 2 โ manual. Replace your stack of MCP server entries with a single one:
{
"mcpServers": {
"ctxslim": {
"command": "npx",
"args": ["-y", "ctxslim"]
}
}
}That's it. CtxSlim auto-discovers the servers already configured in your existing client config (read-only โ your files are never modified) and connects to all of them itself.
Works with:
Claude Desktop ยท Claude Code ยท Cursor ยท Windsurf ยท VS Code
Or point it at any config explicitly:
npx -y ctxslim --config /path/to/mcp.jsonOr drop a
ctxslim.jsonin your project directory
{
"mcpServers": {
"github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"] },
"postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"] }
},
"slim": {
"mode": "auto",
"maxTools": 24
}
}๐ง How it works
flowchart LR
C[MCP Client<br/>Claude ยท Cursor ยท Codex] <--> S[CtxSlim<br/>stdio proxy]
S <--> A[Server A<br/>files]
S <--> B[Server B<br/>database]
S <--> D[Server D<br/>browser]
style S fill:#16a34a,stroke:#14532d,color:#fffOn connection, Slim aggregates every upstream server behind one surface.
In
automode it exposes only the top-K most relevant tools, plus asearch_toolsmeta-tool your agent uses to pull in anything else on demand โ progressive disclosure instead of a 40-tool firehose.Exposed schemas are compressed: boilerplate keywords stripped, descriptions trimmed to a budget, unused
$defsdropped โ measured with a chars/4 token estimator and reported back to you.Tool calls are routed transparently to the right upstream server. Your agent can't tell the difference โ except its context is lighter.
Your agent gets four superpowers:
Meta tool | What it does |
| Semantic-ish BM25 search across all connected servers |
| Pin tools for the session so they're never swapped out |
| See what's connected and how healthy it is |
| Live report of tokens saved this session |
๐ Modes
Mode | Behavior |
| Top-K relevant tools per turn + meta tools. Default. |
| Only servers you allowlist, only tools you pin. Deterministic. |
| Pure aggregation proxy โ every tool, uncompressed. Useful just to unify N servers behind one entry. |
๐ CLI
ctxslim start the proxy
ctxslim init wire the proxy into a detected client config
(--client <name|path>, --yes to write, backup included)
ctxslim --config <path> use a specific config
ctxslim --mode <mode> auto | manual | off
ctxslim --max-tools <n> override top-K (default 24)
ctxslim --no-stats don't persist session stats
ctxslim --quiet minimal logging
ctxslim stats show lifetime savings
ctxslim doctor validate config + connectivitySession stats live in ~/.ctxslim/stats.jsonl. Run ctxslim stats after a week of work and watch the cumulative savings.
๐ Privacy
CtxSlim is 100% local. No API keys. No telemetry. No network calls except to the MCP servers you configure. Your tool definitions never leave your machine. The optional stats file stays on your disk and never leaves it.
โ FAQ
Does my agent really find tools that aren't exposed?
Yes โ that's what search_tools is for. Modern agents call it when a task needs something outside the exposed set, get the full compressed schema back, and call the tool. Even if a model skips search and calls a known-but-hidden tool by name, Slim routes it anyway. Nothing is ever hard-blocked.
Why not just install fewer servers? Because you installed them for a reason. The problem isn't having tools โ it's paying for all of them in every single prompt.
What about tool-name collisions?
If two servers expose the same tool name, Slim prefixes them (server__tool) and routes correctly.
Does it work with HTTP servers?
Yes โ url entries are proxied via Streamable HTTP alongside stdio servers.
Where are the tests?
43 of them, covering the compressor, the ranking engine, config discovery and a full integration suite that speaks real MCP over real transports. npm test.
๐ค Contributing
Contributions are genuinely welcome โ see CONTRIBUTING.md for the how and the why. The codebase is small, strict and comment-free on purpose; it's a nice one to read.
โญ Star history
If CtxSlim saved you tokens, a star helps other developers find it:
License
MIT ยฉ 2026
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA proxy server that wraps existing MCP servers to significantly reduce token consumption by compressing tool descriptions into a two-step interface. It enables users to integrate extensive toolsets without exceeding context limits or incurring high API costs.116Apache 2.0
- AlicenseAqualityDmaintenanceA proxy MCP server that reduces token usage by caching tool definitions locally and loading them on demand, supporting multiple backend MCP servers.51Apache 2.0
- AlicenseNot gradedqualityCmaintenanceA proxy MCP server that manages multiple upstream MCP servers by grouping them and loading tool schemas on-demand, reducing LLM context usage.2,79851MIT
- AlicenseNot gradedqualityDmaintenanceMCP proxy that reduces context usage through semantic tool routing, enabling on-demand discovery and routing of relevant tools.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/v01dst/ctxslim'
If you have feedback or need assistance with the MCP directory API, please join our Discord server