${VAR:default} syntax. If an environment variable is not set, the default value will be used.
A common practice is to inject values through different .env, .env.development, .env.prod files, though you can also directly modify the configuration with hardcoded values.
Logging Configuration
Logging configuration controls the application’s log output behavior:Log Levels
Supports four levels: debug, info, warn, error
Output Format
Supports JSON structured output and console readable format
File Rotation
Automatically manages log file size and quantity
Stack Trace
Error logs can include detailed call stack information
Internationalization Configuration
Internationalization configuration is used to support multi-language interfaces:The translation file path should contain translation files for various languages to support multi-language user interfaces.
Chat Message Database Configuration
This configuration mainly targets the backend chat message storage configuration (of course, this can be stored in the same database as the proxy configuration), primarily used to store chat sessions and message data from the Web interface.The chat message database is mainly used to store MCP chat records conducted through the Web interface, and is separate from the gateway proxy configuration storage.
Supported Databases
Currently supports 3 types of databases:SQLite3
Suitable for development environments and small-scale deployments
PostgreSQL
Recommended for production environments
MySQL
Traditional relational database choice
Configuration Example
If you need additional database support, you can request it in the Issues, or you can directly implement the corresponding impl and submit a PR :)
Gateway Proxy Storage Configuration
This is used to store gateway proxy configurations, which corresponds to the configuration that maps from MCP to API. Currently supports 2 storage methods:db storage
db storage
Store in database, with each configuration as a record. Currently supports three databases: SQLite3, PostgreSQL, MySQL
api storage
api storage
Store configurations through API endpoints, allowing for external configuration management systems
The
revision_history_limit parameter controls the number of configuration version histories retained by the system, which helps with configuration rollback and auditing. The default is to retain 10 versions.Configuration Example
Notification Configuration
The notification configuration module is mainly used to letmcp-gateway sense updates and perform hot reloading without restarting the service when configuration is updated.
Supported Notification Methods
signal
Notify by sending operating system signals, similar to
kill -SIGHUP <pid> or nginx -s reloadapi
Notify by calling an API,
mcp-gateway will listen on a separate portredis
Notify through Redis publish/subscribe functionality, suitable for single-machine or cluster deployments
composite
Composite notification using multiple methods,
signal and api are always enabled by defaultNotification Roles
1
sender
Sender, responsible for sending notifications,
apiserver can only use this mode2
receiver
Receiver, responsible for receiving notifications, single-machine
mcp-gateway should only use this mode3
both
Both sender and receiver, cluster-deployed
mcp-gateway can use this methodConfiguration Example
Super Administrator Configuration
Super administrator configuration is used to set up the system’s initial administrator account. Each timeapiserver starts, it will automatically detect if it exists, and if not, it will be created automatically.
Strongly recommend using strong passwords in production or public network environments!
JWT Configuration
JWT configuration is used to set web authentication related parameters:Strongly recommend using strong passwords in production or public network environments!
OAuth Login Configuration
OAuth configuration enables third-party login functionality, currently supportingGoogle and GitHub login. When the corresponding client_id and client_secret are configured, the web interface will automatically enable OAuth login options.
Google Login
Supports Google account login, requires OAuth app configuration in Google Cloud Console
GitHub Login
Supports GitHub account login, requires creating an OAuth app in GitHub
- OAuth login options are only enabled when the corresponding
client_idandclient_secretare configured - OAuth login can be used alongside local account login
- Users logging in via OAuth for the first time will have accounts created automatically
Configuration File Location
By default, the configuration file should be placed in the following locations:- Container deployment:
/app/configs/apiserver.yaml - Binary deployment:
./configs/apiserver.yaml