Skip to main content

resq_mcp.core.config

Configuration management for the ResQ MCP server. Settings are loaded from environment variables with sensible defaults. Use a .env file or export environment variables to override. Environment variables: RESQ_PROJECT_NAME: Display name for the MCP server RESQ_VERSION: Version string for the server RESQ_DEBUG: Enable debug logging (true/false) RESQ_API_KEY: API key for authenticated endpoints RESQ_PORT: Port for SSE server RESQ_HOST: Host to bind to RESQ_SAFE_MODE: If True, side-effecting tools are disabled or mocked safely

annotations

Literal

Field

BaseSettings

SettingsConfigDict

ConfigurationError Objects

Raised when required configuration is missing or invalid.

Settings Objects

Application configuration via environment variables.

model_config

PROJECT_NAME

VERSION

DEBUG

API_KEY

PORT

HOST

SAFE_MODE

TELEMETRY_BACKEND

OTEL_EXPORTER_OTLP_ENDPOINT

OTEL_SERVICE_NAME

settings

validate_environment

Validate required environment variables at startup. This function performs fail-fast validation by raising ConfigurationError if any required environment variables are missing. Arguments:
  • require_api_key - If True, API_KEY must be set and not be the default dev token.
Raises:
  • ConfigurationError - If any required environment variable is missing or invalid.
Example:
from resq_mcp.core.config import validate_environment validate_environment(require_api_key=True)