Skip to content
Star -

Site Configuration Schema

Related Topics: Configuration (configuration guide) | dbt Integration (dbt setup) | Auditing (audit logs)

This reference documents the complete YAML schema for the mxcp-site.yml project configuration file.

mxcp: 1
project: my-analytics
profile: default
secrets:
- db_credentials
- api_key
extensions:
- httpfs
- parquet
- name: h3
repo: community
dbt:
enabled: true
model_paths: ["models"]
sql_tools:
enabled: false
paths:
tools: tools
resources: resources
prompts: prompts
python: python
sql: sql
profiles:
default:
duckdb:
path: ./data/app.duckdb
readonly: false
drift:
path: ./drift/snapshot.json
audit:
enabled: true
path: ./audit/logs.jsonl
production:
duckdb:
path: /data/prod.duckdb
readonly: true
audit:
enabled: true
path: /var/log/mxcp/audit.jsonl
FieldTypeRequiredDefaultDescription
mxcpintegerYes-Schema version. Must be 1.
projectstringYes-Project identifier. Used for matching user config.
profilestringYes-Active profile name. Must exist in profiles.
secretsarrayNo-List of secret names used by the project.
extensionsarrayNo-DuckDB extensions to load.
dbtobjectNo-dbt integration configuration.
sql_toolsobjectNo-Built-in SQL tools configuration.
pluginarrayNo-Plugin definitions.
pathsobjectNo-Custom directory paths.
profilesobjectNo-Profile-specific configurations.

Note: The mxcp field must be the integer 1. Unlike endpoint definitions (tools, resources, prompts), site config does not auto-coerce string values.

mxcp: 1
project: my-project # Unique project identifier
profile: default # Active profile (must exist in profiles section)

The project name is used to match secrets and authentication in the user configuration file (~/.mxcp/config.yml).

The profile specifies which profile configuration to use. Switch profiles via:

Terminal window
mxcp serve --profile production

The active profile is resolved in this order (highest to lowest priority):

  1. CLI argument (--profile) - explicit override for a single command
  2. Environment variable (MXCP_PROFILE) - session-level override
  3. Site config (profile field) - project default

List secret names that the project uses. Actual secret values are defined in the user configuration.

secrets:
- db_credentials # Database connection
- api_key # External API key
- oauth_secret # OAuth client secret

Secrets are accessed in Python endpoints:

from mxcp.runtime import config
# Returns dict with secret parameters, or None if not found
db_creds = config.get_secret("db_credentials")
if db_creds:
host = db_creds.get("host")
password = db_creds.get("password")

See User Configuration Schema for defining secret values.

Register custom plugins to extend MXCP functionality.

plugin:
- name: my_plugin
module: plugins.my_module
config: config/my_plugin.yml
- name: analytics
module: my_project.plugins.analytics
FieldTypeRequiredDescription
namestringYesPlugin identifier.
modulestringYesPython module path to the plugin.
configstringNoOptional path to plugin configuration file.

See Plugin Reference for complete plugin documentation.

DuckDB extensions to load automatically.

extensions:
- httpfs # HTTP file system
- parquet # Parquet file support
- json # JSON functions
- spatial # Geospatial functions
extensions:
- name: h3
repo: community
- name: postgres_scanner
repo: core_nightly
FieldTypeRequiredDescription
namestringYesExtension name.
repostringNoRepository: community or core_nightly.
ExtensionPurpose
httpfsRead files from HTTP/S3
parquetParquet file support
jsonJSON functions
spatialGeospatial functions
postgres_scannerQuery PostgreSQL
mysql_scannerQuery MySQL
sqlite_scannerQuery SQLite
excelRead Excel files
h3H3 geospatial indexing

Configure dbt integration for data transformation.

dbt:
enabled: true
model_paths: ["models"]
analysis_paths: ["analyses"]
test_paths: ["tests"]
seed_paths: ["seeds"]
macro_paths: ["macros"]
snapshot_paths: ["snapshots"]
target_path: "target"
clean_targets: ["target", "dbt_packages"]
FieldTypeDefaultDescription
enabledbooleantrueEnable dbt integration.
model_pathsarray["models"]dbt model directories.
analysis_pathsarray["analyses"]dbt analysis directories.
test_pathsarray["tests"]dbt test directories.
seed_pathsarray["seeds"]dbt seed directories.
macro_pathsarray["macros"]dbt macro directories.
snapshot_pathsarray["snapshots"]dbt snapshot directories.
target_pathstring"target"dbt target directory.
clean_targetsarray["target", "dbt_packages"]Directories to clean.
Terminal window
# Build dbt models
dbt run
# Run MXCP with dbt tables available
mxcp serve

See dbt Integration for complete documentation.

Enable built-in SQL tools for direct database access.

sql_tools:
enabled: true
FieldTypeDefaultDescription
enabledbooleanfalseEnable built-in SQL tools.

When enabled, provides these tools:

ToolDescription
execute_sql_queryExecute arbitrary SQL queries
list_tablesList all tables in the database
get_table_schemaGet schema for a specific table

Security Note: Only enable for trusted environments. Consider using custom tools with proper access controls for production.

Customize directory paths for endpoint definitions and data storage.

paths:
tools: tools # Tool YAML files
resources: resources # Resource YAML files
prompts: prompts # Prompt YAML files
evals: evals # Evaluation YAML files
python: python # Python implementation files
plugins: plugins # Plugin modules
sql: sql # SQL implementation files
drift: drift # Drift snapshots
audit: audit # Audit logs
data: data # Database files
FieldTypeDefaultDescription
toolsstring"tools"Tool definitions directory.
resourcesstring"resources"Resource definitions directory.
promptsstring"prompts"Prompt definitions directory.
evalsstring"evals"Evaluation definitions directory.
pythonstring"python"Python implementations directory.
pluginsstring"plugins"Plugin modules directory.
sqlstring"sql"SQL implementations directory.
driftstring"drift"Drift snapshot files directory.
auditstring"audit"Audit log files directory.
datastring"data"Database and data files directory.

All paths are relative to the project root.

Define environment-specific configurations.

profiles:
default:
# Development settings
duckdb:
path: ./data/dev.duckdb
readonly: false
audit:
enabled: false
staging:
duckdb:
path: ./data/staging.duckdb
readonly: false
audit:
enabled: true
path: ./audit/staging.jsonl
production:
duckdb:
path: /data/prod.duckdb
readonly: true
audit:
enabled: true
path: /var/log/mxcp/audit.jsonl
FieldTypeDescription
duckdbobjectDuckDB database configuration.
driftobjectDrift detection configuration.
auditobjectAudit logging configuration.
duckdb:
path: ./data/app.duckdb
readonly: false
FieldTypeDefaultDescription
pathstring{paths.data}/db-{profile}.duckdbDatabase file path.
readonlybooleanfalseOpen database in read-only mode.

Path Behavior:

  • If not specified, defaults to {paths.data}/db-{profile}.duckdb (e.g., data/db-default.duckdb)
  • The paths.data value defaults to "data" but can be customized in the paths configuration
  • Relative paths are resolved from project root
  • Use absolute paths for production deployments
  • Override with MXCP_DUCKDB_PATH environment variable
drift:
path: ./drift/snapshot.json
FieldTypeDefaultDescription
pathstring{paths.drift}/drift-{profile}.jsonDrift snapshot file path.

Path Behavior:

  • If not specified, defaults to {paths.drift}/drift-{profile}.json (e.g., drift/drift-default.json)
  • The paths.drift value defaults to "drift" but can be customized in the paths configuration

Use drift detection to track schema changes:

Terminal window
# Create/update snapshot
mxcp drift-snapshot
# Check for changes
mxcp drift-check
audit:
enabled: true
path: ./audit/logs.jsonl
FieldTypeDefaultDescription
enabledbooleanfalseEnable audit logging.
pathstring{paths.audit}/logs-{profile}.jsonlAudit log file path (JSONL format).

Path Behavior:

  • If not specified, defaults to {paths.audit}/logs-{profile}.jsonl (e.g., audit/logs-default.jsonl)
  • The paths.audit value defaults to "audit" but can be customized in the paths configuration
  • Override enabled state with MXCP_AUDIT_ENABLED environment variable (true/false, 1/0, yes/no)

Query audit logs:

Terminal window
mxcp log --since 1h
mxcp log --tool my_tool
mxcp log --status error

See Auditing for complete documentation.

mxcp: 1
project: my-app
profile: default
dbt:
enabled: true
sql_tools:
enabled: true # Convenient for development
profiles:
default:
duckdb:
path: ./data/dev.duckdb
readonly: false
audit:
enabled: false
mxcp: 1
project: my-app
profile: production
secrets:
- db_credentials
extensions:
- httpfs
- parquet
dbt:
enabled: true
sql_tools:
enabled: false # Disabled for security
profiles:
production:
duckdb:
path: /data/prod.duckdb
readonly: true
drift:
path: /var/lib/mxcp/drift.json
audit:
enabled: true
path: /var/log/mxcp/audit.jsonl
mxcp: 1
project: analytics-platform
profile: default
secrets:
- warehouse_credentials
- api_keys
extensions:
- httpfs
- parquet
- postgres_scanner
profiles:
default:
duckdb:
path: ./data/local.duckdb
audit:
enabled: false
staging:
duckdb:
path: ${STAGING_DB_PATH}
audit:
enabled: true
path: ./logs/staging-audit.jsonl
production:
duckdb:
path: ${PROD_DB_PATH}
readonly: true
audit:
enabled: true
path: /var/log/mxcp/production-audit.jsonl

Use environment variables in configuration:

profiles:
production:
duckdb:
path: ${DATABASE_PATH}
audit:
path: ${AUDIT_LOG_PATH}

Environment variables are expanded at runtime.

VariableDescription
MXCP_PROFILEOverride the active profile (takes precedence over profile in site config)
MXCP_DUCKDB_PATHOverride DuckDB database path
MXCP_AUDIT_ENABLEDOverride audit logging (true/false, 1/0, yes/no)

Validate your site configuration:

Terminal window
mxcp validate

Common validation errors:

ErrorSolution
profile not foundEnsure profile value exists in profiles
missing required fieldAdd mxcp, project, and profile
invalid extensionCheck extension name and repository