This document contains the help content for the pctx command-line program.
Command Overview:
pctx↴pctx start↴pctx mcp↴pctx mcp init↴pctx mcp list↴pctx mcp add↴pctx mcp remove↴pctx mcp start↴pctx mcp dev↴
Use PCTX to expose code mode either as a session based server or by aggregating multiple MCP servers into a single code mode MCP server.
Usage: pctx [OPTIONS] <COMMAND>
EXAMPLES:
pctx start
pctx mcp init pctx mcp add my-server https://mcp.example.com pctx mcp dev
start— Start PCTX server for code mode sessionsmcp— MCP server commands (with pctx.json configuration)
-
-c,--config <CONFIG>— Config file path, defaults to ./pctx.jsonDefault value:
pctx.json -
-q,--quiet— No logging except for errors -
-v,--verbose— Verbose logging (-v) or trace logging (-vv)
Starts PCTX server with no pre-configured tools. Use a client library like pip install pctx-client to create sessions, register tools, and expose code-mode tools to agent libraries.
Usage: pctx start [OPTIONS]
-
-p,--port <PORT>— Port to listen onDefault value:
8080 -
--host <HOST>— Host address to bind to (use 0.0.0.0 for external access)Default value:
127.0.0.1 -
--session-dir <SESSION_DIR>— Path to session storage directoryDefault value:
.pctx/sessions -
--allowed-origin <ALLOWED_ORIGINS>— Allowed CORS origins. Can be specified multiple times. Defaults to localhost only (http://localhost, http://127.0.0.1, http://[::1]). Specify your own origins to override the default (can include or exclude localhost). Origins without explicit ports will match any port. Example: --allowed-origin http://localhost --allowed-origin https://app.example.com -
--no-banner— Don't show the server banner
MCP server commands (with pctx.json configuration)
Usage: pctx mcp <COMMAND>
init— Initialize pctx.json configuration filelist— List MCP servers and test connectionsadd— Add an MCP server to configuration (HTTP or stdio)remove— Remove an MCP server from configurationstart— Start the PCTX MCP serverdev— Start the PCTX MCP server with terminal UI
Initialize pctx.json configuration file.
Usage: pctx mcp init [OPTIONS]
-y,--yes— Use default values and skip interactive adding of upstream MCPs
Lists configured MCP servers and tests the connection to each.
Usage: pctx mcp list
Add a new MCP server to the configuration. Supports both HTTP(S) URLs and stdio-based servers via the --command flag.
Usage: pctx mcp add [OPTIONS] <NAME> [URL]
<NAME>— Unique name for this server<URL>— HTTP(S) URL of the MCP server endpoint (conflicts with --command for stdio)
-
--command <COMMAND>— Command to execute for stdio MCP server (conflicts with url) -
--arg <ARGS>— Arguments to pass to the stdio command (repeat for multiple) -
--env <ENV>— Environment variables in KEY=VALUE format (repeat for multiple) -
-b,--bearer <BEARER>— use bearer authentication to connect to HTTP MCP server using PCTX's secret string syntax.e.g.
--bearer '${env:BEARER_TOKEN}' -
-H,--header <HEADER>— use custom headers to connect to HTTP MCP server using PCTX's secret string syntax. Many headers can be defined.e.g.
--headers 'x-api-key: ${keychain:API_KEY}' -
-f,--force— Overrides any existing server under the same name & skips testing connection to the MCP server
Remove an MCP server from the configuration.
Usage: pctx mcp remove <NAME>
<NAME>— Name of the server to remove
Start the PCTX MCP server (exposes /mcp endpoint).
Usage: pctx mcp start [OPTIONS]
-
-p,--port <PORT>— Port to listen onDefault value:
8080 -
--host <HOST>— Host address to bind to (use 0.0.0.0 for external access)Default value:
127.0.0.1 -
--no-banner— Don't show the server banner -
--stdio— Serve MCP over stdio instead of HTTP -
--stateful-http— Use stateful MCP sessions (incompatible with --stdio)
Start the PCTX MCP server in development mode with an interactive terminal UI with data and logging.
Usage: pctx mcp dev [OPTIONS]
-
-p,--port <PORT>— Port to listen onDefault value:
8080 -
--host <HOST>— Host address to bind to (use 0.0.0.0 for external access)Default value:
127.0.0.1 -
--log-file <LOG_FILE>— Path to JSONL log fileDefault value:
pctx-dev.jsonl -
--stdio— Serve MCP over stdio instead of HTTP -
--stateful-http— Use stateful HTTP sessions (incompatible with --stdio)
This document was generated automatically by
clap-markdown.