A powerful CLI tool for interacting with MCP (Model Context Protocol) servers
# Install
go install github.com/weibaohui/mcp2cli@latest
# List configured servers (no server connection)
mcp
# Inspect a server's available tools
mcp openDeepWiki
# View tool details with parameter examples
mcp openDeepWiki list_repositories
# Call a tool
mcp openDeepWiki list_repositories limit=3
# Call with typed arguments (recommended)
mcp openDeepWiki list_repositories limit:number=3 enabled:bool=trueArguments can be in two formats:
# Simple key=value (string type by default)
mcp server tool name=John age=30
# Typed key:type=value (recommended for precision)
mcp server tool name:string=John age:number=30 enabled:bool=trueSupported types: string, number, int, float, bool
- 🔍 Discover Servers - List all configured MCP servers without connecting
- 📋 Explore Tools - View detailed tool information with formatted parameters
- 🚀 Invoke Tools - Call tools directly with type-safe arguments
- 🔌 Multiple Transports - Support for SSE, Streamable HTTP, and Stdio
- 📁 Smart Config - Auto-detects and merges configs from standard locations
- 📤 Unified JSON Output - Machine-readable output for scripting
Download from GitHub Releases
go install github.com/weibaohui/mcp2cli@latestgit clone https://github.com/weibaohui/mcp2cli.git
cd mcp2cli
make buildCreate ~/.config/mcp/config.json:
{
"mcpServers": {
"openDeepWiki": {
"url": "https://opendeepwiki.k8m.site/mcp/streamable",
"timeout": 30000
}
}
}| Platform | Priority Order |
|---|---|
| macOS/Linux | ~/.config/modelcontextprotocol/mcp.json → ~/.config/mcp/config.json → ./mcp.json → ./.mcp/config.json → /etc/mcp/config.json |
| Windows | %APPDATA%\modelcontextprotocol\mcp.json → %APPDATA%\mcp\config.json → %USERPROFILE%\.mcp\config.json → .\mcp.json → .\.mcp\config.json |
{
"mcpServers": {
"serverName": {
"transport": "streamable",
"url": "https://example.com/mcp",
"command": "npx",
"args": ["-y", "@server/mcp"],
"env": {"KEY": "value"},
"timeout": 30000
}
}
}Transport Types:
| Type | Description |
|---|---|
streamable |
Modern streaming HTTP (default) |
sse |
Server-Sent Events over HTTP |
stdio |
Local subprocess communication |
# List all configured servers
mcp
# Get server info with tools list
mcp <server_name>
# Get tool details with parameter examples
mcp <server_name> <tool_name>
# Call a tool with arguments
mcp <server_name> <tool_name> <key=value> [key2=value2]...All commands return unified JSON:
{
"success": true,
"data": {
"configFiles": ["/home/user/.config/mcp/config.json"],
"servers": [
{
"name": "openDeepWiki",
"transport": "streamable",
"url": "https://opendeepwiki.k8m.site/mcp/streamable"
}
]
},
"meta": {
"timestamp": "2026-03-24T10:00:00Z",
"version": "v0.2.8"
}
}cmd/mcp/main.go # CLI entry point, argument routing
internal/mcp/
├── types.go # Error codes, shared types
├── config.go # Config loading & merging
├── config_paths.go # Platform-specific paths
├── client.go # MCP server client
├── dispatcher.go # Multi-server coordination
└── formatter.go # Schema formatting, arg parsing
# Build for current platform
make build
# Build for all platforms
make build-all
# Run tests
make test
# Lint code
make lintMIT License - see LICENSE for details.