For the complete documentation index, see llms.txt. This page is also available as Markdown.

Daemon Configuration

Global Configuration

Precedence

The order of precedence for these options is: CLI flag > configuration file > default value

The mcpd daemon command supports persistent configuration through configuration files and CLI commands. This allows you to configure API server settings, CORS policies, and various timeout values that persist across daemon restarts.

The daemon configuration is managed using the following commands:

  • mcpd config daemon get [key] - Retrieve configuration values

  • mcpd config daemon set <key=value> - Set configuration values

  • mcpd config daemon remove <key> - Remove configuration values

  • mcpd config daemon list - List currently configured and all available configuration keys

  • mcpd config daemon validate - Validate current configuration

For further information, please visit our CLI Overview.


Configuration Structure

The daemon configuration is organized into two main sections:

API Configuration (api.*)

Controls the HTTP API server settings.

Setting
Type
Description
Default
Example

api.addr

string

Server bind address (host:port)

0.0.0.0:8090

localhost:8080

api.timeout.shutdown

duration

Graceful shutdown timeout

30s

60s

CORS Configuration (api.cors.*)

Cross-Origin Resource Sharing settings for browser clients.

Setting
Type
Description
Default
Example

api.cors.enable

bool

Enable CORS support

false

true

api.cors.allow_origins

[]string

Allowed request origins

["*"]

["localhost:3000", "https://app.example.com"]

api.cors.allow_methods

[]string

Allowed HTTP methods

["GET", "POST", "PUT", "DELETE"]

["GET", "POST"]

api.cors.allow_headers

[]string

Allowed request headers

["Content-Type", "Authorization"]

["Content-Type", "API-Key"]

api.cors.expose_headers

[]string

Headers exposed to client

[]

["ETag", "Last-Modified"]

api.cors.allow_credentials

bool

Allow credentials in requests

false

true

api.cors.max_age

duration

Preflight cache duration

0s

24h

MCP Configuration (mcp.*)

Model Context Protocol server management settings.

Setting
Type
Description
Default
Example

mcp.timeout.init

duration

Server initialization timeout

30s

60s

mcp.timeout.shutdown

duration

Server shutdown timeout

10s

30s

mcp.timeout.health

duration

Health check timeout

5s

10s

mcp.timeout.request

duration

Tool call request timeout

15s

60s

mcp.interval.health

duration

Health check interval

30s

60s

Configuration Examples

Basic API Configuration

CORS Configuration

MCP Server Configuration

Retrieving Configuration

Removing Configuration

Configuration File Storage

Configuration is stored in the .mcpd.toml file in TOML format:

Data Types

Duration Format

Duration values follow this time/duration format:

  • 30s - 30 seconds

  • 5m - 5 minutes

  • 2h - 2 hours

  • 1m30s - 1 minute 30 seconds

String Arrays

String arrays can be provided as comma-separated values:

Boolean Values

Boolean values should use: true, false.

Configuration Validation

Use the validate command to check your configuration:

Common validation errors:

  • Invalid address formats (must be host:port)

  • Invalid duration formats

  • Invalid CORS origin URLs

For step-by-step diagnosis of browser requests, CORS issues, or unexpected API addresses, see Troubleshooting.

Last updated