| name | mcp-cli |
| description | Use when needing to interact with MCP servers on-demand via CLI without permanently loading integrations, discover available tools/resources on an MCP server, or call MCP tools from the command line. Triggers on: 'mcp cli', 'mcp tool call', 'call mcp server', 'discover mcp tools', 'mcp on-demand', 'mcp command line', 'mcp binary', 'list mcp tools', 'invoke mcp', 'mcp without integration'. |
| source | obra/superpowers-lab (MIT) — superpowers-lab/skills/mcp-cli |
| tier | TIER 3 — PRODUCTIVITY |
MCP CLI — On-Demand MCP Server Interaction
Source: obra/superpowers-lab (MIT) — github.com/obra/superpowers-lab
Dùng mcp CLI binary để gọi MCP servers on-demand mà không cần load vĩnh viễn vào config.
Context sạch, không bloat, không cần restart Claude Code.
Khác terminal--mcp-client (SDK-based programmatic): cái này là CLI tool cho human/agent dùng trực tiếp.
Khi nào dùng
- Muốn thử một MCP server mới mà không commit vào config
- Debug tool call từ MCP server
- Automation script cần gọi MCP tool
- Xem schema của tool trước khi integrate
Setup
npm install -g @modelcontextprotocol/cli 2>/dev/null \
|| pip install mcp-cli 2>/dev/null
mcp --version
export PATH="$HOME/.local/bin:$PATH"
Workflow chuẩn: Discover → Schema → Call → Cleanup
mcp tools npx -y @modelcontextprotocol/server-filesystem /tmp
mcp tools --format json npx -y @modelcontextprotocol/server-filesystem /tmp \
| python3 -m json.tool | head -60
mcp call read_file \
--params '{"path": "/tmp/test.txt"}' \
npx -y @modelcontextprotocol/server-filesystem /tmp
mcp alias fs "npx -y @modelcontextprotocol/server-filesystem /tmp"
mcp tools fs
mcp call read_file --params '{"path":"/tmp/test.txt"}' fs
mcp alias rm fs
Các loại operations
mcp tools <server-cmd>
mcp resources <server-cmd>
mcp prompts <server-cmd>
mcp read "file:///tmp/test.txt" <server-cmd>
mcp prompt my-prompt-name --args '{"key":"value"}' <server-cmd>
Authentication
mcp tools --auth user:password http://mcp.server:3000
mcp tools --header "Authorization: Bearer $TOKEN" http://mcp.server:3000
MCP_AUTH_TOKEN=sk-xxx mcp call tool_name --params '{}' http://mcp.server:3000
Common Servers
mcp tools npx -y @modelcontextprotocol/server-filesystem /workspace
mcp tools npx -y @modelcontextprotocol/server-memory
GITHUB_TOKEN=ghp_xxx mcp tools npx -y @modelcontextprotocol/server-github
BRAVE_API_KEY=xxx mcp tools npx -y @modelcontextprotocol/server-brave-search
mcp tools npx -y @modelcontextprotocol/server-puppeteer
mcp tools npx -y @modelcontextprotocol/server-sequential-thinking
Transport types (auto-detected)
mcp tools npx -y @my/server
mcp tools http://localhost:3000
mcp tools --transport sse http://localhost:3000/sse
Anti-Fake-Pass Checks
❌ FAIL nếu dùng mcp-cli cho servers cần permanent config (dùng .mcp.json thay thế)
❌ FAIL nếu pass secrets trong --params JSON (dùng env var)
✅ PASS khi: mcp tools trả về list hợp lệ + call trả về expected result
See also
terminal--mcp-client — SDK-based programmatic MCP integration
agent-reach — reach external platforms (Twitter, GitHub, Reddit) qua HTTP