mcp-client is CLI based MCP Client supporting SSE, stdio and StreamableHTTP with interactive REPL mode.
Lightweight && fouced on quick local checks and REPL mode.
An MCP client (for example, ChatGPT, or another application embedding a model) opens a session with a server.
An MCP server exposes:
- Tools (functions the model can call, like "run SQL query" or "create GitHub issue")
- Resources (structured data endpoints, like "all my calendar events" or "config files")
- Prompts (reusable templates that the model can fill in)
Communication flows over a transport: stdio (for local processes), HTTP with Server-Sent Events (SSE), or Streamable HTTP.
More info: https://modelcontextprotocol.io/specification
go build -o mcp-client# Create config file with example server
mcp-client config init
# Add your own server
mcp-client config add myserver \
--url http://localhost:8765 \
--transport streamable-http \
--defaultmcp-client interactive --server myserverInside interactive mode:
mcp> list-tools
mcp> call calculator {"op":"add","a":5,"b":3}
mcp> list-resources
mcp> help
mcp> exit
# List available tools
mcp-client list-tools --server myserver
# Call a tool
mcp-client call-tool --name calculator \
--args '{"op":"add","a":5,"b":3}' \
--server myservermcp-client config listOutput:
Configured servers:
* local:
Transport: streamable-http
URL: http://localhost:8765
production:
Transport: sse
URL: https://api.example.com/mcp
Default server: local (marked with *)
Streamable HTTP:
mcp-client config add prod \
--url https://api.example.com/mcp \
--transport streamable-http \
--defaultSSE:
mcp-client config add sse-server \
--url http://localhost:3000/events \
--transport sseStdio:
mcp-client config add local-stdio \
--transport stdio \
--command /path/to/mcp-server \
--args "arg1,arg2"mcp-client config remove prodmcp-client config set-default local# Show specific server
mcp-client config show prod
# Show overall config info
mcp-client config showInteractive mode provides a REPL-style interface for faster testing:
# Start with configured server
mcp-client interactive --server myserver
# Start with direct connection
mcp-client interactive \
--transport streamable-http \
--url http://localhost:8765| Command | Alias | Description | Example |
|---|---|---|---|
help |
h, ? |
Show help | help |
list-tools |
lt |
List all tools | list-tools |
list-resources |
lr |
List resources | list-resources |
list-prompts |
lp |
List prompts | list-prompts |
call |
c |
Call a tool | call calculator {"op":"add","a":5,"b":3} |
get-resource |
gr |
Get resource | get-resource file:///path/to/file |
get-prompt |
gp |
Get prompt | get-prompt greeting {"name":"Alice"} |
exit |
quit, q |
Exit | exit |
mcp-client init --server myserver
# Or without config
mcp-client init \
--transport streamable-http \
--url http://localhost:8765mcp-client list-tools --server myservermcp-client call-tool \
--name "calculator" \
--args '{"op":"add","a":5,"b":3}' \
--server myservermcp-client list-resources --server myservermcp-client get-resource \
--id "file:///path/to/file" \
--server myservermcp-client list-prompts --server myservermcp-client get-prompt \
--name "greeting" \
--arguments '{"name":"Alice"}' \
--server myserverStandard HTTP request/response:
mcp-client list-tools \
--transport streamable-http \
--url http://localhost:8765Streaming responses:
mcp-client list-tools \
--transport sse \
--url http://localhost:8765Communicate with local process:
mcp-client list-tools \
--transport stdio \
--command "/path/to/mcp-server" \
--args "arg1,arg2"Enable debug mode for detailed request/response information:
mcp-client list-tools --server myserver --debugOutput includes:
- Full request JSON
- Full response JSON
- Connection details
- Timing information
# Setup
mcp-client config add local \
--url http://localhost:8765 \
--transport streamable-http \
--default
# Test
mcp-client init --server local
mcp-client list-tools --server local
mcp-client call-tool --name echo --args '{"text":"Hello"}' --server localmcp-client interactive --server localConnected successfully!
mcp> list-tools
Tools:
{
"tools": [
{
"name": "calculator",
"description": "Perform basic calculations"
}
]
}
mcp> call calculator {"op":"add","a":5,"b":3}
Tool Result:
{
"content": [
{
"type": "text",
"text": "Result: 8"
}
]
}
mcp> exit
Goodbye!
# Add stdio server
mcp-client config add local-fs \
--transport stdio \
--command "./filesystem-server" \
--default
# Use it
mcp-client interactive --server local-fs# Configure multiple servers
mcp-client config add dev --url http://localhost:8765 --transport streamable-http
mcp-client config add staging --url https://staging.example.com/mcp --transport sse
mcp-client config add prod --url https://api.example.com/mcp --transport streamable-http
# Switch between them
mcp-client list-tools --server dev
mcp-client list-tools --server staging
mcp-client list-tools --server prodThe configuration file (~/.mcp-config.json) uses this format:
{
"default_server": "local",
"servers": {
"local": {
"url": "http://localhost:8765",
"transport": "streamable-http"
},
"production": {
"url": "https://api.example.com/mcp",
"transport": "sse"
},
"local-stdio": {
"transport": "stdio",
"command": "/path/to/mcp-server",
"args": ["--verbose", "--port", "8080"]
}
}
}| Flag | Description | Example |
|---|---|---|
--server |
Use named server from config | --server prod |
--config |
Custom config file path | --config ./my-config.json |
--debug |
Enable debug output | --debug |
--transport |
Transport type | --transport streamable-http |
--url |
Server URL | --url http://localhost:8765 |