Skip to content
Star -

Operations

Related Topics: Security (authentication, policies) | Quality (testing, validation) | Common Tasks (quick how-to)

This section covers everything you need to deploy and operate MXCP in production environments.

Complete configuration reference:

  • Site configuration (mxcp-site.yml)
  • User configuration (~/.mxcp/config.yml)
  • Environment variables
  • Secret management (Vault, 1Password)

Production deployment patterns:

  • Docker deployment
  • systemd service configuration
  • Kubernetes deployment
  • Signal handling and hot reload

Observability and operational monitoring:

  • OpenTelemetry integration
  • Drift detection
  • Admin API
  • Health checks
Terminal window
# stdio transport (for Claude Desktop)
mxcp serve
# HTTP transport
mxcp serve --transport streamable-http --port 8000
# With specific profile
mxcp serve --profile production
VariableDescriptionDefault
MXCP_CONFIGUser config path~/.mxcp/config.yml
MXCP_PROFILEActive profiledefault
MXCP_DEBUGEnable debug loggingfalse
MXCP_READONLYRead-only databasefalse
MXCP_DUCKDB_PATHOverride DuckDB pathfrom config
MXCP_ADMIN_ENABLEDEnable admin APIfalse
MXCP_ADMIN_SOCKETAdmin socket path/run/mxcp/mxcp.sock
SignalBehavior
SIGTERMGraceful shutdown
SIGHUPHot reload configuration
SIGINTImmediate shutdown
Terminal window
# List endpoints
mxcp list
# Validate endpoints
mxcp validate
# Run tests
mxcp test
# Query audit logs
mxcp log --since 1h
# Check drift
mxcp drift-check
# Create drift snapshot
mxcp drift-snapshot

Before deploying to production:

  • Security

    • Authentication configured
    • Policies defined
    • Audit logging enabled
    • Secrets in Vault/1Password
  • Configuration

    • Production profile created
    • Database path configured
    • Correct transport settings
  • Quality

    • All tests passing
    • Validation successful
    • Linting issues addressed
  • Operations

    • Monitoring configured
    • Log rotation set up
    • Backup strategy defined
    • Drift baseline created

Reload secrets without restart:

Terminal window
# Using signal
kill -HUP $(pgrep -f "mxcp serve")
# Using admin API
curl --unix-socket /run/mxcp/mxcp.sock -X POST http://localhost/reload
Terminal window
# Via admin API
curl --unix-socket /run/mxcp/mxcp.sock http://localhost/status | jq
# Response includes:
# - version
# - uptime
# - profile
# - endpoint counts
# - reload status
Terminal window
# Backup database
cp db.duckdb db.duckdb.backup
# Optimize database
duckdb db.duckdb "PRAGMA optimize"
# Check database size
du -h db.duckdb