3
3
# ####################################
4
4
5
5
# Basic Server Configuration
6
+ APP_NAME = MCP_Gateway
6
7
HOST = 0.0.0.0
7
8
PORT = 4444
8
9
ENVIRONMENT = development
9
10
APP_DOMAIN = localhost
11
+ APP_ROOT_PATH = " "
12
+
13
+ # Enable basic auth for docs endpoints
14
+ DOCS_ALLOW_BASIC_AUTH = false
10
15
11
16
# Database Configuration
12
17
DATABASE_URL = sqlite:///./mcp.db
13
18
# DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/mcp
14
19
# DATABASE_URL=mysql+pymysql://mysql:changeme@localhost:3306/mcp
15
20
21
+ # Database Connection Pool Configuration (for performance optimization)
22
+ # DB_POOL_SIZE=50 # Maximum number of persistent connections (default: 200, SQLite capped at 50)
23
+ # DB_MAX_OVERFLOW=20 # Additional connections beyond pool_size (default: 10, SQLite capped at 20)
24
+ # DB_POOL_TIMEOUT=30 # Seconds to wait for connection before timeout (default: 30)
25
+ # DB_POOL_RECYCLE=3600 # Seconds before recreating connection (default: 3600)
26
+
16
27
# Cache Configuration
17
28
CACHE_TYPE = database
18
29
# CACHE_TYPE=redis
@@ -39,8 +50,6 @@ PROTOCOL_VERSION=2025-03-26
39
50
# Admin UI basic-auth credentials
40
51
# PRODUCTION: Change these to strong, unique values!
41
52
# Authentication Configuration
42
- JWT_SECRET_KEY = my-test-key
43
- JWT_ALGORITHM = HS256
44
53
BASIC_AUTH_USER = admin
45
54
BASIC_AUTH_PASSWORD = changeme
46
55
AUTH_REQUIRED = true
@@ -52,10 +61,49 @@ JWT_SECRET_KEY=my-test-key
52
61
# Algorithm used to sign JWTs (e.g., HS256)
53
62
JWT_ALGORITHM = HS256
54
63
64
+ # JWT Audience and Issuer claims for token validation
65
+ # PRODUCTION: Set these to your service-specific values
66
+ JWT_AUDIENCE = mcpgateway-api
67
+ JWT_ISSUER = mcpgateway
68
+
55
69
# Expiry time for generated JWT tokens (in minutes; e.g. 7 days)
56
70
TOKEN_EXPIRY = 10080
57
71
REQUIRE_TOKEN_EXPIRATION = false
58
72
73
+ # ####################################
74
+ # Email-Based Authentication
75
+ # ####################################
76
+
77
+ # Enable email-based authentication system
78
+ EMAIL_AUTH_ENABLED = true
79
+
80
+ # Platform admin user (bootstrap from environment)
81
+ # PRODUCTION: Change these to your actual admin credentials!
82
+ PLATFORM_ADMIN_EMAIL = [email protected]
83
+ PLATFORM_ADMIN_PASSWORD = changeme
84
+ PLATFORM_ADMIN_FULL_NAME = Platform Administrator
85
+
86
+ # Argon2id Password Hashing Configuration
87
+ # Time cost (iterations) - higher = more secure but slower
88
+ ARGON2ID_TIME_COST = 3
89
+ # Memory cost (KB) - higher = more secure but uses more RAM
90
+ ARGON2ID_MEMORY_COST = 65536
91
+ # Parallelism (threads) - typically 1 for web apps
92
+ ARGON2ID_PARALLELISM = 1
93
+
94
+ # Password Policy Configuration
95
+ PASSWORD_MIN_LENGTH = 8
96
+ PASSWORD_REQUIRE_UPPERCASE = false
97
+ PASSWORD_REQUIRE_LOWERCASE = false
98
+ PASSWORD_REQUIRE_NUMBERS = false
99
+ PASSWORD_REQUIRE_SPECIAL = false
100
+
101
+ # Account Security Configuration
102
+ # Maximum failed login attempts before account lockout
103
+ MAX_FAILED_LOGIN_ATTEMPTS = 5
104
+ # Account lockout duration in minutes
105
+ ACCOUNT_LOCKOUT_DURATION_MINUTES = 30
106
+
59
107
# MCP Client Authentication
60
108
MCP_CLIENT_AUTH_ENABLED = true
61
109
TRUST_PROXY_AUTH = false
@@ -65,16 +113,80 @@ PROXY_USER_HEADER=X-Authenticated-User
65
113
# Must be a non-empty string (e.g. passphrase or random secret)
66
114
AUTH_ENCRYPTION_SECRET = my-test-salt
67
115
116
+ # OAuth Configuration
117
+ OAUTH_REQUEST_TIMEOUT = 30
118
+ OAUTH_MAX_RETRIES = 3
119
+
120
+ # ==============================================================================
121
+ # SSO (Single Sign-On) Configuration
122
+ # ==============================================================================
123
+
124
+ # Master SSO switch - enable Single Sign-On authentication
125
+ SSO_ENABLED = false
126
+
127
+ # GitHub OAuth Configuration
128
+ SSO_GITHUB_ENABLED = false
129
+ # SSO_GITHUB_CLIENT_ID=your-github-client-id
130
+ # SSO_GITHUB_CLIENT_SECRET=your-github-client-secret
131
+
132
+ # Google OAuth Configuration
133
+ SSO_GOOGLE_ENABLED = false
134
+ # SSO_GOOGLE_CLIENT_ID=your-google-client-id.googleusercontent.com
135
+ # SSO_GOOGLE_CLIENT_SECRET=your-google-client-secret
136
+
137
+ # IBM Security Verify OIDC Configuration
138
+ SSO_IBM_VERIFY_ENABLED = false
139
+ # SSO_IBM_VERIFY_CLIENT_ID=your-ibm-verify-client-id
140
+ # SSO_IBM_VERIFY_CLIENT_SECRET=your-ibm-verify-client-secret
141
+ # SSO_IBM_VERIFY_ISSUER=https://your-tenant.verify.ibm.com/oidc/endpoint/default
142
+
143
+ # Okta OIDC Configuration
144
+ SSO_OKTA_ENABLED = false
145
+ # SSO_OKTA_CLIENT_ID=your-okta-client-id
146
+ # SSO_OKTA_CLIENT_SECRET=your-okta-client-secret
147
+ # SSO_OKTA_ISSUER=https://your-okta-domain.okta.com
148
+
149
+ # SSO General Settings
150
+ SSO_AUTO_CREATE_USERS = true
151
+ # JSON array of trusted email domains, e.g., ["example.com", "company.org"]
152
+ SSO_TRUSTED_DOMAINS = []
153
+ # Keep local admin authentication when SSO is enabled
154
+ SSO_PRESERVE_ADMIN_AUTH = true
155
+
156
+ # SSO Admin Assignment Settings
157
+ # Email domains that automatically get admin privileges, e.g., ["yourcompany.com"]
158
+ SSO_AUTO_ADMIN_DOMAINS = []
159
+ # GitHub organizations whose members get admin privileges, e.g., ["your-org", "partner-org"]
160
+ SSO_GITHUB_ADMIN_ORGS = []
161
+ # Google Workspace domains that get admin privileges, e.g., ["company.com"]
162
+ SSO_GOOGLE_ADMIN_DOMAINS = []
163
+ # Require admin approval for new SSO registrations
164
+ SSO_REQUIRE_ADMIN_APPROVAL = false
165
+
166
+ # ####################################
167
+ # Personal Teams Configuration
168
+ # ####################################
169
+
170
+ # Enable automatic personal team creation for new users
171
+ AUTO_CREATE_PERSONAL_TEAMS = true
172
+
173
+ # Personal team naming prefix
174
+ PERSONAL_TEAM_PREFIX = personal
175
+
176
+ # Team Limits
177
+ MAX_TEAMS_PER_USER = 50
178
+ MAX_MEMBERS_PER_TEAM = 100
179
+
180
+ # Team Invitation Settings
181
+ INVITATION_EXPIRY_DAYS = 7
182
+ REQUIRE_EMAIL_VERIFICATION_FOR_INVITES = true
183
+
68
184
# ####################################
69
185
# Admin UI and API Toggles
70
186
# ####################################
71
187
72
188
# Enable the visual Admin UI (true/false)
73
189
# PRODUCTION: Set to false for security
74
- MCPGATEWAY_UI_ENABLED = true
75
-
76
- # Enable the Admin API endpoints (true/false)
77
- # PRODUCTION: Set to false for security
78
190
79
191
# UI/Admin Feature Flags
80
192
MCPGATEWAY_UI_ENABLED = true
@@ -143,12 +255,12 @@ CORS_ALLOW_CREDENTIALS=true
143
255
# Environment setting (development/production) - affects security defaults
144
256
# development: Auto-configures CORS for localhost:3000, localhost:8080, etc.
145
257
# production: Uses APP_DOMAIN for HTTPS origins, enforces secure cookies
146
- ENVIRONMENT = development
258
+ # ENVIRONMENT is already defined in Basic Server Configuration section
147
259
148
260
# Domain configuration for production CORS origins
149
261
# In production, automatically creates origins: https://APP_DOMAIN, https://app.APP_DOMAIN, https://admin.APP_DOMAIN
150
262
# For production: set to your actual domain (e.g., mycompany.com)
151
- APP_DOMAIN = localhost
263
+ # APP_DOMAIN is already defined in Basic Server Configuration section
152
264
153
265
# Security settings for cookies
154
266
# production: Automatically enables secure cookies regardless of this setting
@@ -190,7 +302,7 @@ REMOVE_SERVER_HEADERS=true
190
302
191
303
# Enable HTTP Basic Auth for docs endpoints (in addition to Bearer token auth)
192
304
# Uses the same credentials as BASIC_AUTH_USER and BASIC_AUTH_PASSWORD
193
- DOCS_ALLOW_BASIC_AUTH = false
305
+ # DOCS_ALLOW_BASIC_AUTH is already defined in Basic Server Configuration section
194
306
195
307
# ####################################
196
308
# Retry Config for HTTP Requests
@@ -209,32 +321,18 @@ RETRY_JITTER_MAX=0.5
209
321
# ####################################
210
322
211
323
# Logging verbosity level: DEBUG, INFO, WARNING, ERROR, CRITICAL
212
- MCPGATEWAY_BULK_IMPORT_MAX_TOOLS = 200
213
- MCPGATEWAY_BULK_IMPORT_RATE_LIMIT = 10
214
-
215
- # Security Configuration
216
- SECURITY_HEADERS_ENABLED = true
217
- CORS_ALLOW_CREDENTIALS = true
218
- SECURE_COOKIES = true
219
- COOKIE_SAMESITE = lax
220
- X_FRAME_OPTIONS = DENY
221
- HSTS_ENABLED = true
222
- HSTS_MAX_AGE = 31536000
223
- HSTS_INCLUDE_SUBDOMAINS = true
224
- REMOVE_SERVER_HEADERS = true
225
-
226
- # CORS Configuration
227
- ALLOWED_ORIGINS = ["http://localhost", "http://localhost:4444"]
228
324
229
325
# Logging Configuration
230
326
LOG_LEVEL = INFO
231
327
LOG_FORMAT = json
232
328
LOG_TO_FILE = false
329
+ LOG_FILEMODE = a+
330
+ LOG_FILE = mcpgateway.log
331
+ LOG_FOLDER = logs
233
332
LOG_ROTATION_ENABLED = false
234
333
LOG_MAX_SIZE_MB = 1
235
334
LOG_BACKUP_COUNT = 5
236
- LOG_FILE = mcpgateway.log
237
- LOG_FOLDER = logs
335
+ LOG_BUFFER_SIZE_MB = 1.0
238
336
239
337
# Transport Configuration
240
338
TRANSPORT_TYPE = all
@@ -243,6 +341,10 @@ SSE_RETRY_TIMEOUT=5000
243
341
SSE_KEEPALIVE_ENABLED = true
244
342
SSE_KEEPALIVE_INTERVAL = 30
245
343
344
+ # Streaming HTTP Configuration
345
+ USE_STATEFUL_SESSIONS = false
346
+ JSON_RESPONSE_ENABLED = true
347
+
246
348
# Federation Configuration
247
349
FEDERATION_ENABLED = true
248
350
FEDERATION_DISCOVERY = false
@@ -260,6 +362,7 @@ TOOL_TIMEOUT=60
260
362
MAX_TOOL_RETRIES = 3
261
363
TOOL_RATE_LIMIT = 100
262
364
TOOL_CONCURRENT_LIMIT = 10
365
+ GATEWAY_TOOL_NAME_SEPARATOR = -
263
366
264
367
# Prompt Configuration
265
368
PROMPT_CACHE_SIZE = 100
@@ -270,14 +373,22 @@ PROMPT_RENDER_TIMEOUT=10
270
373
HEALTH_CHECK_INTERVAL = 60
271
374
HEALTH_CHECK_TIMEOUT = 10
272
375
UNHEALTHY_THRESHOLD = 5
376
+ GATEWAY_VALIDATION_TIMEOUT = 5
273
377
274
378
# OpenTelemetry Configuration
275
379
OTEL_ENABLE_OBSERVABILITY = true
276
380
OTEL_TRACES_EXPORTER = otlp
277
381
OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317
278
382
OTEL_EXPORTER_OTLP_PROTOCOL = grpc
279
383
OTEL_EXPORTER_OTLP_INSECURE = true
384
+ # OTEL_EXPORTER_OTLP_HEADERS=key1=value1,key2=value2
385
+ # OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces
386
+ # OTEL_EXPORTER_ZIPKIN_ENDPOINT=http://localhost:9411/api/v2/spans
280
387
OTEL_SERVICE_NAME = mcp-gateway
388
+ # OTEL_RESOURCE_ATTRIBUTES=service.version=1.0.0,environment=production
389
+ OTEL_BSP_MAX_QUEUE_SIZE = 2048
390
+ OTEL_BSP_MAX_EXPORT_BATCH_SIZE = 512
391
+ OTEL_BSP_SCHEDULE_DELAY = 5000
281
392
282
393
# Plugin Configuration
283
394
PLUGINS_ENABLED = false
@@ -331,7 +442,7 @@ WELL_KNOWN_CACHE_MAX_AGE=3600
331
442
DEV_MODE = false
332
443
RELOAD = false
333
444
DEBUG = false
334
- SKIP_SSL_VERIFY = false
445
+ # SKIP_SSL_VERIFY is already defined in Security and CORS section
335
446
336
447
# Header Passthrough (WARNING: Security implications)
337
448
ENABLE_HEADER_PASSTHROUGH = false
0 commit comments