Overview
Global Configuration
Config File Path
All commands support an optional parameter to specify the location of the mcpd config file.
You can provide this path in multiple ways:
CLI flag:
--config-file <path>Environment variable:
MCPD_CONFIG_FILE=<path>Default:
.mcpd.tomlin the current working directory
Sample Configuration File
[[servers]]
name = "fetch"
package = "uvx::mcp-server-fetch@2025.4.7"
tools = ["fetch"]
[[servers]]
name = "time"
package = "uvx::mcp-server-time@2025.8.4"
tools = ["get_current_time", "convert_time"]Log Level
Sets the logging level for mcpd.
You can configure it using:
CLI flag:
--log-level=<level>Environment variable:
MCPD_LOG_LEVEL=<level>
Default:
Log Path
Sets the log file path for mcpd.
Options:
CLI flag:
--log-path=<path>Environment variable:
MCPD_LOG_PATH=<path>
Setting Log Path
Log entries will be discarded by default, unless a log path is configured. Output intended for the terminal is still emitted.
Hot Reload
The mcpd daemon supports hot-reloading of MCP server configurations without requiring a full restart. This allows you to add, remove, or modify server configurations while keeping the daemon running.
Hot reload processes both:
Server configuration (
--config-file) e.g..mcpd.tomlExecution context (
--runtime-file) e.g.secrets.dev.toml
SIGHUP Signal
Send a SIGHUP signal to the running daemon process to trigger a configuration reload:
Reload Behavior
During a hot reload, the daemon intelligently categorizes changes and responds accordingly:
Unchanged servers
Preserve
Servers with identical configurations keep their existing connections, tools, and health status
Removed servers
Stop
Servers no longer in the config file are gracefully shut down
New servers
Start
Newly added servers are initialized and connected
'Tools-Only' changes
Update
When only the tools change, the daemon updates the allowed tools without restarting the server process
Configuration changes
Restart
Servers with other configuration changes (package version, environment variables, arguments, execution context, etc.) are stopped and restarted with new settings
Example: 'Tools-Only' Update
Consider this server configuration:
If you modify only the tools list:
The daemon will:
Detect that only the
toolsarray changedUpdate the allowed tools list in-place
Keep the existing server process and connections intact
Log a message that tools for a server were updated (including the server name and list of tools)
Example: Package Version Update
If you change the package version:
The daemon will:
Detect configuration changes beyond just tools
Gracefully stop the existing server
Start a new server with the updated configuration
Log a message that the server is being restarted (including the server name)
Execution Context and Environment Variables
Environment Variable Visibility
The mcpd process can only see environment variables that existed when it started.
If you export new environment variables in your shell after starting mcpd, you must restart the daemon for those variables to become available for shell expansion.
When the execution context file is reloaded, shell expansion of environment variables (${VAR} syntax) occurs using the environment available to the running mcpd process when it was started.
What Works During Hot Reload
Direct values are applied immediately:
Shell expansion of existing environment variables works:
What Requires an mcpd Restart
New environment variables added to the system after mcpd started won't be visible:
Limitations
Hot reload does NOT apply to:
Daemon-level config settings (timeouts, CORS, etc.)
New environment variables added to the system
Both require mcpd to be restarted for changes to take effect
Error Handling
The reload process maintains strict consistency - any error causes the daemon to exit:
Configuration errors: Invalid configuration files or loading failures cause the daemon to exit
Validation errors: Invalid server configurations cause the daemon to exit
No tools configured: If a server configuration has no tools (empty tools list or manually removed from config), the daemon will exit with an error
Server operation failures: Any failure to start, stop, or restart a server causes the daemon to exit
This ensures the daemon never runs in an inconsistent or partially-failed state, matching the behavior during initial startup where any server failure prevents the daemon from running.
Reload Failures
Unlike some systems that allow partial reloads, mcpd exits on any reload error to prevent inconsistent state. You'll need to fix the configuration and restart the daemon.
Diagnosing reload issues
If a change did not take effect, or the daemon exited during reload, see Troubleshooting.
Configuration Export
The mcpd config export command generates portable configuration files for deployment across different environments. It creates template variables using the naming pattern MCPD__{SERVER_NAME}__{VARIABLE_NAME}.
Template Variable Generation
Environment variables and command-line arguments are both converted to template variables using the same naming scheme:
Environment variable
DATABASE_URLbecomesMCPD__{SERVER_NAME}__DATABASE_URLCommand-line argument
--database-urlbecomesMCPD__{SERVER_NAME}__DATABASE_URL
Variable Name Collisions
Naming Collisions
If a server has both an environment variable and a command-line argument that normalize to the same name (e.g., DATABASE_URL and --database-url), they will generate the same template variable name.
In most cases, this is intentional, the same configuration value is being used in different ways. The collision results in a single template variable that can be used for both the environment variable and command-line argument.
Example Collision
Both will use the template variable MCPD__EXAMPLE__DATABASE_URL in the generated files.
Last updated