You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added documentation
* Implement equality checks for Server (ServerEntry and ServerExecutionContext)
* Added 'UpdateTools' to MCPClientAccessor (ClientManager)
* Update 'reload' logic for MCP servers to handle tool only changes etc.
*
Copy file name to clipboardExpand all lines: docs/configuration.md
+148-3Lines changed: 148 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,12 @@ You can provide this path in multiple ways:
24
24
[[servers]]
25
25
name = "fetch"
26
26
package = "uvx::mcp-server-fetch@2025.4.7"
27
+
tools = ["fetch"]
27
28
28
29
[[servers]]
29
30
name = "time"
30
-
package = "uvx::mcp-server-time@0.6.2"
31
-
tools = ["get_current_time"]
31
+
package = "uvx::mcp-server-time@2025.8.4"
32
+
tools = ["get_current_time", "convert_time"]
32
33
```
33
34
34
35
---
@@ -65,6 +66,150 @@ Options:
65
66
66
67
---
67
68
69
+
## Hot Reload
70
+
71
+
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.
72
+
73
+
Hot reload processes both:
74
+
75
+
-**Server configuration** (`--config-file`) e.g. `.mcpd.toml`
76
+
-**Execution context** (`--runtime-file`) e.g. `secrets.dev.toml`
77
+
78
+
### SIGHUP Signal
79
+
80
+
Send a `SIGHUP` signal to the running daemon process to trigger a configuration reload:
81
+
82
+
```bash
83
+
# Find the daemon process ID
84
+
ps aux | grep mcpd
85
+
86
+
# Send reload signal (replace PID with actual process ID)
87
+
kill -HUP <PID>
88
+
```
89
+
90
+
### Reload Behavior
91
+
92
+
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 |
97
+
| Removed servers | Stop | Servers no longer in the config file are gracefully shut down |
98
+
| New servers | Start | Newly added servers are initialized and connected |
99
+
| 'Tools-Only' changes | Update | When only the `tools` change, the daemon updates the allowed tools without restarting the server process |
100
+
| Configuration changes | Restart | Servers with other configuration changes (package version, environment variables, arguments, execution context, etc.) are stopped and restarted with new settings |
3. Start a new server with the updated configuration
145
+
4. Log a message that the server is being restarted (including the server name)
146
+
147
+
### Execution Context and Environment Variables
148
+
149
+
!!! warning "Environment Variable Visibility"
150
+
The `mcpd` process can only see environment variables that existed when it started.
151
+
152
+
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.
153
+
154
+
When the execution context file is reloaded, shell expansion of environment variables (`${VAR}` syntax)
155
+
occurs using the environment available to the running `mcpd` process when it was started.
Both require `mcpd` to be restarted for changes to take effect
197
+
198
+
### Error Handling
199
+
200
+
The reload process maintains strict consistency - any error causes the daemon to exit:
201
+
202
+
-**Configuration errors**: Invalid configuration files or loading failures cause the daemon to exit
203
+
-**Validation errors**: Invalid server configurations cause the daemon to exit
204
+
-**Server operation failures**: Any failure to start, stop, or restart a server causes the daemon to exit
205
+
206
+
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.
207
+
208
+
!!! warning "Reload Failures"
209
+
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.
210
+
211
+
---
212
+
68
213
## Configuration Export
69
214
70
215
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}`.
@@ -83,7 +228,7 @@ Environment variables and command-line arguments are both converted to template
83
228
84
229
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.
0 commit comments