Search documentation

Search the Fumadocs-backed documentation index.

MCP servers

MCP servers a setup exposes to the agent.

mcp_servers exposes MCP servers to the agent for variants that use this setup. Use this field when the product surface or environment includes an MCP tool. name is visible to the agent, so use a product-like name, not an evaluation label. See Experiment design.

mcp_servers:
  - name: fixture-sentinel
    type: stdio
    command: /workspace/fixture-mcp.py
    args: []
  - name: ax
    type: http
    url: http://localhost:3001/mcp

MCP server object

An MCP server object defines one server and its transport. The required connection fields depend on type.

FieldRequiredType / valuesNotes
nameYesStringMust be unique within the setup's mcp_servers.
typeYesstdio, http, or sseTransport.
commandFor stdioStringExecutable path or command inside the sandbox.
argsNoString listStdio command arguments.
urlFor http / sseStringMCP endpoint URL.
envNoMCP stdio env entriesOnly valid for stdio.
headersNoMCP header entriesOnly valid for http / sse.

Transport-specific rules:

  • stdio uses command, optional args, and optional env.
  • http and sse use url and optional headers.
  • Mixing stdio-only and endpoint-only fields is rejected.

MCP stdio env entry

env forwards declared environment values to a stdio MCP process. Each entry is either a bare name or an object:

env:
  - GITHUB_TOKEN
  - name: GH_AUTH
    from: GITHUB_TOKEN
  # Managed model access for an LLM-backed MCP server (no raw provider key):
  - name: ANTHROPIC_API_KEY
    from: AXP_MODEL_PROXY_TOKEN
  - name: ANTHROPIC_BASE_URL
    from: AXP_MODEL_PROXY_URL
FieldRequiredType / valuesNotes
nameYesStringEnv var name as seen by the MCP server process.
fromYesEnv name or virtual refDeclared environment_variables name, or a managed-proxy virtual ref (AXP_MODEL_PROXY_TOKEN / AXP_MODEL_PROXY_URL).

AXP_MODEL_PROXY_TOKEN and AXP_MODEL_PROXY_URL are virtual references to the run's workload token and Anthropic-style proxy base URL. They resolve only when the run has managed model access (ax experiment run, or default ax experiment run --local / ax local run; not with --local-model-keys); without it they are dropped with a warning. They are not org secret-store slugs and are not bring-your-own-key configuration; see Model providers.

MCP HTTP and SSE header object

headers attaches HTTP headers to an http or sse MCP server. Use placeholders when a header needs a declared secret value.

headers:
  - name: Authorization
    value: "Bearer ${SUPABASE_SERVICE_ROLE_KEY}"
FieldRequiredType / valuesNotes
nameYesStringHTTP header name. Header names must be unique per server, case-insensitively.
valueYesStringMay contain ${SECRET_NAME} placeholders. Bare $NAME is literal.

MCP env entries and header placeholders reference environment variable names visible to the variant. Values can come from literal environment_variables, ax://secrets/<slug> references, or (stdio env only) the managed-proxy virtual refs AXP_MODEL_PROXY_TOKEN / AXP_MODEL_PROXY_URL.

Rules enforced at ax experiment validate time:

  • Every stdio env[*].from and every ${NAME} placeholder in a header value must reference a name visible to the variant, or (stdio env only) a managed-proxy virtual ref.
  • Bare $NAME is treated as a literal; only ${NAME} is a placeholder.
  • HTTP header names are unique per server, case-insensitively.
  • command / args / env are only valid for type: stdio; url / headers are only valid for type: http / sse.

Resolved secret values are written into the agent session frame and can appear in run artifacts. Treat artifacts as sensitive whenever an experiment forwards secrets to MCP servers.