context-slim
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., "@context-slimSlim down the billing controller for context."
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.
ContextSlim
Save 50%+ AI context tokens without losing critical code semantics.
Code: github.com/lilite572-cyber/context-slim · install: @idmxgne/context-slim (npm account idmxgne). Not Jagganu’s context-slim (CLI output trimmer).
Cursor, Claude, and other coding agents re-read whole files on every turn. Most of that budget is JSDoc, unused imports, and DTO mappers. ContextSlim parses JS/TS (Babel) and PHP (php-parser), hollows the noise, and keeps try/catch, auth methods, env() / process.env, and markers like FIXME / SECURITY / В ПРОД НЕ ГНАТЬ.
Before / after
Measured on the real-world billing controller in tests/fixtures/real_world_controller.ts (--signatures-only):
Tokens | What you keep | |
Before | 3,522 | comments, mappers, unused imports, every method body |
After | 1,408 | signatures + critical bodies + protected comments |
Savings | 60% (10 labels kept) | try/catch, |
CLI stats use gpt-tokenizer (o200k_base, GPT-4o / GPT-5 family) and print to stderr. Slim source goes to stdout.
npx -y --package=@idmxgne/context-slim context-slim .
# Исходный размер: 3,522 токенов -> Сжатый: 1,408 токенов. Экономия: 60% ...The binary is context-slim, not @idmxgne/context-slim. Scoped npx @idmxgne/context-slim . fails with command not found.
Related MCP server: cctx-mcp
Quick start
npx -y --package=@idmxgne/context-slim context-slim .
npx -y --package=@idmxgne/context-slim context-slim ./src --signatures-only
npx -y --package=@idmxgne/context-slim context-slim ./src --out slim.txt
npx -y --package=@idmxgne/context-slim context-slim-mcpFrom a clone:
npm i && npm run build
node dist/cli.js ./srcMCP server (Cursor, Windsurf, Claude Code)
Bin: context-slim-mcp → dist/mcp.js. Official @modelcontextprotocol/sdk Server + StdioServerTransport. Do not write logs to stdout.
Prompt use-slim-context:
Always prioritize using
read_slim_filetool when reading source code files to optimize context window.
Tools:
Tool | Args | Result |
|
| compressed source |
| none | last run: tokens before / after, |
Cursor
Merge into ~/.cursor/mcp.json (ready-made copy: examples/cursor-mcp.json):
{
"mcpServers": {
"context-slim": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/context-slim/dist/mcp.js"]
}
}
}After npm publish:
{
"mcpServers": {
"context-slim": {
"command": "npx",
"args": ["-y", "--package=@idmxgne/context-slim", "context-slim-mcp"]
}
}
}Restart Cursor and ask the agent to read_slim_file on a fat controller.
Windsurf
Same mcpServers block in Windsurf's MCP config (~/.codeium/windsurf/mcp_config.json, or the MCP panel in settings). Point command at node + dist/mcp.js, or at npx as above.
Claude Code / Claude Desktop
Claude Desktop — merge examples/claude_desktop_config.json into claude_desktop_config.json:
{
"mcpServers": {
"context-slim": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/context-slim/dist/mcp.js"]
}
}
}Claude Code:
claude mcp add context-slim -- node /ABSOLUTE/PATH/TO/context-slim/dist/mcp.jsSafe labels (.contextslimrc + isCriticalNode)
A node is never hollowed when isCriticalNode says so:
comments matching CRITICAL, FIXME, TODO, SECURITY, DONT TOUCH,
В ПРОД НЕ ГНАТЬ,@keeptry/catchmethods whose names look like auth (
authorize,login,jwt,csrf, …)env(),getenv(),process.envPHP/Laravel:
$this->hasMany/$this->belongsTo(and other Eloquent relations) andscope*methods
Repo: https://github.com/lilite572-cyber/context-slim
Put extra phrases in .contextslimrc at the project root:
{
"keep_patterns": ["HACK", "LEGACY"]
}entry_patterns (defaults: index / cli / main / app / server) keep ordinary function bodies even without --signatures-only. Dependency files are hollowed; pass --signatures-only (or MCP signaturesOnly: true) to hollow everything that is not critical.
Install / publish
npm i
npm test
npm run buildBins: context-slim → ./dist/cli.js, context-slim-mcp → ./dist/mcp.js. npm: @idmxgne/context-slim. GitHub: lilite572-cyber/context-slim. License: MIT.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that reduces token consumption in AI coding assistants by up to 90% via structural reads, PreToolUse hooks, and tp-\* subagents.254254MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides structure-aware code analysis (symbol trees, dependencies, docs) to reduce AI agent token consumption by up to 99%, along with Git commit intelligence.MIT
- AlicenseAqualityBmaintenanceAn AST-based MCP server that provides token-efficient codebase skeletons to LLM agents, reducing context token usage by 80-95% by exposing structural information instead of full source files.5122MIT
- -licenseNot gradedqualityNot gradedmaintenanceAST-aware code exploration MCP server for AI agents, optimized for token efficiency.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
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/lilite572-cyber/context-slim'
If you have feedback or need assistance with the MCP directory API, please join our Discord server