Skip to content
Star -

User Configuration Schema

Related Topics: Configuration (configuration guide) | Authentication (OAuth setup) | Site Configuration (project config)

This reference documents the complete YAML schema for the user configuration file at ~/.mxcp/config.yml.

mxcp: 1
projects:
my-analytics:
profiles:
default:
secrets:
- name: db_credentials
type: database
parameters:
host: localhost
port: 5432
database: analytics
username: app_user
password: "vault://secret/db#password"
- name: api_key
type: api
parameters:
api_key: "${MY_API_KEY}"
auth:
provider: github
github:
client_id: "${GITHUB_CLIENT_ID}"
client_secret: "${GITHUB_CLIENT_SECRET}"
callback_path: /auth/github/callback
auth_url: https://github.com/login/oauth/authorize
token_url: https://github.com/login/oauth/access_token
scope: "read:user user:email"
persistence:
type: sqlite
path: ~/.mxcp/oauth.db
production:
secrets:
- name: db_credentials
type: database
parameters:
host: prod-db.example.com
port: 5432
database: analytics_prod
username: "vault://secret/prod#username"
password: "vault://secret/prod#password"
vault:
enabled: true
address: https://vault.example.com
token_env: VAULT_TOKEN
onepassword:
enabled: true
token_env: OP_SERVICE_ACCOUNT_TOKEN
transport:
provider: streamable-http
http:
host: 0.0.0.0
port: 8000
stateless: false
logging:
enabled: true
level: INFO
FieldTypeRequiredDefaultDescription
mxcpintegerYes-Schema version. Must be 1.
projectsobjectNo-Project-specific configurations.
vaultobjectNo-HashiCorp Vault global settings.
onepasswordobjectNo-1Password global settings.
modelsobjectNo-LLM model configurations.
transportobjectNo-Transport layer settings.
loggingobjectNo-Logging configuration.

Note: The mxcp field accepts both integer (1) and string ("1") values - strings are automatically coerced to integers.

Define settings for specific projects, matched by the project field in mxcp-site.yml.

projects:
project-name: # Must match project name in mxcp-site.yml
profiles:
profile-name: # Must match profile name
secrets: [...]
auth: {...}
FieldTypeDescription
secretsarraySecret definitions for this profile.
pluginobjectPlugin configuration for this profile.
authobjectAuthentication configuration.
telemetryobjectOpenTelemetry configuration for this profile.

Define secret values that can be used in endpoints.

secrets:
- name: my_secret # Secret name (must match mxcp-site.yml)
type: database # Secret type
parameters: # Type-specific parameters
host: localhost
password: "vault://secret/db#password"
FieldTypeRequiredDescription
namestringYesSecret identifier (matches secrets in site config).
typestringYesSecret type: database, api, custom, env.
parametersobjectNoType-specific parameters.
- name: db_credentials
type: database
parameters:
host: localhost
port: 5432
database: mydb
username: app_user
password: "${DB_PASSWORD}"
ParameterTypeDescription
hoststringDatabase hostname.
portintegerDatabase port.
databasestringDatabase name.
usernamestringDatabase username.
passwordstringDatabase password.
- name: api_credentials
type: api
parameters:
api_key: "${API_KEY}"
api_secret: "vault://secret/api#secret"
base_url: https://api.example.com
ParameterTypeDescription
api_keystringAPI key.
api_secretstringAPI secret (optional).
base_urlstringAPI base URL (optional).
- name: simple_key
type: env
key: MY_ENV_VAR # Environment variable name
- name: custom_config
type: custom
parameters:
key1: value1
key2: "vault://secret/custom#key2"
nested:
key3: value3

Secret values can come from multiple sources:

SourceFormatExample
LiteralPlain string"my-secret-value"
Environment${VAR_NAME}"${API_KEY}"
Vaultvault://path#key"vault://secret/db#password"
1Passwordop://vault/item/field"op://Private/DB/password"
Filefile://path"file:///etc/ssl/cert.pem"

Read secret values from local files using file:// URLs:

secrets:
- name: ssl_certificates
type: custom
parameters:
cert: "file:///etc/ssl/certs/server.crt"
key: "file:///etc/ssl/private/server.key"
- name: api_config
type: api
parameters:
api_key: "file://secrets/api_key.txt" # Relative path

File URL Format:

  • Absolute paths: file:///absolute/path/to/file
  • Relative paths: file://relative/path/to/file (relative to current working directory)

Important Notes:

  • File content is read when the configuration is loaded
  • Whitespace (including newlines) is automatically stripped
  • The file must exist and be readable when the configuration is loaded
  • Relative paths are resolved from the current working directory, not the config file location
  • Use appropriate file permissions to protect sensitive files
from mxcp.runtime import config
# Get database credentials (returns dict with parameters, or None if not found)
db_creds = config.get_secret("db_credentials")
if db_creds:
connection_string = f"postgresql://{db_creds['username']}:{db_creds['password']}@{db_creds['host']}:{db_creds['port']}/{db_creds['database']}"
# Get API key
api_creds = config.get_secret("api_key")
if api_creds:
api_key = api_creds.get("api_key")

Configure OAuth authentication for the MCP server.

auth:
provider: github # Required: Provider name
github: # Provider-specific config
client_id: "${GITHUB_CLIENT_ID}"
client_secret: "${GITHUB_CLIENT_SECRET}"
callback_path: /auth/github/callback
auth_url: https://github.com/login/oauth/authorize
token_url: https://github.com/login/oauth/access_token
scope: "read:user user:email"
persistence: # Optional: Token storage
type: sqlite
path: ~/.mxcp/oauth.db
authorization: # Optional: Scope requirements
required_scopes:
- "mxcp:access"
clients: # Optional: Pre-configured clients
- client_id: my-app
name: "My Application"
redirect_uris:
- "https://myapp.com/callback"
FieldTypeDefaultDescription
providerstring"none"OAuth provider: none, github, google, atlassian, salesforce, keycloak.
<provider>object-Provider-specific configuration (required when provider is not none).
persistenceobject-Token persistence settings. Auto-created when provider is not none.
authorizationobject-Authorization requirements.
clientsarray-Pre-configured OAuth clients.

Note: When provider is set to anything other than none, persistence is automatically configured with SQLite at ~/.mxcp/oauth.db if not explicitly specified.

auth:
provider: github
github:
client_id: Ov23li...
client_secret: "${GITHUB_CLIENT_SECRET}"
callback_path: /callback
auth_url: https://github.com/login/oauth/authorize
token_url: https://github.com/login/oauth/access_token
scope: "read:user user:email read:org"
FieldTypeRequiredDescription
client_idstringYesGitHub OAuth App client ID.
client_secretstringYesGitHub OAuth App client secret.
callback_pathstringYesOAuth callback path (e.g., /callback).
auth_urlstringYesAuthorization URL (e.g., https://github.com/login/oauth/authorize).
token_urlstringYesToken URL (e.g., https://github.com/login/oauth/access_token).
scopestringNoOAuth scopes (space-separated).
auth:
provider: google
google:
client_id: xxx.apps.googleusercontent.com
client_secret: "${GOOGLE_CLIENT_SECRET}"
callback_path: /callback
auth_url: https://accounts.google.com/o/oauth2/v2/auth
token_url: https://oauth2.googleapis.com/token
scope: "openid email profile"
auth:
provider: atlassian
atlassian:
client_id: your_client_id
client_secret: "${ATLASSIAN_SECRET}"
callback_path: /callback
auth_url: https://auth.atlassian.com/authorize
token_url: https://auth.atlassian.com/oauth/token
scope: "read:me read:jira-work"
auth:
provider: salesforce
salesforce:
client_id: your_consumer_key
client_secret: "${SALESFORCE_SECRET}"
callback_path: /callback
auth_url: https://login.salesforce.com/services/oauth2/authorize
token_url: https://login.salesforce.com/services/oauth2/token
scope: "openid profile email api"

For sandbox environments:

auth_url: https://test.salesforce.com/services/oauth2/authorize
token_url: https://test.salesforce.com/services/oauth2/token
auth:
provider: keycloak
keycloak:
client_id: mxcp-server
client_secret: "${KEYCLOAK_SECRET}"
callback_path: /callback
realm: myrealm
server_url: https://keycloak.example.com
scope: "openid profile email"
FieldTypeRequiredDescription
client_idstringYesKeycloak client ID.
client_secretstringYesKeycloak client secret.
callback_pathstringYesOAuth callback path.
realmstringYesKeycloak realm name.
server_urlstringYesKeycloak server URL.
scopestringNoOAuth scopes.

Store OAuth tokens for session continuity:

persistence:
type: sqlite
path: ~/.mxcp/oauth.db
FieldTypeDefaultDescription
typestring"sqlite"Storage type: sqlite.
pathstring~/.mxcp/oauth.dbDatabase file path.

Require specific scopes for access:

authorization:
required_scopes:
- "mxcp:access"
- "mxcp:admin"

Define static OAuth clients:

clients:
- client_id: my-app
client_secret: "${MY_APP_SECRET}"
name: "My Application"
redirect_uris:
- "https://myapp.com/callback"
- "http://localhost:3000/callback"
grant_types:
- "authorization_code"
scopes:
- "mxcp:access"
FieldTypeRequiredDescription
client_idstringYesUnique client identifier.
client_secretstringNoClient secret (for confidential clients).
namestringYesHuman-readable name.
redirect_urisarrayNoAllowed redirect URIs.
grant_typesarrayNoAllowed grant types.
scopesarrayNoAllowed scopes.

Global HashiCorp Vault settings for resolving vault:// references in secrets.

vault:
enabled: true
address: https://vault.example.com
token_env: VAULT_TOKEN
FieldTypeDefaultDescription
enabledbooleanfalseWhether Vault integration is enabled.
addressstring-Vault server URL.
token_envstring-Environment variable name containing the Vault token.
Terminal window
pip install "mxcp[vault]"
# or
pip install hvac

vault://path/to/secret#key

  • path/to/secret: The path to the secret in Vault
  • key: The specific key within that secret

Supported Secret Engines:

  • KV Secrets Engine v2 (default)
  • KV Secrets Engine v1 (fallback)

Set the Vault token in your environment:

Terminal window
export VAULT_TOKEN="your-vault-token"

Then reference Vault secrets in your configuration:

secrets:
- name: db_credentials
type: database
parameters:
password: "vault://secret/db#password"

Global 1Password settings for resolving op:// references in secrets.

onepassword:
enabled: true
token_env: OP_SERVICE_ACCOUNT_TOKEN
FieldTypeDefaultDescription
enabledbooleanfalseWhether 1Password integration is enabled.
token_envstring-Environment variable name containing the 1Password service account token.
Terminal window
pip install "mxcp[onepassword]"
# or
pip install onepassword-sdk

op://vault/item/field[?attribute=otp]

  • vault: The name or ID of the vault in 1Password
  • item: The name or ID of the item in 1Password
  • field: The name or ID of the field within the item
  • ?attribute=otp: Optional parameter to retrieve TOTP/OTP value

Examples:

  • Basic field: op://Private/Login Item/username
  • Password field: op://Private/Login Item/password
  • TOTP/OTP: op://Private/Login Item/totp?attribute=otp
  • Using vault ID: op://hfnjvi6aymbsnfc2gshk5b6o5q/Login Item/password
  • Using item ID: op://Private/j5hbqmr7nz3uqsw3j5qam2fgji/password

Set the 1Password service account token in your environment:

Terminal window
export OP_SERVICE_ACCOUNT_TOKEN="your-service-account-token"

Then reference 1Password secrets in your configuration:

secrets:
- name: db_credentials
type: database
parameters:
password: "op://Private/Database/password"

Configure LLM providers for AI-powered features.

models:
default: claude
models:
claude:
type: claude
api_key: "${ANTHROPIC_API_KEY}"
timeout: 30
max_retries: 3
openai:
type: openai
api_key: "${OPENAI_API_KEY}"
base_url: https://api.openai.com/v1
FieldTypeRequiredDescription
defaultstringNoDefault model identifier.
modelsobjectNoNamed model configurations.
FieldTypeRequiredDescription
typestringYesModel type: claude or openai.
api_keystringNoAPI key for the model provider.
base_urlstringNoCustom API base URL.
timeoutintegerNoRequest timeout in seconds.
max_retriesintegerNoMaximum retry attempts.

Configure MCP transport settings.

transport:
provider: streamable-http
http:
host: 0.0.0.0
port: 8000
scheme: http
stateless: false
trust_proxy: false
FieldTypeDefaultDescription
providerstring"streamable-http"Transport provider: streamable-http, sse, stdio.
httpobject-HTTP transport settings (see below).
FieldTypeDefaultDescription
hoststring"localhost"Bind address.
portinteger8000Listen port.
schemestring"http"URL scheme: http or https.
base_urlstring-Custom base URL (overrides host/port/scheme).
statelessbooleanfalseStateless mode (no sessions).
trust_proxybooleanfalseTrust proxy headers for client IP.

Configure file-based logging behavior.

logging:
enabled: true
path: ~/.mxcp/logs/mxcp.log
level: INFO
max_bytes: 10485760
backup_count: 5
FieldTypeDefaultDescription
enabledbooleantrueWhether file logging is enabled.
pathstring-Log file path. If not set, logs to stderr only.
levelstring"WARNING"Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL.
max_bytesinteger10485760Maximum log file size in bytes (10 MB default).
backup_countinteger5Number of backup log files to keep.

Configure OpenTelemetry for tracing and metrics. This is configured per-profile.

projects:
my-project:
profiles:
default:
telemetry:
enabled: true
endpoint: https://otel-collector.example.com:4318
service_name: mxcp-server
service_version: "1.0.0"
environment: production
headers:
Authorization: "Bearer ${OTEL_TOKEN}"
tracing:
enabled: true
console_export: false
metrics:
enabled: true
export_interval: 60
FieldTypeDefaultDescription
enabledbooleanfalseWhether telemetry is enabled.
endpointstring-OpenTelemetry collector endpoint.
headersobject-Headers to send with telemetry requests.
service_namestring-Service name for telemetry data.
service_versionstring-Service version for telemetry data.
environmentstring-Environment name (e.g., production, staging).
resource_attributesobject-Additional resource attributes.
tracingobject-Tracing configuration (see below).
metricsobject-Metrics configuration (see below).
FieldTypeDefaultDescription
enabledbooleanfalseWhether tracing is enabled.
console_exportbooleanfalseExport traces to console (for debugging).
FieldTypeDefaultDescription
enabledbooleanfalseWhether metrics are enabled.
export_intervalinteger60Metrics export interval in seconds.

Use environment variables anywhere in the configuration with ${VAR_NAME} syntax:

secrets:
- name: api_key
type: api
parameters:
api_key: "${API_KEY}"
base_url: "${API_URL}"
VariableDescription
MXCP_CONFIGPath to user config file (default: ~/.mxcp/config.yml)
MXCP_PROFILEOverride the active profile
MXCP_DUCKDB_PATHOverride DuckDB database path
MXCP_AUDIT_ENABLEDOverride audit logging (true/false, 1/0, yes/no)
MXCP_DEBUGEnable debug logging
MXCP_READONLYEnable read-only mode
MXCP_DISABLE_ANALYTICSDisable analytics (set to 1, true, or yes)
MXCP_ADMIN_ENABLEDEnable local admin control socket
MXCP_ADMIN_SOCKETPath to admin socket (default: /run/mxcp/mxcp.sock)
VariableDescription
MXCP_TELEMETRY_ENABLEDEnable OpenTelemetry
MXCP_TELEMETRY_TRACING_CONSOLEExport traces to console
MXCP_TELEMETRY_METRICS_INTERVALMetrics export interval in seconds
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry collector endpoint
OTEL_SERVICE_NAMEService name for telemetry
OTEL_RESOURCE_ATTRIBUTESAdditional resource attributes
OTEL_EXPORTER_OTLP_HEADERSHeaders for OTLP exporter

For long-running MCP servers, you can reload external configuration values without restarting:

Terminal window
# Send SIGHUP signal to reload external values
kill -HUP <pid>

What gets refreshed:

  • ✅ Vault secrets (vault://)
  • ✅ File contents (file://)
  • ✅ Environment variables (${VAR})
  • ✅ DuckDB connection (recreated to pick up database changes)
  • ✅ Python runtimes with updated configs

What does NOT change:

  • ❌ Configuration file structure
  • ❌ OAuth provider settings
  • ❌ Server host/port settings
  • ❌ Registered endpoints

The reload process waits up to 60 seconds synchronously. If new values cause errors, the server continues with old values.

The user configuration file is located at:

PlatformPath
Linux/macOS~/.mxcp/config.yml
Windows%USERPROFILE%\.mxcp\config.yml

Create the directory if it doesn’t exist:

Terminal window
mkdir -p ~/.mxcp

Test your configuration:

Terminal window
# Validate all configuration
mxcp validate
# Test with specific profile
mxcp serve --profile production
  1. Never commit secrets - Use environment variables or secret managers
  2. Set file permissions - chmod 600 ~/.mxcp/config.yml
  3. Use secret managers - Prefer Vault or 1Password over environment variables
  4. Rotate secrets - Regularly rotate OAuth client secrets and API keys
  5. Limit scopes - Request only necessary OAuth scopes