Option C Tools
Loading...
Searching...
No Matches
oct.mcp.__main__ Namespace Reference

Functions

argparse.Namespace _parse_args (list[str]|None argv=None)
None main (list[str]|None argv=None)

Detailed Description

Entry point for ``python -m oct.mcp``.

Usage
-----
    python -m oct.mcp [--project-root PATH] [--profile PROFILE]
                      [--transport {stdio,sse}] [--host HOST] [--port PORT]
                      [--metrics-port PORT]

Options
-------
--project-root PATH
    Absolute or relative path to the Option C project root.
    Defaults to auto-discovery from the current working directory.

--profile PROFILE
    MCP security profile: ``default``, ``strict``, or ``airgapped``.
    Overrides ``OCT_MCP_PROFILE`` and the config file value.

--config PATH
    Path to the user-level config file.
    Defaults to ``~/.oct-mcp/config.json``.

--transport {stdio,sse}
    MCP transport. ``stdio`` (default) for local AI host integration
    (Claude Code, Cursor, VS Code). ``sse`` for HTTP/SSE remote access.

--host HOST
    Bind host for SSE transport (default: ``127.0.0.1``).
    Only used with ``--transport sse``. Use ``0.0.0.0`` with caution
    and only behind a reverse proxy with TLS and authentication.

--port PORT
    Bind port for SSE transport (default: ``3001``).
    Only used with ``--transport sse``.

--metrics-port PORT
    Start a Prometheus ``/metrics`` HTTP server on this port.
    Disabled by default. Requires ``oct[metrics]`` to be installed.

Environment variables
---------------------
OCT_MCP_SAFE_MODE=1        Block all tool calls (emergency kill-switch).
OCT_TRUST_REPO_CONFIG=1    Trust project-level config (debug_config.json).
OCT_MCP_PROFILE=<name>     Override active profile.
OCT_MCP_SANDBOX=<name>     Override sandbox backend (auto/native/bubblewrap/sandbox_exec).

Function Documentation

◆ _parse_args()

argparse.Namespace oct.mcp.__main__._parse_args ( list[str] | None argv = None)
protected

Definition at line 60 of file __main__.py.

Here is the caller graph for this function:

◆ main()

None oct.mcp.__main__.main ( list[str] | None argv = None)
Parse CLI arguments and start the MCP server.

Definition at line 119 of file __main__.py.

Here is the call graph for this function:
Here is the caller graph for this function: