MCP-CLI
MCP-CLI是一个命令行工具,用于管理MCP(机器对话协议)服务器并与之交互。
特性
- 管理多个MCP服务器
- 交互式命令行界面
- 支持查看和调用服务器工具
- 支持查看服务器提示和资源
- 支持工具调用
安装
go install github.com/yourusername/mcp-cli@latest配置
创建配置文件 ~/.mcp-cli.json:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
...
}
}用法
列出所有服务器
$ mcp-cli server list| 服务器名称 | 命令 | Args | 环境 |
|---|---|---|---|
| 剧作家 | npx | @剧作家/mcp@latest |
检查服务器
$ ./mcp-cli server inspect -n playwright
Inspecting server: {Command:npx Args:[@playwright/mcp@latest] Env:map[]}
Initializing MCP client...
Entering interactive shell for server: playwright
Type 'help' for available commands, 'exit' to quit
playwright> tools
total 21 tools| 名称 | 描述 | 参数 |
|---|---|---|
| browser_close | 关闭页面 | {"type": "object", "properties": {}} |
| browser_wait | 等待指定的时间(秒) | {"type": "object", "properties": {"time": {"description": "The time to wait in seconds", "type": "number"}}, "required": ["time"]} |
交互式命令
> tools # Show available tools
> prompts # Show available prompts
> resources # Show available resources
> call tool-name {"param": "value"} # Call a tool
> help # Show help information
> exit # Exit工具调用示例

许可证
MIT许可证
