portkey-admin-mcp 0.16.4 → 0.16.5

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/README.md CHANGED
@@ -59,18 +59,18 @@
59
59
 
60
60
  <h2 align="center" id="documentation">Documentation</h2>
61
61
 
62
- | Resource | Link |
63
- | --- | --- |
64
- | Tool reference | [ENDPOINTS.md](./ENDPOINTS.md) |
65
- | Compatibility and deprecations | [COMPATIBILITY.md](./COMPATIBILITY.md) |
66
- | Changelog | [CHANGELOG.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/CHANGELOG.md) |
67
- | Roadmap | [ROADMAP.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/ROADMAP.md) |
68
- | Architecture | [Architecture](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/ARCHITECTURE.md) |
69
- | Deployment | [HTTP configuration](#http-server), [Vercel guide](./docs/VERCEL_DEPLOYMENT.md) |
70
- | Distribution | [Directories and release records](./docs/DISTRIBUTION.md), [verify a release](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/VERIFY_RELEASE.md) |
71
- | Prisma AIRS | [Interoperability guide](./docs/PRISMA_AIRS_INTEROPERABILITY.md) |
72
- | 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) |
73
- | 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) |
62
+ | Resource | Link |
63
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
64
+ | Tool reference | [ENDPOINTS.md](./ENDPOINTS.md) |
65
+ | Compatibility and deprecations | [COMPATIBILITY.md](./COMPATIBILITY.md) |
66
+ | Changelog | [CHANGELOG.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/CHANGELOG.md) |
67
+ | Roadmap | [ROADMAP.md](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/ROADMAP.md) |
68
+ | Architecture | [Architecture](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/ARCHITECTURE.md) |
69
+ | Deployment | [HTTP configuration](#http-server), [Vercel guide](./docs/VERCEL_DEPLOYMENT.md) |
70
+ | Distribution | [Directories and release records](./docs/DISTRIBUTION.md), [verify a release](https://github.com/CodesWhat/portkey-admin-mcp/blob/main/docs/VERIFY_RELEASE.md) |
71
+ | Prisma AIRS | [Interoperability guide](./docs/PRISMA_AIRS_INTEROPERABILITY.md) |
72
+ | 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) |
73
+ | 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
74
 
75
75
  <hr>
76
76
 
@@ -95,15 +95,15 @@ Add to your MCP config (Cursor: `.cursor/mcp.json` or `~/.cursor/mcp.json`; Wind
95
95
 
96
96
  ```json
97
97
  {
98
- "mcpServers": {
99
- "portkey-admin": {
100
- "command": "npx",
101
- "args": ["-y", "portkey-admin-mcp"],
102
- "env": {
103
- "PORTKEY_API_KEY": "your_api_key"
104
- }
105
- }
106
- }
98
+ "mcpServers": {
99
+ "portkey-admin": {
100
+ "command": "npx",
101
+ "args": ["-y", "portkey-admin-mcp"],
102
+ "env": {
103
+ "PORTKEY_API_KEY": "your_api_key"
104
+ }
105
+ }
106
+ }
107
107
  }
108
108
  ```
109
109
 
@@ -113,19 +113,22 @@ VS Code's `.vscode/mcp.json` uses a top-level `servers` key and needs a `type`:
113
113
 
114
114
  ```json
115
115
  {
116
- "servers": {
117
- "portkey-admin": {
118
- "type": "stdio",
119
- "command": "npx",
120
- "args": ["-y", "portkey-admin-mcp"],
121
- "env": {
122
- "PORTKEY_API_KEY": "your_api_key"
123
- }
124
- }
125
- }
116
+ "servers": {
117
+ "portkey-admin": {
118
+ "type": "stdio",
119
+ "command": "npx",
120
+ "args": ["-y", "portkey-admin-mcp"],
121
+ "env": {
122
+ "PORTKEY_API_KEY": "your_api_key"
123
+ }
124
+ }
125
+ }
126
126
  }
127
127
  ```
128
128
 
129
+ VS Code caps a single chat request at 128 enabled tools, and this server exposes 194.
130
+ Set `PORTKEY_TOOL_DOMAINS` in the server's `env` (for example `"PORTKEY_TOOL_DOMAINS": "prompts,analytics"`) to narrow the set below that limit.
131
+
129
132
  ### Run directly
130
133
 
131
134
  ```bash
@@ -141,8 +144,8 @@ npx -y portkey-admin-mcp
141
144
  ```
142
145
 
143
146
  Scoping domains is also the biggest lever on context cost, not just access. `tools/list`
144
- is paginated, and the complete 194-tool catalog is roughly 400 KB once a
145
- client follows `nextCursor` through every page. Narrowing to the domains a client
147
+ returns every tool in a single response with no `nextCursor`, and the complete
148
+ 194-tool catalog is roughly 500 KB of JSON. Narrowing to the domains a client
146
149
  actually needs cuts that roughly proportionally.
147
150
 
148
151
  <details>
@@ -157,15 +160,15 @@ npm install && npm run build
157
160
  Then use this config:
158
161
  ```json
159
162
  {
160
- "mcpServers": {
161
- "portkey-admin": {
162
- "command": "node",
163
- "args": ["/path/to/portkey-admin-mcp/build/index.js"],
164
- "env": {
165
- "PORTKEY_API_KEY": "your_api_key"
166
- }
167
- }
168
- }
163
+ "mcpServers": {
164
+ "portkey-admin": {
165
+ "command": "node",
166
+ "args": ["/path/to/portkey-admin-mcp/build/index.js"],
167
+ "env": {
168
+ "PORTKEY_API_KEY": "your_api_key"
169
+ }
170
+ }
171
+ }
169
172
  }
170
173
  ```
171
174
 
@@ -175,31 +178,31 @@ Then use this config:
175
178
 
176
179
  <h2 align="center" id="what-you-can-do">What You Can Do</h2>
177
180
 
178
- | Category | Tools | Examples |
179
- |----------|-------|---------|
180
- | **Prompts** | 14 | Create, version, render, execute, migrate, promote prompts |
181
- | **Prompt Partials** | 7 | Reusable prompt fragments with versioning |
182
- | **Prompt Labels** | 5 | Organize prompt versions (production, staging, dev) |
183
- | **Configs** | 6 | Gateway routing, caching, retry, loadbalancing |
184
- | **Deployments** | 5 | Register, inspect, update, and archive self-hosted Gateways |
185
- | **API Keys** | 6 | Create, rotate, and manage scoped API keys |
186
- | **Secret References** | 5 | Manage AWS, Azure, and HashiCorp external-secret references |
187
- | **Virtual Keys** | 5 | Manage provider access keys |
188
- | **Collections** | 5 | Group prompts by app or project |
189
- | **Providers** | 5 | Manage AI provider configurations |
190
- | **Integrations** | 11 | Provider integrations, model pricing, models, workspace access |
191
- | **MCP Integrations** | 10 | External MCP tool integrations |
192
- | **MCP Servers** | 12 | MCP server registry, capabilities, and live connections |
193
- | **Guardrails** | 14 | LLM and MCP-tool policies, server mappings, organisation defaults, workspace exclusions |
194
- | **Access Policies** | 5 | Allow/deny users, groups, and agents access to MCP tools and provider models |
195
- | **Egress Allowlist** | 5 | Organisation trust for custom outbound hosts |
196
- | **Usage Limits** | 7 | Cost and token consumption limits |
197
- | **Rate Limits** | 5 | Request frequency controls |
198
- | **Analytics** | 25 | Cost, latency, errors, tokens, cache, feedback, provider, MCP, A2A, and workspace groups; organisation scope and workspace exclusions |
199
- | **Logging** | 10 | Log retrieval, ingestion, export, and field restrictions |
200
- | **Tracing** | 2 | Feedback creation and updates on traces |
201
- | **Users & Workspaces** | 24 | User management, invites, workspace members, SCIM group mappings |
202
- | **Audit** | 1 | Audit log access |
181
+ | Category | Tools | Examples |
182
+ | ---------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------- |
183
+ | **Prompts** | 14 | Create, version, render, execute, migrate, promote prompts |
184
+ | **Prompt Partials** | 7 | Reusable prompt fragments with versioning |
185
+ | **Prompt Labels** | 5 | Organize prompt versions (production, staging, dev) |
186
+ | **Configs** | 6 | Gateway routing, caching, retry, loadbalancing |
187
+ | **Deployments** | 5 | Register, inspect, update, and archive self-hosted Gateways |
188
+ | **API Keys** | 6 | Create, rotate, and manage scoped API keys |
189
+ | **Secret References** | 5 | Manage AWS, Azure, and HashiCorp external-secret references |
190
+ | **Virtual Keys** | 5 | Manage provider access keys |
191
+ | **Collections** | 5 | Group prompts by app or project |
192
+ | **Providers** | 5 | Manage AI provider configurations |
193
+ | **Integrations** | 11 | Provider integrations, model pricing, models, workspace access |
194
+ | **MCP Integrations** | 10 | External MCP tool integrations |
195
+ | **MCP Servers** | 12 | MCP server registry, capabilities, and live connections |
196
+ | **Guardrails** | 14 | LLM and MCP-tool policies, server mappings, organisation defaults, workspace exclusions |
197
+ | **Access Policies** | 5 | Allow/deny users, groups, and agents access to MCP tools and provider models |
198
+ | **Egress Allowlist** | 5 | Organisation trust for custom outbound hosts |
199
+ | **Usage Limits** | 7 | Cost and token consumption limits |
200
+ | **Rate Limits** | 5 | Request frequency controls |
201
+ | **Analytics** | 25 | Cost, latency, errors, tokens, cache, feedback, provider, MCP, A2A, and workspace groups; organisation scope and workspace exclusions |
202
+ | **Logging** | 10 | Log retrieval, ingestion, export, and field restrictions |
203
+ | **Tracing** | 2 | Feedback creation and updates on traces |
204
+ | **Users & Workspaces** | 24 | User management, invites, workspace members, SCIM group mappings |
205
+ | **Audit** | 1 | Audit log access |
203
206
 
204
207
  **194 tools total across 22 tool domains.** See [ENDPOINTS.md](./ENDPOINTS.md) for the full list with descriptions.
205
208
 
@@ -223,23 +226,23 @@ If a tool returns a `403` with Portkey error `AB03`, it means missing scopes —
223
226
 
224
227
  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
228
 
226
- | Area | Tools | Required scope |
227
- |---|---|---|
228
- | 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` |
229
- | Deployments (5) | `list_deployments`, `register_deployment`, `get_deployment`, `update_deployment`, `archive_deployment` | Enterprise deployment administration |
230
- | Audit | `list_audit_logs` | `audit_logs.list` |
231
- | Org-level integrations | `get_integration`, `list_integration_models`, `list_integration_workspaces` | `organisation_integrations.read` |
232
- | Org-level users | `list_all_users`, `get_user`, `get_user_stats`, `list_user_invites` | `organisation_users.list` / `organisation_users.read` |
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` | `organisation_settings.read/update` and `organisation_exclusions.list/update` |
234
- | 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` |
235
- | SCIM groups (4) | `list_scim_groups`, `list_scim_workspace_mappings`, `create_scim_workspace_mapping`, `delete_scim_workspace_mapping` | SCIM enabled + organisation admin access |
229
+ | Area | Tools | Required scope |
230
+ | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
231
+ | 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` |
232
+ | Deployments (5) | `list_deployments`, `register_deployment`, `get_deployment`, `update_deployment`, `archive_deployment` | Enterprise deployment administration |
233
+ | Audit | `list_audit_logs` | `audit_logs.list` |
234
+ | Org-level integrations | `get_integration`, `list_integration_models`, `list_integration_workspaces` | `organisation_integrations.read` |
235
+ | Org-level users | `list_all_users`, `get_user`, `get_user_stats`, `list_user_invites` | `organisation_users.list` / `organisation_users.read` |
236
+ | 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` |
237
+ | 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` |
238
+ | SCIM groups (4) | `list_scim_groups`, `list_scim_workspace_mappings`, `create_scim_workspace_mapping`, `delete_scim_workspace_mapping` | SCIM enabled + organisation admin access |
236
239
 
237
240
  ### Other scope requirements
238
241
 
239
- | Feature | Required |
240
- |---------|----------|
241
- | Prompt completions (`run_prompt_completion`) | `completions.write` scope + billing metadata (`app`, `env`) |
242
- | Org-level service API key creation via `create_api_key` | `organisation_service_api_keys.create` (Enterprise) |
242
+ | Feature | Required |
243
+ | ------------------------------------------------------- | ----------------------------------------------------------- |
244
+ | Prompt completions (`run_prompt_completion`) | `completions.write` scope + billing metadata (`app`, `env`) |
245
+ | Org-level service API key creation via `create_api_key` | `organisation_service_api_keys.create` (Enterprise) |
243
246
 
244
247
  </details>
245
248
 
@@ -278,49 +281,51 @@ For local-only HTTP use, leave `MCP_HOST` at its default `127.0.0.1`. Set `MCP_H
278
281
  <details>
279
282
  <summary><strong>Full environment variable reference</strong></summary>
280
283
 
281
- | Variable | Default | Description |
282
- |----------|---------|-------------|
283
- | `PORTKEY_API_KEY` | (required) | Your Portkey API key |
284
- | `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 |
285
- | `PORTKEY_ALLOW_PRIVATE_BASE_URL` | — | Set to `true` to allow a literal loopback/private `PORTKEY_BASE_URL` |
286
- | `PORTKEY_ALLOW_INSECURE_HTTP` | — | Separately set to `true` only when a trusted self-hosted gateway cannot use HTTPS |
287
- | `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 |
288
- | `MCP_TOOL_DOMAINS` | — | Fallback for `PORTKEY_TOOL_DOMAINS`, used only when that is unset |
289
- | `MCP_TRANSPORT` | `stdio` | `stdio` or `http`; the Docker image picks its entrypoint from this (set `http` for the HTTP server) |
290
- | `MCP_HOST` | `127.0.0.1` | Bind address |
291
- | `MCP_PORT` | `3000` | Port |
292
- | `PORT` | — | Port override; takes precedence over `MCP_PORT` when set |
293
- | `MCP_PUBLIC_BASE_URL` | — | Public absolute base URL to advertise from `/auth/info` and the status page; recommended for hosted deployments |
294
- | `MCP_AUTH_MODE` | `none` | `none`, `bearer`, or `clerk` (`none` is blocked for HTTP unless explicitly overridden) |
295
- | `MCP_AUTH_TOKEN` | — | Secret for bearer auth |
296
- | `CLERK_ISSUER` / `CLERK_AUDIENCE` | — | Required issuer and audience when `MCP_AUTH_MODE=clerk` |
297
- | `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 |
298
- | `CLERK_ALLOWED_SUBJECTS` | — | Optional CSV subject allowlist for Clerk; at least one Clerk authorization policy is required |
299
- | `CLERK_ALLOWED_ORGANIZATION_IDS` / `CLERK_ALLOWED_ROLES` | — | Optional CSV organization and role constraints; every configured constraint must match |
300
- | `CLERK_REQUIRED_PERMISSIONS` | — | Optional CSV permissions that must all be present in the verified Clerk JWT |
301
- | `MCP_ALLOW_UNAUTHENTICATED_HTTP` | — | Set to `true` only for intentional local unauthenticated HTTP debugging |
302
- | `MCP_MAX_SESSIONS` | `100` | Maximum concurrent HTTP MCP request handlers (retained name) |
303
- | `MCP_REDIS_URL` | — | Fallback Redis URL for shared rate limiting, after `RATE_LIMIT_REDIS_URL` and before `REDIS_URL`; production requires `rediss://` |
304
- | `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). |
305
- | `MCP_TLS_KEY_PATH` | — | TLS key for native HTTPS |
306
- | `MCP_TLS_CERT_PATH` | — | TLS cert for native HTTPS |
307
- | `MCP_TLS_CA_PATH` | — | Optional CA bundle for native HTTPS; only used when the TLS key and cert are set |
308
- | `MCP_SHUTDOWN_TIMEOUT_MS` | `10000` | How long graceful shutdown waits before the process is forced to exit, in milliseconds; must be positive |
309
- | `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 |
310
- | `MCP_READY_CHECK_MODE` | `local` | `local` or `portkey`; `portkey` makes `/ready` also check Portkey connectivity |
311
- | `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, or `error` |
312
- | `ALLOWED_ORIGINS` | — | CORS allow-list; also used to validate the `Host` header (DNS-rebinding protection) when `MCP_AUTH_MODE=none` |
313
- | `CORS_ORIGIN` | — | Legacy fallback for `ALLOWED_ORIGINS`, used only when that is unset |
314
- | `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 |
315
- | `RATE_LIMIT_STORE` | `memory` | `redis` for multi-instance/serverless deployments; production memory mode requires `RATE_LIMIT_SINGLE_PROCESS=true` |
316
- | `RATE_LIMIT_ENABLED` | `true` | Set to `false` to turn the pre-authentication rate limiter off |
317
- | `RATE_LIMIT_SINGLE_PROCESS` | — | Set to `true` to acknowledge a single-process deployment when using in-memory limiting in production |
318
- | `RATE_LIMIT_REDIS_URL` | — | Shared limiter Redis URL, falling back to `MCP_REDIS_URL`/`REDIS_URL`; production requires `rediss://` |
319
- | `RATE_LIMIT_REDIS_KEY_PREFIX` | `mcp:rate-limit` | Redis namespace for atomic pre-authentication IP and principal-plus-IP token buckets |
320
- | `RATE_LIMIT_MAX` | `60` | Maximum tokens in each pre-authentication IP and principal-plus-IP bucket |
321
- | `RATE_LIMIT_WINDOW_MS` | `60000` | Rate-limit window in milliseconds |
322
- | `RATE_LIMIT_REFILL` | `60` | Tokens refilled each window |
323
- | `RATE_LIMIT_MAX_BUCKETS` | `10000` | Maximum local buckets in explicit memory mode before new clients share overflow capacity |
284
+ | Variable | Default | Description |
285
+ | -------------------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
286
+ | `PORTKEY_API_KEY` | (required) | Your Portkey API key |
287
+ | `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 |
288
+ | `PORTKEY_ALLOW_PRIVATE_BASE_URL` | — | Set to `true` to allow a literal loopback/private `PORTKEY_BASE_URL` |
289
+ | `PORTKEY_ALLOW_INSECURE_HTTP` | — | Separately set to `true` only when a trusted self-hosted gateway cannot use HTTPS |
290
+ | `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 |
291
+ | `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 |
292
+ | `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 |
293
+ | `MCP_TOOL_DOMAINS` | — | Fallback for `PORTKEY_TOOL_DOMAINS`, used only when that is unset |
294
+ | `MCP_TRANSPORT` | `stdio` | `stdio` or `http`; the Docker image picks its entrypoint from this (set `http` for the HTTP server) |
295
+ | `MCP_HOST` | `127.0.0.1` | Bind address |
296
+ | `MCP_PORT` | `3000` | Port |
297
+ | `PORT` | — | Port override; takes precedence over `MCP_PORT` when set |
298
+ | `MCP_PUBLIC_BASE_URL` | — | Public absolute base URL to advertise from `/auth/info` and the status page; recommended for hosted deployments |
299
+ | `MCP_AUTH_MODE` | `none` | `none`, `bearer`, or `clerk` (`none` is blocked for HTTP unless explicitly overridden) |
300
+ | `MCP_AUTH_TOKEN` | — | Secret for bearer auth |
301
+ | `CLERK_ISSUER` / `CLERK_AUDIENCE` | — | Required issuer and audience when `MCP_AUTH_MODE=clerk` |
302
+ | `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 |
303
+ | `CLERK_ALLOWED_SUBJECTS` | — | CSV subject allowlist for Clerk. Clerk mode requires this or `CLERK_ALLOWED_ORGANIZATION_IDS` |
304
+ | `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 |
305
+ | `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 |
306
+ | `MCP_ALLOW_UNAUTHENTICATED_HTTP` | — | Set to `true` only for intentional local unauthenticated HTTP debugging |
307
+ | `MCP_MAX_SESSIONS` | `100` | Maximum concurrent HTTP MCP request handlers (retained name) |
308
+ | `MCP_REDIS_URL` | — | Fallback Redis URL for shared rate limiting, after `RATE_LIMIT_REDIS_URL` and before `REDIS_URL`; production requires `rediss://` |
309
+ | `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). |
310
+ | `MCP_TLS_KEY_PATH` | — | TLS key for native HTTPS |
311
+ | `MCP_TLS_CERT_PATH` | — | TLS cert for native HTTPS |
312
+ | `MCP_TLS_CA_PATH` | — | Optional CA bundle for native HTTPS; only used when the TLS key and cert are set |
313
+ | `MCP_SHUTDOWN_TIMEOUT_MS` | `10000` | How long graceful shutdown waits before the process is forced to exit, in milliseconds; must be positive |
314
+ | `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 |
315
+ | `MCP_READY_CHECK_MODE` | `local` | `local` or `portkey`; `portkey` makes `/ready` also check Portkey connectivity |
316
+ | `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, or `error` |
317
+ | `ALLOWED_ORIGINS` | — | CORS allow-list; also used to validate the `Host` header (DNS-rebinding protection) when `MCP_AUTH_MODE=none` |
318
+ | `CORS_ORIGIN` | — | Legacy fallback for `ALLOWED_ORIGINS`, used only when that is unset |
319
+ | `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 |
320
+ | `RATE_LIMIT_STORE` | `memory` | `redis` for multi-instance/serverless deployments; production memory mode requires `RATE_LIMIT_SINGLE_PROCESS=true` |
321
+ | `RATE_LIMIT_ENABLED` | `true` | Set to `false` to turn the pre-authentication rate limiter off |
322
+ | `RATE_LIMIT_SINGLE_PROCESS` | — | Set to `true` to acknowledge a single-process deployment when using in-memory limiting in production |
323
+ | `RATE_LIMIT_REDIS_URL` | — | Shared limiter Redis URL, falling back to `MCP_REDIS_URL`/`REDIS_URL`; production requires `rediss://` |
324
+ | `RATE_LIMIT_REDIS_KEY_PREFIX` | `mcp:rate-limit` | Redis namespace for atomic pre-authentication IP and principal-plus-IP token buckets |
325
+ | `RATE_LIMIT_MAX` | `60` | Maximum tokens in each pre-authentication IP and principal-plus-IP bucket |
326
+ | `RATE_LIMIT_WINDOW_MS` | `60000` | Rate-limit window in milliseconds |
327
+ | `RATE_LIMIT_REFILL` | `60` | Tokens refilled each window |
328
+ | `RATE_LIMIT_MAX_BUCKETS` | `10000` | Maximum local buckets in explicit memory mode before new clients share overflow capacity |
324
329
 
325
330
  Production containers must choose their rate-limit topology explicitly: set
326
331
  `RATE_LIMIT_STORE=redis` for multi-instance deployments, or set
@@ -366,11 +371,11 @@ This example runs one long-lived container with in-memory rate limiting. Use
366
371
 
367
372
  ### Health Endpoints
368
373
 
369
- | Path | Purpose |
370
- |------|---------|
371
- | `GET /health` | Server liveness |
372
- | `GET /ready` | Readiness (includes optional Portkey connectivity check) |
373
- | `GET /auth/info` | Auth configuration metadata |
374
+ | Path | Purpose |
375
+ | ---------------- | -------------------------------------------------------- |
376
+ | `GET /health` | Server liveness |
377
+ | `GET /ready` | Readiness (includes optional Portkey connectivity check) |
378
+ | `GET /auth/info` | Auth configuration metadata |
374
379
 
375
380
  <hr>
376
381