Interactive CLI

Test and debug MCP servers with Hermes interactive CLI.

Available CLIs

  • STDIO Interactive - For local subprocess servers
  • StreamableHTTP Interactive - For HTTP/SSE servers
  • WebSocket Interactive - For WebSocket servers
  • SSE Interactive - For legacy SSE servers

Quick Start

STDIO Server

mix hermes.stdio.interactive --command=python --args=-m,mcp.server,my_server.py

HTTP Server

mix hermes.streamable_http.interactive --base-url=http://localhost:8080

WebSocket Server

mix hermes.websocket.interactive --base-url=ws://localhost:8081

Common Options

OptionDescription
-h, --helpShow help
-vIncrease verbosity (can stack: -vvv)

Verbosity levels:

  • No flag: Errors only
  • -v: + Warnings
  • -vv: + Info
  • -vvv: + Debug

Interactive Commands

CommandDescription
helpShow available commands
pingCheck server connection
list_toolsList available tools
call_toolCall a tool
list_promptsList prompts
get_promptGet prompt messages
list_resourcesList resources
read_resourceRead resource content
show_stateDebug state info
clearClear screen
exitExit CLI

Examples

Test Local Server

# Start interactive session
mix hermes.stdio.interactive --command=./my-server

# In the CLI
mcp> ping
pong

mcp> list_tools
Available tools:
- calculator: Perform calculations
- file_reader: Read files

mcp> call_tool
Tool name: calculator
Tool arguments (JSON): {"operation": "add", "a": 5, "b": 3}
Result: 8

Debug Connection

# Verbose mode
mix hermes.streamable_http.interactive -vvv --base-url=http://api.example.com

mcp> show_state
Client State:
  Protocol: 2025-03-26
  Initialized: true
  Capabilities: %{"tools" => %{}}
  
Transport State:
  Type: StreamableHTTP
  URL: http://api.example.com
  Connected: true

Test Tool Execution

mcp> list_tools
mcp> call_tool
Tool name: search
Tool arguments (JSON): {"query": "elixir"}

Transport-Specific Options

STDIO

OptionDescriptionDefault
--commandCommand to runmcp
--argsComma-separated argsnone

StreamableHTTP

OptionDescriptionDefault
--base-urlServer URLhttp://localhost:8080
--base-pathBase path/

WebSocket

OptionDescriptionDefault
--base-urlWebSocket URLws://localhost:8081
--ws-pathWebSocket path/ws

Tips

  1. Use -vvv for debugging connection issues
  2. show_state reveals internal state
  3. JSON arguments must be valid JSON
  4. Exit with exit or Ctrl+C