Skip to Content
ReferencesArcade MCPPythonSettings

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_

FieldTypeDescriptionDefault
debugboolEnable debug modeFalse
serverServerSettingsServer identification settingsServerSettings()
transportTransportSettingsTransport and session settingsTransportSettings()
middlewareMiddlewareSettingsMiddleware behavior settingsMiddlewareSettings()
notificationNotificationSettingsNotification rate limiting settingsNotificationSettings()
arcadeArcadeSettingsArcade platform integration settingsArcadeSettings()
resource_serverResourceServerSettingsResource Server (front-door auth) settingsResourceServerSettings()
tool_environmentToolEnvironmentSettingsTool secrets from environmentToolEnvironmentSettings()

Methods

from_env

Python
MCPSettings.from_env() # classmethod

Create 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

Python
settings.tool_secrets()

Returns a dict[str, Any] of secrets collected from the environment.

to_dict

Python
settings.to_dict()

Convert settings to a dictionary (excludes unset fields).

Example

Python
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_

FieldTypeDescriptionDefault
namestrServer name'ArcadeMCP'
versionstrServer version'0.1.0dev'
titlestr | NoneServer title for display'ArcadeMCP'
instructionsstr | NoneServer 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_

FieldTypeDescriptionDefaultRange
session_timeout_secondsintSession timeout in seconds30030-3600
cleanup_interval_secondsintCleanup interval in seconds101—60
max_sessionsintMaximum concurrent sessions10001—10000
max_queue_sizeintMaximum queue size per session100010—10000

MiddlewareSettings

arcade_mcp_server.settings.MiddlewareSettings

Bases: BaseSettings | Env prefix: MCP_MIDDLEWARE_

FieldTypeDescriptionDefault
enable_loggingboolEnable the built-in logging middlewareTrue
log_levelstrLog level for the logging middleware. Validated to be one of DEBUG, INFO, WARNING, ERROR, CRITICAL.'INFO'
enable_error_handlingboolEnable the built-in error handling middlewareTrue
mask_error_detailsboolMask detailed error messages in responses (recommended for production)False

NotificationSettings

arcade_mcp_server.settings.NotificationSettings

Bases: BaseSettings | Env prefix: MCP_NOTIFICATION_

FieldTypeDescriptionDefaultRange
rate_limit_per_minuteintMaximum notifications per minute per client601—1000
default_debounce_msintDefault debounce time in milliseconds1000—10000
max_queued_notificationsintMaximum queued notifications per client100010—10000

ArcadeSettings

arcade_mcp_server.settings.ArcadeSettings

Bases: BaseSettings | Env prefix: ARCADE_

FieldTypeDescriptionDefault
api_keystr | NoneArcade API key for tool authorizationNone
api_urlstrArcade API URL'https://api.arcade.dev'
auth_disabledboolDisable authenticationFalse
server_secretstr | NoneServer secret for worker endpoints. When set, enables worker routes at /worker/*. Reads from ARCADE_WORKER_SECRET env var.None
environmentstrEnvironment mode (dev or prod)'dev'
user_idstr | NoneUser ID for tool contextNone

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.

FieldTypeDescriptionDefault
canonical_urlstr | NoneCanonical URL of this MCP server (for example, https://mcp.example.com/mcp)None
authorization_serverslist[dict] | NoneJSON 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.

FieldTypeDescriptionDefault
tool_environmentdict[str, Any]Collected tool secrets from environment{} (auto-populated)

Environment variable reference

Here is a summary of key environment variables:

VariableSettings classDescription
MCP_DEBUGMCPSettingsEnable debug mode (true/false)
MCP_SERVER_NAMEServerSettingsServer name
MCP_SERVER_VERSIONServerSettingsServer version
MCP_SERVER_TITLEServerSettingsServer display title
MCP_SERVER_INSTRUCTIONSServerSettingsServer instructions
MCP_TRANSPORT_SESSION_TIMEOUT_SECONDSTransportSettingsSession timeout
MCP_TRANSPORT_MAX_SESSIONSTransportSettingsMax concurrent sessions
MCP_MIDDLEWARE_ENABLE_LOGGINGMiddlewareSettingsEnable logging middleware
MCP_MIDDLEWARE_LOG_LEVELMiddlewareSettingsMiddleware log level
MCP_MIDDLEWARE_MASK_ERROR_DETAILSMiddlewareSettingsMask error details
ARCADE_API_KEYArcadeSettingsArcade API key
ARCADE_API_URLArcadeSettingsArcade API URL
ARCADE_AUTH_DISABLEDArcadeSettingsDisable authentication
ARCADE_USER_IDArcadeSettingsUser ID
ARCADE_WORKER_SECRETArcadeSettingsWorker secret (enables worker routes)

Additionally, MCPApp.run() checks these environment variable overrides at runtime:

VariableDescription
ARCADE_SERVER_TRANSPORTOverride transport ("stdio" or "http")
ARCADE_SERVER_HOSTOverride host (HTTP only)
ARCADE_SERVER_PORTOverride port (HTTP only)
ARCADE_SERVER_RELOADOverride reload ("0" or "1", HTTP only)
Last updated on