MCP Workbench uses ASP.NET Core configuration. Settings may come from:
appsettings.json;appsettings.{Environment}.json;- environment variables;
- command-line arguments.
Environment variables use double underscores, for example:
McpWorkbench__RegistryPath=/data/servers.json
Security__ApiKey=${actual deployment secret}
Do not commit real secrets.
Suggested appsettings.json:
{
"McpWorkbench": {
"RegistryPath": "data/servers.json",
"SecretVaultPath": "data/secrets.vault",
"SecretKeyRingPath": "data/secret-keys",
"BindToLoopbackOnly": true,
"ConnectTimeoutSeconds": 15,
"PingTimeoutSeconds": 5,
"DefaultOperationTimeoutSeconds": 30,
"MaximumOperationTimeoutSeconds": 300,
"MaximumArgumentsBytes": 262144,
"MaximumResultBytes": 4194304,
"MaximumHistoryEntriesPerServer": 50,
"LoadToolsOnConnect": true,
"AllowStdioServers": true,
"AllowHttpServers": true,
"AllowedStdioCommands": [],
"AllowedHttpHosts": []
},
"Security": {
"ApiKey": null,
"ProtectStaticUi": false,
"TrustedProxyCount": 0
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"McpWorkbench": "Information"
}
}
}| Option | Meaning |
|---|---|
RegistryPath |
JSON registry file. Parent directory is created on startup. |
SecretVaultPath |
Encrypted managed-secret file. |
SecretKeyRingPath |
Data Protection key ring; Windows protects keys with current-user DPAPI. |
BindToLoopbackOnly |
Enforces loopback URLs unless explicitly disabled. |
ConnectTimeoutSeconds |
Overall initialize/connect limit. |
PingTimeoutSeconds |
MCP ping limit. |
DefaultOperationTimeoutSeconds |
Default discovery and invocation timeout. |
MaximumOperationTimeoutSeconds |
Upper bound accepted from API requests. |
MaximumArgumentsBytes |
UTF-8 byte limit for tool arguments. |
MaximumResultBytes |
Maximum normalized/raw tool result returned by API. |
MaximumHistoryEntriesPerServer |
In-memory ring-buffer capacity. |
LoadToolsOnConnect |
Load the catalog after initialization and ping. |
AllowStdioServers |
Operational kill switch for process execution. |
AllowHttpServers |
Operational kill switch for network MCP servers. |
AllowedStdioCommands |
Optional exact command allowlist. Empty means unrestricted. |
AllowedHttpHosts |
Optional case-insensitive host allowlist. Empty means unrestricted. |
Persisted registry schema version 1:
{
"schemaVersion": 1,
"revision": 7,
"updatedAtUtc": "2026-07-11T00:00:00Z",
"servers": [
{
"id": "c5af558c-ef13-45f8-8cf5-a7d320292f72",
"name": "Local test server",
"description": "Deterministic development server",
"enabled": true,
"transport": "stdio",
"stdio": {
"command": "dotnet",
"arguments": [
"./tools/McpWorkbench.TestServer.dll"
],
"workingDirectory": null,
"environment": {
"DEMO_TOKEN": "${ENV:DEMO_TOKEN}"
},
"shutdownTimeoutSeconds": 5
},
"http": null,
"operationTimeoutSeconds": 30,
"createdAtUtc": "2026-07-11T00:00:00Z",
"updatedAtUtc": "2026-07-11T00:00:00Z"
}
]
}Runtime status, resolved secrets, tool catalogs, and execution history are not persisted.
Every mutation follows:
- Acquire the global registry write semaphore.
- Clone the current immutable registry snapshot.
- Apply and validate the mutation.
- Increment
revision. - Serialize using source-generated
System.Text.Json. - Write to
<registry>.tmpin the same directory. - Flush the file stream, including durable flush when supported.
- Atomically replace the destination.
- Update the in-memory snapshot.
- Release the semaphore.
On platforms where atomic replacement differs, use a same-volume rename strategy. Never write the destination file in place.
At startup:
- missing file: create an empty schema-v1 registry;
- empty file: fail readiness and report a clear error;
- malformed JSON: fail readiness; do not overwrite;
- unsupported schema version: fail startup/readiness; do not migrate silently;
- duplicate IDs or names: fail validation;
- stale
.tmpfile: leave it intact and log its presence; never promote automatically.
| Field | Rule |
|---|---|
id |
Server-generated GUID |
name |
Required, trimmed, 1–100 Unicode scalar values |
description |
Optional, max 1000 characters |
enabled |
Boolean |
transport |
Exactly stdio or http |
operationTimeoutSeconds |
1 through configured maximum |
createdAtUtc |
Server-generated UTC timestamp |
updatedAtUtc |
Server-generated UTC timestamp |
Names are unique after trim and Unicode-aware case-insensitive comparison. The persisted original casing is preserved.
Exactly one transport options object must be present and it must match transport.
| Field | Rule |
|---|---|
command |
Required, nonempty, max 1024 characters |
arguments |
Array, max 128 entries, each max 8192 characters |
workingDirectory |
Optional absolute or application-resolved path |
environment |
Max 128 entries; valid process environment names |
shutdownTimeoutSeconds |
1–30 |
Important:
- Do not join the command and arguments into a shell command.
- Do not invoke
cmd.exe,/bin/sh, PowerShell, or another shell implicitly. - Pass each argument directly to
ProcessStartInfo.ArgumentListor SDK-equivalent options. - Standard output is owned by the MCP transport and must not be used for application logs.
- Child-server diagnostic output should use standard error.
If AllowedStdioCommands is nonempty, the normalized executable command must exactly
match one entry. Do not use substring matching.
| Field | Rule |
|---|---|
endpoint |
Absolute https URI by default |
mode |
auto, streamableHttp, or legacySse |
headers |
Max 64 entries |
authorization |
Optional bearer, basic, customScheme, or customRaw authorization configuration |
| header name | Valid HTTP header token |
| header value | Max 8192 characters before resolution |
Plain HTTP is allowed only for loopback addresses unless a dedicated unsafe-development setting is introduced and documented.
Reject:
- URI user-info;
- unsupported schemes;
- fragments;
- control characters;
- headers controlled by the runtime such as
HostandContent-Length.
When AllowedHttpHosts is nonempty, compare the normalized IDN host exactly against it.
Only this syntax is recognized:
${ENV:VARIABLE_NAME}
A string may contain one or more references:
Bearer ${ENV:MCP_ACCESS_TOKEN}
Resolution occurs only when creating a transport. Persist the reference text, not the resolved value.
Rules:
- Variable names must match
[A-Za-z_][A-Za-z0-9_]*. - An unresolved variable fails connection with
secret_reference_unresolved. - No recursive expansion.
- Do not resolve references in server name, command, arguments, working directory, or endpoint in version 1.
- Resolve references only in stdio environment values and HTTP header values.
- Never put resolved values into exceptions, activity tags, logs, runtime snapshots, API responses, or execution history.
- Redact conventional secret headers even when they contain literal values.
Always redact values whose key matches, case-insensitively:
authorization
proxy-authorization
cookie
set-cookie
x-api-key
api-key
token
access-token
client-secret
password
secret
Also redact:
- any value produced by secret resolution;
- registry values containing
${ENV:...}when presenting a runtime diagnostic; - command arguments only when explicitly marked secret in a future schema. Version 1 therefore recommends passing secrets via environment variables, not arguments.
Recommended deployment:
services:
mcp-workbench:
image: ghcr.io/example/mcp-workbench:latest
ports:
- "127.0.0.1:5070:8080"
environment:
McpWorkbench__RegistryPath: /data/servers.json
Security__ApiKey: "${MCP_WORKBENCH_API_KEY}"
volumes:
- ./data:/dataStdio child servers inside a container must exist in the image or a mounted volume. Host-installed commands are not automatically visible inside the container.
Validate application options at startup using ValidateOnStart.
Validate persisted definitions while loading the registry.
Validate API inputs before any lifecycle or persistence side effect.
Validate resolved values again immediately before creating a transport.