
cli-use
by JustVugg·★ 16·综合分 42
一个将任何MCP服务器转换为CLI的工具,可减少60-80%的令牌消耗,无需运行时依赖。
概述
Cli-use通过单个命令将任何MCP服务器转换为原生命令行界面,显著减少AI代理的令牌消耗。它通过将冗长的JSON-RPC调用转换为简洁的CLI命令,消除了模式发现、请求框架和响应解析的开销。该工具支持一次性执行和守护进程模式以提高性能,并提供调用缓存、批处理/管道模式、shell自动补全和OpenAPI导出等功能。使用纯Python标准库构建,兼容Linux、macOS和Windows。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您需要降低 MCP 工具调用的令牌成本,或希望将 MCP 服务器作为原生 Unix 风格 CLI 命令在 shell 脚本中使用时,选择 cli-use。
什么时候不要选它
如果您需要基本工具调用之外的完整 MCP 协议功能,或要求低于 10 毫秒的实时响应时间,则不要选择 cli-use。
此 server 暴露的工具
从 README 抽取出 12 个工具addadd <alias> <path>Install and register an MCP server as a CLI alias
listList available MCP servers in the built-in registry
daemonManage MCP server daemons for faster repeated calls
openapiGenerate OpenAPI spec from cached MCP server tools
completionsGenerate shell completion scripts for MCP tools
batchRun JSON pipeline across multiple MCP server aliases
runRun a specific MCP tool directly from command line
mcp-listList tools available from an MCP server
convertConvert MCP server to standalone CLI script
fsFilesystem operations: read, write, list, and search files
ghGitHub operations: issues, PRs, and repos
sqliteQuery and inspect SQLite databases
可对比工具
安装
git clone https://github.com/cli-use/cli-use.git
cd cli-use
pip install -e .对于Claude Desktop集成:
{
"mcpServers": {
"cli-use": {
"command": "python",
"args": ["-m", "cli_use.server"]
}
}
}FAQ
- Cli-use提供多少令牌减少?
- 测试显示在不同会话规模下可减少60-80%的令牌消耗,在模式发现方面节省80%,在每次调用I/O方面节省59%。
- 哪些MCP服务器已预配置?
- Cli-use内置支持10个服务器:fs(文件系统)、memory(知识图谱)、gh(GitHub)、git、sqlite、time、fetch、puppeteer、brave(网络搜索)和slack。
cli-use 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。