Skip to content

shell

Open an interactive session against a server over a single, persistent connection. Because the connection (and therefore the session id and any server-side state) survives between commands, the shell is ideal for stateful servers and for fast, exploratory recon.

mcpwn shell <target>
mcpwn shell http://127.0.0.1:8765/mcp/
mcpwn shell "python examples/vuln_server.py"

Shell commands

mcpwn> tools                     list tools
mcpwn> prompts                   list prompts
mcpwn> resources                 list resources
mcpwn> templates                 list resource templates
mcpwn> info <tool>               show one tool's parameters
mcpwn> call <tool> [args]        call a tool   (args: a=1 b=two  or  {"a":1})
mcpwn> prompt <name> [args]      render a prompt
mcpwn> read <uri>                read a resource
mcpwn> reconnect                 drop and reopen the connection
mcpwn> clear                     clear the screen
mcpwn> help                      show help
mcpwn> exit / quit               leave

Example session:

mcpwn> tools
mcpwn> info lookup_user
mcpwn> call add a=5 b=5
mcpwn> call search {"q":"x","limit":3}
mcpwn> read config://app
mcpwn> reconnect
mcpwn> exit

Inline arguments

call and prompt take arguments two ways, mirroring the CLI:

  • key=value pairs — each value is parsed as JSON, falling back to a string (a=5 → 5, name=alice → "alice").
  • a single { ... } JSON object — call search {"q":"x","limit":3}.

Line editing & history

When the readline module is available (most Linux/macOS shells), editing is enabled automatically:

  • Up / Down — walk command history
  • Left / Right — move within the current line

On platforms without readline (e.g. Windows without pyreadline), the shell falls back to plain input.

reconnect for a clean slate

reconnect tears down and reopens the connection — handy to drop a wedged session id or to re-establish state after the server restarts, without leaving the shell.