Cli Reference
Complete reference for every mcp2cli command, flag, and option.
Invocation Modes
mcp2cli [--json] [--output <FORMAT>] [--timeout <SECS>] <command>mcp2cli [--json] [--output <FORMAT>] [--timeout <SECS>] <config-name> <command>mcp2cli --url <URL> [--json] [--timeout <SECS>] <command>mcp2cli --stdio <COMMAND> [--env KEY=VAL]... [--json] [--timeout <SECS>] <command><alias> [--json] [--output <FORMAT>] [--timeout <SECS>] <command>Global Flags
| Flag | Short | Description |
|---|---|---|
--json | Output JSON instead of human-readable text | |
--output <FORMAT> | -o | Output format: human, json, ndjson |
--timeout <SECS> | Request timeout in seconds (0 = no timeout) | |
--url <URL> | Ad-hoc HTTP MCP server URL (no config needed) | |
--stdio <COMMAND> | Ad-hoc stdio MCP server command (no config needed) | |
--env <KEY=VALUE> | Environment variable for --stdio server (repeatable) |
Host Commands
These manage configs and aliases — no server connection required.
config init
Create a new named config.
mcp2cli config init --name <NAME> --app bridge \ --transport <stdio|streamable_http> \ [--endpoint <URL>] \ [--stdio-command <CMD>] \ [--stdio-args <ARG>...]| Flag | Required | Description |
|---|---|---|
--name <NAME> | ✅ | Config name (alphanumeric, hyphens) |
--app <PROFILE> | ✅ | Application profile (bridge) |
--transport <TYPE> | ✅ | stdio or streamable_http |
--endpoint <URL> | for HTTP | Server endpoint URL |
--stdio-command <CMD> | for stdio | Subprocess command |
--stdio-args <ARG>... | Subprocess arguments |
config list
List all named configs.
mcp2cli config listconfig show
Display a named config.
mcp2cli config show --name <NAME>use
Manage the active config.
mcp2cli use <NAME> # Set active configmcp2cli use --show # Show current active configmcp2cli use --clear # Clear active configlink create
Create a symlink alias to mcp2cli.
mcp2cli link create --name <NAME> [--dir <PATH>]| Flag | Required | Description |
|---|---|---|
--name <NAME> | ✅ | Alias name (also the symlink filename) |
--dir <PATH> | Directory for the symlink (default: next to binary) |
Reserved names: mcp2cli, config, link, use, daemon.
daemon
Manage background daemon processes.
mcp2cli daemon start <CONFIG_NAME> # Start daemon for configmcp2cli daemon stop <CONFIG_NAME> # Stop running daemonmcp2cli daemon status [CONFIG_NAME] # Check daemon statusDiscovery Commands
ls
List server capabilities.
<alias> ls [--tools] [--resources] [--prompts] [--filter <PATTERN>]| Flag | Description |
|---|---|
--tools | Show only tools |
--resources | Show only resources |
--prompts | Show only prompts |
--filter <PATTERN> | Filter results by name substring |
inspect
Dump full server capabilities, metadata, and negotiated protocol info.
<alias> inspectdoctor
Run runtime health diagnostics.
<alias> doctorChecks: transport connection, server info, auth state, cached capabilities.
ping
Server liveness check with latency measurement.
<alias> pingTool Commands
Dynamic (auto-generated)
Server tools become commands with flags from JSON Schema:
<alias> <tool-name> [--flag <value>]...Examples:
work echo --message hello # String flagwork add --a 5 --b 3 # Integer flagswork deploy --tags '["a","b"]' # Array flag (JSON)work process --include-metadata # Boolean flagwork build --config '{"opt": true}' # JSON flagStatic Bridge Fallback
<alias> tool list<alias> tool call --name <TOOL_NAME> [--arg <KEY=VALUE>]... [--args-file <PATH>] [--args-json <JSON>] [--background]Resource Commands
Read a Resource
<alias> get <URI><alias> <resource-verb> <URI> # If profile.resource_verb is setResource Templates (auto-generated)
<alias> <template-name> [--param <value>]...<alias> <template-name> <positional> # Single-param templatesStatic Bridge Fallback
<alias> resource list<alias> resource read --uri <URI>Subscriptions
<alias> subscribe <URI><alias> unsubscribe <URI>Prompt Commands
Dynamic (auto-generated)
<alias> <prompt-name> [--arg <value>]...Static Bridge Fallback
<alias> prompt list<alias> prompt run --name <PROMPT_NAME> [--arg <KEY=VALUE>]...Auth Commands
<alias> auth login # Interactive token prompt<alias> auth logout # Clear stored credentials<alias> auth status # Show current auth stateJob Commands
<alias> jobs list # List all background jobs<alias> jobs show <JOB_ID> # Show job details<alias> jobs show --latest # Show most recent job<alias> jobs wait <JOB_ID> # Block until job completes<alias> jobs wait --latest # Wait for most recent job<alias> jobs cancel <JOB_ID> # Cancel a running job<alias> jobs cancel --latest # Cancel most recent job<alias> jobs watch <JOB_ID> # Stream job progress events<alias> jobs watch --latest # Watch most recent jobLogging Command
<alias> log <LEVEL>| Level | Description |
|---|---|
trace | Most verbose |
debug | Debug messages |
info | Informational |
warn | Warnings |
error | Errors only |
Completion Command
<alias> complete <REF_TYPE> <REF_NAME> <ARG_NAME> [CURRENT_VALUE]Requests tab-completion values from the server.
| Argument | Description |
|---|---|
<REF_TYPE> | Reference type: ref/prompt, ref/resource |
<REF_NAME> | Name of the prompt or resource |
<ARG_NAME> | Argument name to complete |
[CURRENT_VALUE] | Current partial input for filtering |
Argument Input Methods
Multiple sources for tool arguments, merged in order (later wins):
# From file<alias> tool-name --args-file ./payload.json
# From JSON string<alias> tool-name --args-json '{"key": "value"}'
# From flags<alias> tool-name --key value
# Combined (merged, flags override)<alias> tool-name --args-file base.json --args-json '{"override": true}' --key final-valueEnvironment Variables
| Variable | Description |
|---|---|
MCP2CLI_CONFIG_DIR | Override config directory |
MCP2CLI_DATA_DIR | Override data directory |
MCP2CLI_LOGGING__LEVEL | Override log level |
MCP2CLI_LOGGING__FORMAT | Override log format |
MCP2CLI_SERVER__ENDPOINT | Override server endpoint |
MCP2CLI_SERVER__TRANSPORT | Override transport type |
MCP2CLI_DEFAULTS__OUTPUT | Override default output format |
MCP2CLI_DEFAULTS__TIMEOUT_SECONDS | Override default timeout |
Pattern: MCP2CLI_ prefix + config path with __ as separator.
See Also
- Configuration Reference — full YAML schema
- Getting Started — quick start
- Discovery-Driven CLI — how dynamic commands work