portkey-admin-mcp 0.16.4 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ENDPOINTS.md +29 -29
- package/README.md +136 -129
- package/build/index.js +525 -262
- package/build/server.js +555 -232
- package/docs/DISTRIBUTION.md +72 -26
- package/docs/VERCEL_DEPLOYMENT.md +4 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
**The [Portkey](https://portkey.ai/) Admin API as an MCP server — 194 tools across prompts, configs, keys, analytics, governance, deployments, and more.**
|
|
8
8
|
|
|
9
|
+
Website: [portkey.codeswhat.com](https://portkey.codeswhat.com/). Docs: [portkey.codeswhat.com/docs](https://portkey.codeswhat.com/docs/).
|
|
10
|
+
|
|
9
11
|
</div>
|
|
10
12
|
|
|
11
13
|
<p align="center">
|
|
@@ -59,18 +61,18 @@
|
|
|
59
61
|
|
|
60
62
|
<h2 align="center" id="documentation">Documentation</h2>
|
|
61
63
|
|
|
62
|
-
| Resource
|
|
63
|
-
|
|
|
64
|
-
| Tool reference
|
|
65
|
-
| Compatibility and deprecations | [COMPATIBILITY.md](./COMPATIBILITY.md)
|
|
66
|
-
| Changelog
|
|
67
|
-
| Roadmap
|
|
68
|
-
| Architecture
|
|
69
|
-
| Deployment
|
|
70
|
-
| Distribution
|
|
71
|
-
| Prisma AIRS
|
|
72
|
-
| Contributing and governance
|
|
73
|
-
| Security
|
|
64
|
+
| Resource | Link |
|
|
65
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
66
|
+
| Tool reference | [ENDPOINTS.md](./ENDPOINTS.md) |
|
|
67
|
+
| Compatibility and deprecations | [COMPATIBILITY.md](./COMPATIBILITY.md) |
|
|
68
|
+
| Changelog | [CHANGELOG.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/CHANGELOG.md) |
|
|
69
|
+
| Roadmap | [ROADMAP.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/ROADMAP.md) |
|
|
70
|
+
| Architecture | [Architecture](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/ARCHITECTURE.md) |
|
|
71
|
+
| Deployment | [HTTP configuration](#http-server), [Vercel guide](./docs/VERCEL_DEPLOYMENT.md) |
|
|
72
|
+
| Distribution | [Directories and release records](./docs/DISTRIBUTION.md), [verify a release](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/VERIFY_RELEASE.md) |
|
|
73
|
+
| Prisma AIRS | [Interoperability guide](./docs/PRISMA_AIRS_INTEROPERABILITY.md) |
|
|
74
|
+
| Contributing and governance | [CONTRIBUTING.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/CONTRIBUTING.md), [GOVERNANCE.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/GOVERNANCE.md), [Code of Conduct](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/CODE_OF_CONDUCT.md) |
|
|
75
|
+
| Security | [Reporting policy](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/SECURITY.md), [assurance case](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/SECURITY-ASSURANCE.md) |
|
|
74
76
|
|
|
75
77
|
<hr>
|
|
76
78
|
|
|
@@ -95,15 +97,15 @@ Add to your MCP config (Cursor: `.cursor/mcp.json` or `~/.cursor/mcp.json`; Wind
|
|
|
95
97
|
|
|
96
98
|
```json
|
|
97
99
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"portkey-admin": {
|
|
102
|
+
"command": "npx",
|
|
103
|
+
"args": ["-y", "portkey-admin-mcp"],
|
|
104
|
+
"env": {
|
|
105
|
+
"PORTKEY_API_KEY": "your_api_key"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
107
109
|
}
|
|
108
110
|
```
|
|
109
111
|
|
|
@@ -113,19 +115,22 @@ VS Code's `.vscode/mcp.json` uses a top-level `servers` key and needs a `type`:
|
|
|
113
115
|
|
|
114
116
|
```json
|
|
115
117
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
"servers": {
|
|
119
|
+
"portkey-admin": {
|
|
120
|
+
"type": "stdio",
|
|
121
|
+
"command": "npx",
|
|
122
|
+
"args": ["-y", "portkey-admin-mcp"],
|
|
123
|
+
"env": {
|
|
124
|
+
"PORTKEY_API_KEY": "your_api_key"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
129
|
```
|
|
128
130
|
|
|
131
|
+
VS Code caps a single chat request at 128 enabled tools, and this server exposes 194.
|
|
132
|
+
Set `PORTKEY_TOOL_DOMAINS` in the server's `env` (for example `"PORTKEY_TOOL_DOMAINS": "prompts,analytics"`) to narrow the set below that limit.
|
|
133
|
+
|
|
129
134
|
### Run directly
|
|
130
135
|
|
|
131
136
|
```bash
|
|
@@ -141,8 +146,8 @@ npx -y portkey-admin-mcp
|
|
|
141
146
|
```
|
|
142
147
|
|
|
143
148
|
Scoping domains is also the biggest lever on context cost, not just access. `tools/list`
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
returns every tool in a single response with no `nextCursor`, and the complete
|
|
150
|
+
194-tool catalog is roughly 500 KB of JSON. Narrowing to the domains a client
|
|
146
151
|
actually needs cuts that roughly proportionally.
|
|
147
152
|
|
|
148
153
|
<details>
|
|
@@ -157,15 +162,15 @@ npm install && npm run build
|
|
|
157
162
|
Then use this config:
|
|
158
163
|
```json
|
|
159
164
|
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"portkey-admin": {
|
|
167
|
+
"command": "node",
|
|
168
|
+
"args": ["/path/to/portkey-admin-mcp/build/index.js"],
|
|
169
|
+
"env": {
|
|
170
|
+
"PORTKEY_API_KEY": "your_api_key"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
169
174
|
}
|
|
170
175
|
```
|
|
171
176
|
|
|
@@ -175,31 +180,31 @@ Then use this config:
|
|
|
175
180
|
|
|
176
181
|
<h2 align="center" id="what-you-can-do">What You Can Do</h2>
|
|
177
182
|
|
|
178
|
-
| Category
|
|
179
|
-
|
|
180
|
-
| **Prompts**
|
|
181
|
-
| **Prompt Partials**
|
|
182
|
-
| **Prompt Labels**
|
|
183
|
-
| **Configs**
|
|
184
|
-
| **Deployments**
|
|
185
|
-
| **API Keys**
|
|
186
|
-
| **Secret References**
|
|
187
|
-
| **Virtual Keys**
|
|
188
|
-
| **Collections**
|
|
189
|
-
| **Providers**
|
|
190
|
-
| **Integrations**
|
|
191
|
-
| **MCP Integrations**
|
|
192
|
-
| **MCP Servers**
|
|
193
|
-
| **Guardrails**
|
|
194
|
-
| **Access Policies**
|
|
195
|
-
| **Egress Allowlist**
|
|
196
|
-
| **Usage Limits**
|
|
197
|
-
| **Rate Limits**
|
|
198
|
-
| **Analytics**
|
|
199
|
-
| **Logging**
|
|
200
|
-
| **Tracing**
|
|
201
|
-
| **Users & Workspaces** | 24
|
|
202
|
-
| **Audit**
|
|
183
|
+
| Category | Tools | Examples |
|
|
184
|
+
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| **Prompts** | 14 | Create, version, render, execute, migrate, promote prompts |
|
|
186
|
+
| **Prompt Partials** | 7 | Reusable prompt fragments with versioning |
|
|
187
|
+
| **Prompt Labels** | 5 | Organize prompt versions (production, staging, dev) |
|
|
188
|
+
| **Configs** | 6 | Gateway routing, caching, retry, loadbalancing |
|
|
189
|
+
| **Deployments** | 5 | Register, inspect, update, and archive self-hosted Gateways |
|
|
190
|
+
| **API Keys** | 6 | Create, rotate, and manage scoped API keys |
|
|
191
|
+
| **Secret References** | 5 | Manage AWS, Azure, and HashiCorp external-secret references |
|
|
192
|
+
| **Virtual Keys** | 5 | Manage provider access keys |
|
|
193
|
+
| **Collections** | 5 | Group prompts by app or project |
|
|
194
|
+
| **Providers** | 5 | Manage AI provider configurations |
|
|
195
|
+
| **Integrations** | 11 | Provider integrations, model pricing, models, workspace access |
|
|
196
|
+
| **MCP Integrations** | 10 | External MCP tool integrations |
|
|
197
|
+
| **MCP Servers** | 12 | MCP server registry, capabilities, and live connections |
|
|
198
|
+
| **Guardrails** | 14 | LLM and MCP-tool policies, server mappings, organisation defaults, workspace exclusions |
|
|
199
|
+
| **Access Policies** | 5 | Allow/deny users, groups, and agents access to MCP tools and provider models |
|
|
200
|
+
| **Egress Allowlist** | 5 | Organisation trust for custom outbound hosts |
|
|
201
|
+
| **Usage Limits** | 7 | Cost and token consumption limits |
|
|
202
|
+
| **Rate Limits** | 5 | Request frequency controls |
|
|
203
|
+
| **Analytics** | 25 | Cost, latency, errors, tokens, cache, feedback, provider, MCP, A2A, and workspace groups; organisation scope and workspace exclusions |
|
|
204
|
+
| **Logging** | 10 | Log retrieval, ingestion, export, and field restrictions |
|
|
205
|
+
| **Tracing** | 2 | Feedback creation and updates on traces |
|
|
206
|
+
| **Users & Workspaces** | 24 | User management, invites, workspace members, SCIM group mappings |
|
|
207
|
+
| **Audit** | 1 | Audit log access |
|
|
203
208
|
|
|
204
209
|
**194 tools total across 22 tool domains.** See [ENDPOINTS.md](./ENDPOINTS.md) for the full list with descriptions.
|
|
205
210
|
|
|
@@ -223,23 +228,23 @@ If a tool returns a `403` with Portkey error `AB03`, it means missing scopes —
|
|
|
223
228
|
|
|
224
229
|
The following tools require an **organisation-level scope that is only available on Portkey Enterprise plans**. They return `403 You do not have enough permissions to execute this request` on workspace plans. Their descriptions include an `Enterprise-gated. Returns 403 on non-Enterprise Portkey plans.` suffix so MCP clients know upfront.
|
|
225
230
|
|
|
226
|
-
| Area
|
|
227
|
-
|
|
228
|
-
| Analytics (25)
|
|
229
|
-
| Deployments (5)
|
|
230
|
-
| Audit
|
|
231
|
-
| Org-level integrations
|
|
232
|
-
| Org-level users
|
|
233
|
-
| Organisation guardrails (6) | `get_organisation_defaults`, `update_organisation_defaults`, `list_input_guardrail_workspace_exclusions`, `update_input_guardrail_workspace_exclusions`, `list_output_guardrail_workspace_exclusions`, `update_output_guardrail_workspace_exclusions`
|
|
234
|
-
| Log exports (8)
|
|
235
|
-
| SCIM groups (4)
|
|
231
|
+
| Area | Tools | Required scope |
|
|
232
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
233
|
+
| Analytics (25) | `get_cost_analytics`, `get_request_analytics`, `get_token_analytics`, `get_latency_analytics`, `get_error_analytics`, `get_error_rate_analytics`, `get_cache_hit_latency`, `get_cache_hit_rate`, `get_cache_summary`, `get_users_analytics`, `get_error_stacks_analytics`, `get_error_status_codes_analytics`, `get_user_requests_analytics`, `get_rescued_requests_analytics`, `get_feedback_analytics`, `get_feedback_models_analytics`, `get_feedback_scores_analytics`, `get_feedback_weighted_analytics`, `get_analytics_group_users`, `get_analytics_group_models`, `get_analytics_group_metadata`, `get_analytics_group_providers`, `get_analytics_group_mcp`, `get_analytics_group_a2a`, `get_analytics_group_workspaces` | org-level `analytics.view` |
|
|
234
|
+
| Deployments (5) | `list_deployments`, `register_deployment`, `get_deployment`, `update_deployment`, `archive_deployment` | Enterprise deployment administration |
|
|
235
|
+
| Audit | `list_audit_logs` | `audit_logs.list` |
|
|
236
|
+
| Org-level integrations | `get_integration`, `list_integration_models`, `list_integration_workspaces` | `organisation_integrations.read` |
|
|
237
|
+
| Org-level users | `list_all_users`, `get_user`, `get_user_stats`, `list_user_invites` | `organisation_users.list` / `organisation_users.read` |
|
|
238
|
+
| Organisation guardrails (6) | `get_organisation_defaults`, `update_organisation_defaults`, `list_input_guardrail_workspace_exclusions`, `update_input_guardrail_workspace_exclusions`, `list_output_guardrail_workspace_exclusions`, `update_output_guardrail_workspace_exclusions` | `organisation_settings.read/update` and `organisation_exclusions.list/update` |
|
|
239
|
+
| Log exports (8) | `create_log_export`, `list_log_exports`, `get_log_export`, `start_log_export`, `cancel_log_export`, `download_log_export`, `update_log_export`, `get_log_export_field_restrictions` | Enterprise Logs Export + `logs.export` |
|
|
240
|
+
| SCIM groups (4) | `list_scim_groups`, `list_scim_workspace_mappings`, `create_scim_workspace_mapping`, `delete_scim_workspace_mapping` | SCIM enabled + organisation admin access |
|
|
236
241
|
|
|
237
242
|
### Other scope requirements
|
|
238
243
|
|
|
239
|
-
| Feature
|
|
240
|
-
|
|
241
|
-
| Prompt completions (`run_prompt_completion`)
|
|
242
|
-
| Org-level service API key creation via `create_api_key` | `organisation_service_api_keys.create` (Enterprise)
|
|
244
|
+
| Feature | Required |
|
|
245
|
+
| ------------------------------------------------------- | ----------------------------------------------------------- |
|
|
246
|
+
| Prompt completions (`run_prompt_completion`) | `completions.write` scope + billing metadata (`app`, `env`) |
|
|
247
|
+
| Org-level service API key creation via `create_api_key` | `organisation_service_api_keys.create` (Enterprise) |
|
|
243
248
|
|
|
244
249
|
</details>
|
|
245
250
|
|
|
@@ -278,49 +283,51 @@ For local-only HTTP use, leave `MCP_HOST` at its default `127.0.0.1`. Set `MCP_H
|
|
|
278
283
|
<details>
|
|
279
284
|
<summary><strong>Full environment variable reference</strong></summary>
|
|
280
285
|
|
|
281
|
-
| Variable
|
|
282
|
-
|
|
283
|
-
| `PORTKEY_API_KEY`
|
|
284
|
-
| `PORTKEY_BASE_URL`
|
|
285
|
-
| `PORTKEY_ALLOW_PRIVATE_BASE_URL`
|
|
286
|
-
| `PORTKEY_ALLOW_INSECURE_HTTP`
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
299
|
-
| `
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
302
|
-
| `
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
305
|
-
| `
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `
|
|
317
|
-
| `
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
| `
|
|
286
|
+
| Variable | Default | Description |
|
|
287
|
+
| -------------------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
288
|
+
| `PORTKEY_API_KEY` | (required) | Your Portkey API key |
|
|
289
|
+
| `PORTKEY_BASE_URL` | `https://api.portkey.ai/v1` | Portkey Admin API base URL. Prisma AIRS/SCM URLs are not compatible; credentialed requests never auto-follow redirects |
|
|
290
|
+
| `PORTKEY_ALLOW_PRIVATE_BASE_URL` | — | Set to `true` to allow a literal loopback/private `PORTKEY_BASE_URL` |
|
|
291
|
+
| `PORTKEY_ALLOW_INSECURE_HTTP` | — | Separately set to `true` only when a trusted self-hosted gateway cannot use HTTPS |
|
|
292
|
+
| `PORTKEY_MAX_UPSTREAM_BODY_BYTES` | `8388608` (8 MiB) | Largest Portkey API response body the server will read. A larger response fails the call with an explicit error instead of being truncated. Positive integer, up to 1073741824 |
|
|
293
|
+
| `PORTKEY_MAX_TOOL_RESULT_BYTES` | `4194304` (4 MiB) | Largest serialized tool result the server will return, counting the text block (JSON-escaped) and `structuredContent`. A larger result is replaced by an explicit error that says how to narrow the request. Positive integer, up to 1073741824 |
|
|
294
|
+
| `PORTKEY_TOOL_DOMAINS` | — | Server-side allowlist of the 22 domains: `users`, `workspaces`, `configs`, `deployments`, `keys`, `collections`, `prompts`, `analytics`, `guardrails`, `limits`, `audit`, `labels`, `partials`, `tracing`, `logging`, `providers`, `secret-references`, `integrations`, `mcp-integrations`, `mcp-servers`, `access-policies`, `egress-allowlist`. HTTP `?tools=` may narrow it but cannot expand it |
|
|
295
|
+
| `MCP_TOOL_DOMAINS` | — | Fallback for `PORTKEY_TOOL_DOMAINS`, used only when that is unset |
|
|
296
|
+
| `MCP_TRANSPORT` | `stdio` | `stdio` or `http`; the Docker image picks its entrypoint from this (set `http` for the HTTP server) |
|
|
297
|
+
| `MCP_HOST` | `127.0.0.1` | Bind address |
|
|
298
|
+
| `MCP_PORT` | `3000` | Port |
|
|
299
|
+
| `PORT` | — | Port override; takes precedence over `MCP_PORT` when set |
|
|
300
|
+
| `MCP_PUBLIC_BASE_URL` | — | Public absolute base URL to advertise from `/auth/info` and the status page; recommended for hosted deployments |
|
|
301
|
+
| `MCP_AUTH_MODE` | `none` | `none`, `bearer`, or `clerk` (`none` is blocked for HTTP unless explicitly overridden) |
|
|
302
|
+
| `MCP_AUTH_TOKEN` | — | Secret for bearer auth |
|
|
303
|
+
| `CLERK_ISSUER` / `CLERK_AUDIENCE` | — | Required issuer and audience when `MCP_AUTH_MODE=clerk` |
|
|
304
|
+
| `CLERK_JWKS_URL` | `<CLERK_ISSUER>/.well-known/jwks.json` | JWKS endpoint for Clerk JWT verification; must be HTTPS. Set it only when the JWKS isn't at the default path |
|
|
305
|
+
| `CLERK_ALLOWED_SUBJECTS` | — | CSV subject allowlist for Clerk. Clerk mode requires this or `CLERK_ALLOWED_ORGANIZATION_IDS` |
|
|
306
|
+
| `CLERK_ALLOWED_ORGANIZATION_IDS` / `CLERK_ALLOWED_ROLES` | — | CSV organization and role constraints. Organization IDs can satisfy the identity requirement on their own; roles can only narrow it. Every configured constraint must match |
|
|
307
|
+
| `CLERK_REQUIRED_PERMISSIONS` | — | Optional CSV permissions that must all be present in the verified Clerk JWT. Can only narrow the policy, not satisfy the identity requirement |
|
|
308
|
+
| `MCP_ALLOW_UNAUTHENTICATED_HTTP` | — | Set to `true` only for intentional local unauthenticated HTTP debugging |
|
|
309
|
+
| `MCP_MAX_SESSIONS` | `100` | Maximum concurrent HTTP MCP request handlers (retained name) |
|
|
310
|
+
| `MCP_REDIS_URL` | — | Fallback Redis URL for shared rate limiting, after `RATE_LIMIT_REDIS_URL` and before `REDIS_URL`; production requires `rediss://` |
|
|
311
|
+
| `MCP_SESSION_MODE`, `MCP_SESSION_TIMEOUT`, `MCP_EVENT_*`, `MCP_REDIS_KEY_PREFIX` | Ignored as of 0.15.0 | Old session/replay settings produce a warning containing names only. 0.14.x behavior is unchanged; see [compatibility](./COMPATIBILITY.md). |
|
|
312
|
+
| `MCP_TLS_KEY_PATH` | — | TLS key for native HTTPS |
|
|
313
|
+
| `MCP_TLS_CERT_PATH` | — | TLS cert for native HTTPS |
|
|
314
|
+
| `MCP_TLS_CA_PATH` | — | Optional CA bundle for native HTTPS; only used when the TLS key and cert are set |
|
|
315
|
+
| `MCP_SHUTDOWN_TIMEOUT_MS` | `10000` | How long graceful shutdown waits before the process is forced to exit, in milliseconds; must be positive |
|
|
316
|
+
| `MCP_MAX_REQUEST_SIZE` | `1mb` | Maximum HTTP request body size; tool arguments also have a fixed budget of 10,000 array elements and object members, counted across nested input |
|
|
317
|
+
| `MCP_READY_CHECK_MODE` | `local` | `local` or `portkey`; `portkey` makes `/ready` also check Portkey connectivity |
|
|
318
|
+
| `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, or `error` |
|
|
319
|
+
| `ALLOWED_ORIGINS` | — | CORS allow-list; also used to validate the `Host` header (DNS-rebinding protection) when `MCP_AUTH_MODE=none` |
|
|
320
|
+
| `CORS_ORIGIN` | — | Legacy fallback for `ALLOWED_ORIGINS`, used only when that is unset |
|
|
321
|
+
| `MCP_TRUST_PROXY` | `loopback` | Express trust-proxy policy. Use an exact nonnegative hop count or trusted proxy subnet; `true` is rejected because it trusts forwarding headers from every peer |
|
|
322
|
+
| `RATE_LIMIT_STORE` | `memory` | `redis` for multi-instance/serverless deployments; production memory mode requires `RATE_LIMIT_SINGLE_PROCESS=true` |
|
|
323
|
+
| `RATE_LIMIT_ENABLED` | `true` | Set to `false` to turn the pre-authentication rate limiter off |
|
|
324
|
+
| `RATE_LIMIT_SINGLE_PROCESS` | — | Set to `true` to acknowledge a single-process deployment when using in-memory limiting in production |
|
|
325
|
+
| `RATE_LIMIT_REDIS_URL` | — | Shared limiter Redis URL, falling back to `MCP_REDIS_URL`/`REDIS_URL`; production requires `rediss://` |
|
|
326
|
+
| `RATE_LIMIT_REDIS_KEY_PREFIX` | `mcp:rate-limit` | Redis namespace for atomic pre-authentication IP and principal-plus-IP token buckets |
|
|
327
|
+
| `RATE_LIMIT_MAX` | `60` | Maximum tokens in each pre-authentication IP and principal-plus-IP bucket |
|
|
328
|
+
| `RATE_LIMIT_WINDOW_MS` | `60000` | Rate-limit window in milliseconds |
|
|
329
|
+
| `RATE_LIMIT_REFILL` | `60` | Tokens refilled each window |
|
|
330
|
+
| `RATE_LIMIT_MAX_BUCKETS` | `10000` | Maximum local buckets in explicit memory mode before new clients share overflow capacity |
|
|
324
331
|
|
|
325
332
|
Production containers must choose their rate-limit topology explicitly: set
|
|
326
333
|
`RATE_LIMIT_STORE=redis` for multi-instance deployments, or set
|
|
@@ -366,11 +373,11 @@ This example runs one long-lived container with in-memory rate limiting. Use
|
|
|
366
373
|
|
|
367
374
|
### Health Endpoints
|
|
368
375
|
|
|
369
|
-
| Path
|
|
370
|
-
|
|
371
|
-
| `GET /health`
|
|
372
|
-
| `GET /ready`
|
|
373
|
-
| `GET /auth/info` | Auth configuration metadata
|
|
376
|
+
| Path | Purpose |
|
|
377
|
+
| ---------------- | -------------------------------------------------------- |
|
|
378
|
+
| `GET /health` | Server liveness |
|
|
379
|
+
| `GET /ready` | Readiness (includes optional Portkey connectivity check) |
|
|
380
|
+
| `GET /auth/info` | Auth configuration metadata |
|
|
374
381
|
|
|
375
382
|
<hr>
|
|
376
383
|
|