slim is a lightweight TypeScript-based extension for AI CLIs (Gemini, Qwen, Claude) that dramatically reduces Model Context Protocol (MCP) token usage by compressing tool exposure.
When you use multiple MCP servers, AI CLIs inject every single tool schema into the LLM prompt. For large servers like github or filesystem, this can consume thousands of tokens before you even start typing.
Example Raw Exposure:
read_file,write_file,list_directory,search_code,git_diff,create_issue,get_pull_request... (50+ tools)
slim consolidates an entire MCP server into a single Skill Signature. Instead of 50 schemas, the LLM sees one:
github_tools(action, params)
When the LLM calls github_tools("create_issue", { ... }), the slim runtime routes the call to the correct MCP tool.
Result: ~95% reduction in MCP-related token overhead.
- Native CLI Detection: Automatically identifies if you are running in Gemini, Qwen, or Claude environments.
- Automated Discovery: Scans your host CLI
settings.jsonto find and connect to your MCP servers. - On-the-fly Generation: Spawns MCP servers via JSON-RPC to fetch tool lists and generate skill definitions.
- Safe Execution: Manages MCP process lifecycles and standardizes routing via a local registry.
- Zero Latency: High-performance TypeScript implementation with minimal dependencies.
-
Clone and Build:
git clone https://github.com/your-repo/slim.git cd slim npm install npm run build -
Link Globally:
npm link
Scan your host CLI settings and generate compressed skills.
slim initNote: You can specify a CLI manually with --cli [gemini|qwen|claude].
View your generated skills and the actions they contain.
slim inspectOnce initialized, you can reference the skills in your AI CLI:
"Use
github_toolsto create a new issue for the bug we found."
src/cli/: Command handlers (init,inspect,status).src/core/: Business logic for MCP scanning, tool fetching, and skill generation.src/storage/: Path management and JSON persistence.src/types/: Shared TypeScript interfaces.~/.slim/: Local state directory where registries and schemas are stored.
We welcome contributions! Please see our CONTRIBUTING.md (coming soon) for details on our code of conduct and the process for submitting pull requests.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the ISC License. See LICENSE for more information.
Built with ❤️ for the AI Engineer community.