Skip to content

config export

mcpd config export

Exports current configuration, generating a pair of safe and portable configuration files

Synopsis

Exports current configuration, generating a pair of safe and portable configuration files.

Using a project's required configuration (e.g. .mcpd.toml) and the locally configured runtime values from the execution context file (e.g. ~/.config/mcpd/secrets.dev.toml), the export command outputs two files:

Environment Contract:

Lists all required and configured environment variables as secure, namespaced placeholders:

MCPD__{SERVER_NAME}__{ENV_VAR} - Creates placeholders for command line arguments to be populated with env vars

MCPD__{SERVER_NAME}__ARG_{ARG_NAME} - This file is intended for the platform operator or CI/CD system

Portable Execution Context:

  • A new secrets .toml file that defines sanitized runtime args and env sections for each server using the placeholders aligned with the environment contract
  • These files are safe to check into version control if required.

This allows running an mcpd project in any environment, cleanly separating the configuration structure from the secret values

mcpd config export [flags]

Options

      --context-output string    Optional, specify the output path for the templated execution context config file (default "secrets.prod.toml")
      --contract-output string   Optional, specify the output path for the templated environment file (default ".env")
      --format format            Specify the format of the contract output file (one of: dotenv) (default dotenv)

Options inherited from parent commands

      --config-file string    path to config file (default ".mcpd.toml")
      --log-level string      log level for mcpd logs (default "info")
      --log-path string       log file path to use for log output
      --runtime-file string   path to runtime (execution context) file that contains env vars, and arguments for your MCP servers (default "/home/runner/.config/mcpd/secrets.dev.toml")

SEE ALSO

Auto generated by spf13/cobra on 18-Jul-2025