Settings
MCPSettings is the main configuration container for the Arcade Server. All settings classes use Pydantic Settings with environment variable support.
MCPSettings
arcade_mcp_server.settings.MCPSettings
Bases: BaseSettings
Main settings container that aggregates all sub-settings.
Env prefix: MCP_
| Field | Type | Description | Default |
|---|---|---|---|
debug | bool | Enable debug mode | False |
server | ServerSettings | Server identification settings | ServerSettings() |
transport | TransportSettings | Transport and session settings | TransportSettings() |
middleware | MiddlewareSettings | Middleware behavior settings | MiddlewareSettings() |
notification | NotificationSettings | Notification rate limiting settings | NotificationSettings() |
arcade | ArcadeSettings | Arcade platform integration settings | ArcadeSettings() |
resource_server | ResourceServerSettings | Resource Server (front-door auth) settings | ResourceServerSettings() |
tool_environment | ToolEnvironmentSettings | Tool secrets from environment | ToolEnvironmentSettings() |
Methods
from_env
MCPSettings.from_env() # classmethodCreate settings from environment variables. Automatically loads a .env file from the current working directory if one exists (override=False, so existing environment variables take precedence).
tool_secrets
settings.tool_secrets()Returns a dict[str, Any] of secrets collected from the environment.
to_dict
settings.to_dict()Convert settings to a dictionary (excludes unset fields).
Example
from arcade_mcp_server.settings import (
MCPSettings,
MiddlewareSettings,
ServerSettings,
TransportSettings,
)
settings = MCPSettings(
debug=True,
middleware=MiddlewareSettings(
enable_logging=True,
mask_error_details=False,
),
server=ServerSettings(
name="MyServer",
title="My MCP Server",
instructions="Use responsibly",
),
)Sub-settings
ServerSettings
arcade_mcp_server.settings.ServerSettings
Bases: BaseSettings | Env prefix: MCP_SERVER_
| Field | Type | Description | Default |
|---|---|---|---|
name | str | Server name | 'ArcadeMCP' |
version | str | Server version | '0.1.0dev' |
title | str | None | Server title for display | 'ArcadeMCP' |
instructions | str | None | Server instructions sent to clients | 'ArcadeMCP provides access to a wide range of tools and toolkits...' |
TransportSettings
arcade_mcp_server.settings.TransportSettings
Bases: BaseSettings | Env prefix: MCP_TRANSPORT_
| Field | Type | Description | Default | Range |
|---|---|---|---|---|
session_timeout_seconds | int | Session timeout in seconds | 300 | 30-3600 |
cleanup_interval_seconds | int | Cleanup interval in seconds | 10 | 1—60 |
max_sessions | int | Maximum concurrent sessions | 1000 | 1—10000 |
max_queue_size | int | Maximum queue size per session | 1000 | 10—10000 |
MiddlewareSettings
arcade_mcp_server.settings.MiddlewareSettings
Bases: BaseSettings | Env prefix: MCP_MIDDLEWARE_
| Field | Type | Description | Default |
|---|---|---|---|
enable_logging | bool | Enable the built-in logging middleware | True |
log_level | str | Log level for the logging middleware. Validated to be one of DEBUG, INFO, WARNING, ERROR, CRITICAL. | 'INFO' |
enable_error_handling | bool | Enable the built-in error handling middleware | True |
mask_error_details | bool | Mask detailed error messages in responses (recommended for production) | False |
NotificationSettings
arcade_mcp_server.settings.NotificationSettings
Bases: BaseSettings | Env prefix: MCP_NOTIFICATION_
| Field | Type | Description | Default | Range |
|---|---|---|---|---|
rate_limit_per_minute | int | Maximum notifications per minute per client | 60 | 1—1000 |
default_debounce_ms | int | Default debounce time in milliseconds | 100 | 0—10000 |
max_queued_notifications | int | Maximum queued notifications per client | 1000 | 10—10000 |
ArcadeSettings
arcade_mcp_server.settings.ArcadeSettings
Bases: BaseSettings | Env prefix: ARCADE_
| Field | Type | Description | Default |
|---|---|---|---|
api_key | str | None | Arcade API key for tool authorization | None |
api_url | str | Arcade API URL | 'https://api.arcade.dev' |
auth_disabled | bool | Disable authentication | False |
server_secret | str | None | Server secret for worker endpoints. When set, enables worker routes at /worker/*. Reads from ARCADE_WORKER_SECRET env var. | None |
environment | str | Environment mode (dev or prod) | 'dev' |
user_id | str | None | User ID for tool context | None |
ResourceServerSettings
arcade_mcp_server.settings.ResourceServerSettings
Bases: BaseSettings | Env prefix: MCP_RESOURCE_SERVER_
Settings for configuring front-door OAuth 2.0 authentication via the Resource Server pattern.
| Field | Type | Description | Default |
|---|---|---|---|
canonical_url | str | None | Canonical URL of this MCP server (for example, https://mcp.example.com/mcp) | None |
authorization_servers | list[dict] | None | JSON array of authorization server configurations. Each entry must have authorization_server_url, issuer, jwks_uri, and optionally algorithm (default RS256), expected_audiences, and validation_options. | None |
ToolEnvironmentSettings
arcade_mcp_server.settings.ToolEnvironmentSettings
Bases: BaseSettings
Collects environment variables as secrets. Every environment variable that is not prefixed with MCP_ or _ is added to the tool environment and made available as a tool secret in the ToolContext.
Also loads variables from a .env file in the current working directory.
| Field | Type | Description | Default |
|---|---|---|---|
tool_environment | dict[str, Any] | Collected tool secrets from environment | {} (auto-populated) |
Environment variable reference
Here is a summary of key environment variables:
| Variable | Settings class | Description |
|---|---|---|
MCP_DEBUG | MCPSettings | Enable debug mode (true/false) |
MCP_SERVER_NAME | ServerSettings | Server name |
MCP_SERVER_VERSION | ServerSettings | Server version |
MCP_SERVER_TITLE | ServerSettings | Server display title |
MCP_SERVER_INSTRUCTIONS | ServerSettings | Server instructions |
MCP_TRANSPORT_SESSION_TIMEOUT_SECONDS | TransportSettings | Session timeout |
MCP_TRANSPORT_MAX_SESSIONS | TransportSettings | Max concurrent sessions |
MCP_MIDDLEWARE_ENABLE_LOGGING | MiddlewareSettings | Enable logging middleware |
MCP_MIDDLEWARE_LOG_LEVEL | MiddlewareSettings | Middleware log level |
MCP_MIDDLEWARE_MASK_ERROR_DETAILS | MiddlewareSettings | Mask error details |
ARCADE_API_KEY | ArcadeSettings | Arcade API key |
ARCADE_API_URL | ArcadeSettings | Arcade API URL |
ARCADE_AUTH_DISABLED | ArcadeSettings | Disable authentication |
ARCADE_USER_ID | ArcadeSettings | User ID |
ARCADE_WORKER_SECRET | ArcadeSettings | Worker secret (enables worker routes) |
Additionally, MCPApp.run() checks these environment variable overrides at runtime:
| Variable | Description |
|---|---|
ARCADE_SERVER_TRANSPORT | Override transport ("stdio" or "http") |
ARCADE_SERVER_HOST | Override host (HTTP only) |
ARCADE_SERVER_PORT | Override port (HTTP only) |
ARCADE_SERVER_RELOAD | Override reload ("0" or "1", HTTP only) |