mcpli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mcpli

mcpli

CLI that turns MCP servers into native commands with tab completion.
一款可将MCP服务器转换为支持自动补全的原生命令的CLI工具。

Core Commands

核心命令

Add a server

添加服务器

bash
mcpli add <name> <url> [--header "key: value"]...
Headers support environment variable expansion with
${VAR_NAME}
:
bash
mcpli add myserver https://example.com/mcp/ \
  --header 'Authorization: Bearer ${API_TOKEN}'
bash
mcpli add <name> <url> [--header "key: value"]...
Header支持通过
${VAR_NAME}
进行环境变量展开:
bash
mcpli add myserver https://example.com/mcp/ \
  --header 'Authorization: Bearer ${API_TOKEN}'

List servers and tools

列出服务器与工具

bash
mcpli list              # List all configured servers
mcpli list <server>     # List tools for a server
bash
mcpli list              # 列出所有已配置的服务器
mcpli list <server>     # 列出某一服务器的工具

Discover tools

发现工具

bash
mcpli <server> --help           # See all tools on a server
mcpli <server> <tool> --help    # See tool description and usage
bash
mcpli <server> --help           # 查看服务器上的所有工具
mcpli <server> <tool> --help    # 查看工具的描述与使用方法

Invoke a tool

调用工具

bash
mcpli <server> <tool> [json-arguments]
Examples:
bash
mcpli myserver get_status                           # No arguments
mcpli myserver search '{"query": "hello"}'          # With JSON arguments
mcpli myserver create_item '{"name": "test", "count": 5}'
bash
mcpli <server> <tool> [json-arguments]
示例:
bash
mcpli myserver get_status                           # 无参数
mcpli myserver search '{"query": "hello"}'          # 带JSON参数
mcpli myserver create_item '{"name": "test", "count": 5}'

Manage servers

管理服务器

bash
mcpli update <server>   # Refresh cached tool definitions
mcpli remove <server>   # Remove a configured server
bash
mcpli update <server>   # 刷新缓存的工具定义
mcpli remove <server>   # 删除已配置的服务器

Workflow

工作流程

  1. Add server with
    mcpli add
    (fetches and caches tools)
  2. Discover tools with
    mcpli <server> --help
  3. Check tool parameters with
    mcpli <server> <tool> --help
  4. Invoke tools with
    mcpli <server> <tool> '{...}'
  1. 使用
    mcpli add
    添加服务器(获取并缓存工具)
  2. 使用
    mcpli <server> --help
    发现工具
  3. 使用
    mcpli <server> <tool> --help
    查看工具参数
  4. 使用
    mcpli <server> <tool> '{...}'
    调用工具

Notes

注意事项

  • Tool definitions are cached locally after
    add
    ; use
    update
    to refresh
  • Config stored at
    ~/.config/mcpli/config.json
  • Arguments must be valid JSON (use single quotes around JSON to avoid shell escaping issues)
  • 工具定义在
    add
    操作后会本地缓存;使用
    update
    进行刷新
  • 配置文件存储在
    ~/.config/mcpli/config.json
  • 参数必须是有效的JSON(使用单引号包裹JSON以避免Shell转义问题)