MCP Environment Variables -- Axon

July 16, 2026 ยท View on GitHub

Environment variables specific to the Axon MCP server. The MCP server inherits all Axon stack variables (Qdrant, TEI, LLM). This page covers MCP-specific configuration.

MCP server

VariableRequiredDefaultDescriptionSensitive
AXON_HTTP_HOSTno127.0.0.1Bind address for HTTP transport; non-loopback requires AXON_HTTP_TOKENno
AXON_HTTP_PORTno8001Listen port for HTTP transportno
AXON_HTTP_TOKENnounsetBearer or x-api-key token for MCP HTTP requests; required for non-loopback bindsyes
AXON_AUTH_MODEnobearerSet to oauth to enable lab-auth Google OAuth/JWT modeno
AXON_PUBLIC_URLoauth--Public origin used in OAuth metadata and protected-resource responsesno
AXON_GOOGLE_CLIENT_IDoauth--Google OAuth client IDyes
AXON_GOOGLE_CLIENT_SECREToauth--Google OAuth client secretyes
AXON_AUTH_ADMIN_EMAILoauth--Admin email accepted by the auth layer; receives full Axon OAuth scopesyes
AXON_ALLOWED_REDIRECT_URISnoClaude callback includedAdditional comma-separated OAuth redirect URIsno
AXON_ALLOWED_ORIGINSno--Comma-separated allowed origins for MCP HTTP CORS (unset = strict default: only same-origin/loopback browser requests pass; non-browser tools unaffected)no
AXON_MCP_ARTIFACT_DIRno$AXON_DATA_DIR/artifacts (default ~/.axon/artifacts)Directory for response artifactsno
AXON_INLINE_BYTES_THRESHOLDno8192Auto-inline payload size threshold (bytes); set to 0 to disableno
AXON_TASK_RESULT_WAIT_TIMEOUT_SECSno300Max seconds an MCP tasks/result request waits for terminal task stateno
AXON_MCP_EMBED_ALLOWED_ROOTSno--Comma-separated local filesystem roots allowed for MCP source indexing (unset = local filesystem source indexing disabled over MCP)no
AXON_MCP_EMBED_MAX_LOCAL_BYTESno10485760Max bytes per local file accepted by MCP source indexingno
AXON_MCP_EMBED_MAX_LOCAL_DEPTHno16Max directory traversal depth for MCP local-directory source indexingno
AXON_MCP_EMBED_MAX_LOCAL_ENTRIESno10000Max filesystem entries visited for MCP local-directory source indexingno

Local execution (no CLI server mode)

CLI and MCP commands always run in-process โ€” locally against Qdrant and TEI. There is no client-to-server forwarding, so AXON_SERVER_URL, AXON_LOCAL_MODE / --local, and AXON_SERVER_INSECURE were removed in 5.0.0. To expose Axon over HTTP for API clients, run axon serve (see SERVE.md).

Transport selection

VariableRequiredDefaultDescription
AXON_MCP_TRANSPORTnoper-commandstdio / http / both. Overrides the per-command default (axon mcp defaults to stdio; axon serve mcp defaults to http; axon serve to both).

Stack variables consumed by MCP

The MCP server reads existing Axon stack variables at startup:

VariablePurpose
QDRANT_URLVector search and retrieval
TEI_URLEmbedding generation
AXON_SYNTHESIS_HEADLESS_GEMINI_MODELModel override for Gemini synthesis completions
AXON_HEADLESS_GEMINI_MODELLegacy alias for AXON_SYNTHESIS_HEADLESS_GEMINI_MODEL
AXON_LLM_BACKENDLLM backend selector: gemini-headless (default) or openai-compat
AXON_OPENAI_BASE_URLOpenAI-compatible /v1 base URL when AXON_LLM_BACKEND=openai-compat
AXON_SYNTHESIS_OPENAI_MODELOpenAI-compatible synthesis model name
AXON_OPENAI_MODELLegacy alias for AXON_SYNTHESIS_OPENAI_MODEL
AXON_OPENAI_API_KEYOptional API key for OpenAI-compatible endpoints
TAVILY_API_KEYTavily fallback for web search and research when AXON_SEARXNG_URL is unset
AXON_COLLECTIONDefault Qdrant collection

Job runtime

The MCP server uses SQLite for job state and runs workers in-process when the hosting command creates a worker-enabled service context.

OperationAvailable
source, scrape, query, ask, searchYes
extractYes
watch schedulerYes for wired subcommands (create, list, exec, history)

Precedence

  1. CLI flags override environment variables
  2. Environment variables override ~/.axon/config.toml settings
  3. ~/.axon/config.toml overrides built-in defaults

See also