Back to product

COMMAND LINE INTERFACE / V0.1.0

OFFICIAL CLI

Control 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.

Quick Launch:
$npx codemcp

INTERACTIVE EXPLORER

Explore Common CLI Commands

Click any command below to preview its syntax, options, and simulated terminal execution.

bash — npx codemcp
Ready on stdio / SSE
$ npx codemcp
[mcp] CodeMCP Server v1.1.4 initialized
[mcp] Root: C:\Users\azure\Documents\projects\CodeMCP
[mcp] Config: codemcp.json (loaded)
[mcp] Mode: approval (Prompting before writes/commands)
[mcp] Transport: stdio active, SSE available at http://localhost:4173/mcp
✓ Ready for AI client connections...
$
Exit code: 0Active transport: stdio / SSE

FULL SPECIFICATION

Flags & Options Reference

Complete list of command-line arguments accepted by the codemcp binary.

Flag / OptionTypeDefaultDescription
--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>number4173Port used when listening for Server-Sent Events (SSE) / HTTP connections.
--tunnelbooleanfalseSpins up an encrypted HTTPS tunnel, returning a public URL for web assistants like Claude.ai.
--allow-execbooleanfalseEnables 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, -vbooleanfalseOutputs raw JSON-RPC protocol frames and tool request payloads to stderr for debugging.
--help, -hbooleanfalseDisplays the CLI usage manual, option flags, and version summary.
--versionbooleanfalseOutputs current installed CodeMCP package version and exits.

ENVIRONMENT VARIABLES

Configuration via Environment

Override flags in automated CI/CD runners, containerized setups, or systemd services.

VariableDefaultDescription
CODEMCP_PROJECT_PATH"."Overrides target project root directory.
CODEMCP_MODE"approval"Sets permission mode: read-only | approval | automated.
CODEMCP_PORT4173Sets 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

WORKFLOW 1

Daily Development in Cursor or Claude

Standard interactive workflow. Approvals are prompted directly in your terminal before any file write occurs.

npx codemcp
WORKFLOW 2

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.

npx codemcp --mode read-only
WORKFLOW 3

Pairing with Web Assistants (Claude.ai)

Exposes a temporary, encrypted TLS tunnel URL that can be plugged into browser-based AI chats.

npx codemcp --tunnel
WORKFLOW 4

Monorepos with Specific Sub-Packages

Scope the assistant strictly to a sub-package (e.g. packages/api) so it never touches unintended modules.

npx codemcp -p ./packages/api