COMMAND LINE INTERFACE / V0.1.0
OFFICIAL CLIControl the bridge
from your terminal.
The CodeMCP CLI boots an intelligent, sandboxed MCP server in milliseconds. Run it where your code lives, configure boundaries with simple flags, and let your AI client connect with zero configuration.
INTERACTIVE EXPLORER
Explore Common CLI Commands
Click any command below to preview its syntax, options, and simulated terminal execution.
FULL SPECIFICATION
Flags & Options Reference
Complete list of command-line arguments accepted by the codemcp binary.
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--project, -p <path> | string | "." | Relative or absolute path to the project root directory exposed to MCP clients. |
--mode, -m <mode> | string | "approval" | Operational security mode: read-only (no writes), approval (prompt before changes), or automated. |
--port <number> | number | 4173 | Port used when listening for Server-Sent Events (SSE) / HTTP connections. |
--tunnel | boolean | false | Spins up an encrypted HTTPS tunnel, returning a public URL for web assistants like Claude.ai. |
--allow-exec | boolean | false | Enables the execute_command tool, allowing the AI to invoke tests and scripts. |
--config, -c <file> | string | "codemcp.json" | Path to a custom configuration file defining boundaries and whitelisted commands. |
--verbose, -v | boolean | false | Outputs raw JSON-RPC protocol frames and tool request payloads to stderr for debugging. |
--help, -h | boolean | false | Displays the CLI usage manual, option flags, and version summary. |
--version | boolean | false | Outputs current installed CodeMCP package version and exits. |
ENVIRONMENT VARIABLES
Configuration via Environment
Override flags in automated CI/CD runners, containerized setups, or systemd services.
| Variable | Default | Description |
|---|---|---|
CODEMCP_PROJECT_PATH | "." | Overrides target project root directory. |
CODEMCP_MODE | "approval" | Sets permission mode: read-only | approval | automated. |
CODEMCP_PORT | 4173 | Sets port for HTTP and SSE endpoints. |
CODEMCP_TUNNEL_TOKEN | "" | Custom Cloudflare tunnel or ngrok auth token for dedicated domains. |
CODEMCP_LOG_LEVEL | "info" | Log verbosity level: silent, info, or debug. |
PRODUCTION RECIPES
Common Deployment Patterns
Daily Development in Cursor or Claude
Standard interactive workflow. Approvals are prompted directly in your terminal before any file write occurs.
Auditing Untrusted Pull Requests
Enforce strict read-only guarantees. The AI can analyze logic and find bugs without any ability to alter files or run commands.
Pairing with Web Assistants (Claude.ai)
Exposes a temporary, encrypted TLS tunnel URL that can be plugged into browser-based AI chats.
Monorepos with Specific Sub-Packages
Scope the assistant strictly to a sub-package (e.g. packages/api) so it never touches unintended modules.