Skip to content

Environment variables ​

Runtime knobs accepted by ctxo and the MCP server. All are optional.

Debug logging ​

ctxo uses the standard debug package. Every subsystem has a namespace under ctxo:*.

VariableExampleEffect
DEBUGctxo:*Enable every ctxo namespace
DEBUGctxo:git,ctxo:storageEnable a subset
DEBUGctxo:*,-ctxo:statsEnable all ctxo output except stats

Known namespaces ​

NamespaceSource
ctxo:config.ctxo/config.yaml loader
ctxo:doctorHealth checker
ctxo:gitsimple-git adapter
ctxo:httpHTTP transport (optional)
ctxo:plugin-discoveryScanning package.json for @ctxo/lang-* plugins
ctxo:plugin-loaderDynamic imports of discovered plugins
ctxo:searchBM25 and ranked-context search
ctxo:statsLocal MCP session recorder
ctxo:storageSQLite and JSON adapters

Never write to stdout

ctxo's MCP stdio transport uses stdout for JSON-RPC. Debug output goes to stderr, which is safe to read without corrupting the protocol.

MCP response size ​

VariableDefaultEffect
CTXO_RESPONSE_LIMIT8192Byte budget for a single MCP tool response. Responses above this threshold are truncated and flagged via the response envelope's _meta.truncated field

Invalid values (non-numeric, zero, negative) fall back to the default.

shell
# Give large tool responses more room at the cost of token usage.
CTXO_RESPONSE_LIMIT=16384 npx ctxo

Package manager override ​

VariableAccepted valuesEffect
CTXO_PMnpm, pnpm, yarn, bunForces ctxo install to use the given manager, overriding detection from packageManager, lockfile, and auto-detection
shell
CTXO_PM=pnpm npx ctxo install typescript go

HTTP transport (optional) ​

The default MCP transport is stdio. An HTTP transport is available for integrations that require it.

VariableDefaultEffect
CTXO_HTTP_PORTunsetWhen set, the MCP server listens on the given HTTP port instead of stdio
shell
CTXO_HTTP_PORT=3001 npx ctxo

CI detection ​

VariableEffect
CI=true or CI=1ctxo install refuses to mutate dependencies unless --force or --global is passed. ctxo doctor --fix requires --yes before applying remediation

Examples ​

shell
# Full visibility while debugging a flaky index run.
DEBUG=ctxo:* npx ctxo index
shell
# Narrow to plugin and storage subsystems.
DEBUG=ctxo:plugin-loader,ctxo:plugin-discovery,ctxo:storage npx ctxo index
shell
# Raise response budget for large Logic-Slice queries.
CTXO_RESPONSE_LIMIT=16384 DEBUG=ctxo:search npx ctxo

See also ​

Released under the MIT License.