portkey-admin-mcp 0.6.2 → 0.7.0

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.
@@ -0,0 +1,66 @@
1
+ # Prisma AIRS interoperability
2
+
3
+ Last verified: 2026-08-09
4
+
5
+ ## Short answer
6
+
7
+ Portkey is now the core AI Gateway technology in Prisma AIRS, but Prisma AIRS AI Gateway is **not currently a drop-in API target** for this MCP server. Keep using this server for the documented Portkey control-plane API. Use Prisma AIRS alongside it through Strata Cloud Manager and, where useful, Palo Alto Networks' security-focused MCP server.
8
+
9
+ Changing `PORTKEY_BASE_URL` to a Prisma AIRS or Strata Cloud Manager URL will not work: the public products currently expose different management surfaces, credentials, and resource models.
10
+
11
+ ## Current boundary
12
+
13
+ | Surface | Management interface | Authentication | What this project supports |
14
+ |---|---|---|---|
15
+ | Portkey Admin API | `https://api.portkey.ai/v1` or a compatible self-hosted control plane | `x-portkey-api-key` | Full support through the 19 existing tool domains |
16
+ | Portkey public model catalog | `https://api.portkey.ai/model-configs/...` | None | `get_model_pricing` |
17
+ | Prisma AIRS AI Gateway | AI Security in Strata Cloud Manager | Prisma AIRS / SCM tenant credentials | No direct admin adapter yet |
18
+ | Prisma AIRS security MCP server | Regional Palo Alto Networks `/mcp` endpoint | `x-pan-token`, OAuth, and optional `x-pan-profile` | Works as a separate MCP server; it scans and secures AI interactions rather than managing Portkey resources |
19
+
20
+ Palo Alto Networks says the Portkey acquisition makes Portkey the core AI Gateway for Prisma AIRS. Its current AI Gateway instructions direct administrators to Strata Cloud Manager, while the documented Prisma AIRS MCP endpoint is for centralized AI-agent security. No public Prisma AIRS admin contract equivalent to Portkey's users, workspaces, prompts, configs, integrations, or keys is documented today. That last sentence is an inference from the currently published product and API documentation, not a promise that such an API will never exist.
21
+
22
+ ## Recommended coexistence
23
+
24
+ Run the two MCP servers side by side when you need both administration and runtime security:
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "portkey-admin": {
30
+ "command": "npx",
31
+ "args": ["-y", "portkey-admin-mcp"],
32
+ "env": {
33
+ "PORTKEY_API_KEY": "your-portkey-key"
34
+ }
35
+ },
36
+ "prisma-airs-security": {
37
+ "type": "http",
38
+ "url": "https://service.api.aisecurity.paloaltonetworks.com/mcp",
39
+ "headers": {
40
+ "x-pan-token": "your-prisma-airs-key",
41
+ "x-pan-profile": "your-security-profile"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ Use `portkey-admin` for control-plane changes. Use `prisma-airs-security` for the security tools provided by Palo Alto Networks. Choose the documented regional Prisma AIRS endpoint for your tenant, and keep both credentials out of source control.
49
+
50
+ ## When a direct adapter becomes possible
51
+
52
+ A native Prisma AIRS mode should be added only after Palo Alto Networks publishes a stable management API for AI Gateway. The adapter will need its own:
53
+
54
+ - base URL and authentication strategy;
55
+ - mapping for tenants, workspaces, guardrails, integrations, and logs;
56
+ - capability detection rather than assuming Portkey endpoint parity;
57
+ - contract fixtures and integration tests against the published API.
58
+
59
+ That should be a distinct adapter or tool domain, not a silent reinterpretation of `PORTKEY_BASE_URL`, so existing Portkey and self-hosted deployments keep working.
60
+
61
+ ## Official references
62
+
63
+ - [Palo Alto Networks completes the Portkey acquisition](https://investors.paloaltonetworks.com/news-releases/news-release-details/palo-alto-networks-completes-acquisition-portkey-secure-ai)
64
+ - [Configure Prisma AIRS AI Gateway](https://docs.paloaltonetworks.com/ai-runtime-security/administration/configure-ai-gateway)
65
+ - [Configure the Prisma AIRS security MCP server](https://docs.paloaltonetworks.com/ai-runtime-security/activation-and-onboarding/prisma-airs-mcp-server-for-centralized-ai-agent-security/configure-mcp-server-security-using-prisma-airs)
66
+ - [Portkey OpenAPI](https://github.com/Portkey-AI/openapi)
@@ -0,0 +1,192 @@
1
+ # Vercel Deployment Guide (Public Repo Safe)
2
+
3
+ > **Status (June 2026)**: This deployment path is a **proof of concept kept for reference**. There is no hosted version of this server and hosting is not currently a goal — the supported transport is stdio via `npx`. The steps below remain valid if you want to self-deploy.
4
+
5
+ This guide describes how to self-deploy this MCP server on Vercel.
6
+
7
+ ## Recommended Architecture
8
+
9
+ - Runtime: Vercel Node.js Function (`api/index.ts`)
10
+ - Transport: Streamable HTTP (`/mcp`)
11
+ - Session mode: `stateless`
12
+ - Event store: `redis`
13
+ - Auth: `clerk` (preferred for teams) or `bearer` (internal-only)
14
+
15
+ Why: serverless instances scale and restart, so each POST and replay GET is handled independently. Redis maps the client's `Last-Event-ID` cursor back to the interrupted SSE stream across instances without introducing MCP session affinity.
16
+
17
+ ## 1. Prerequisites
18
+
19
+ - Portkey Admin API key with required scopes
20
+ - Redis instance URL (for example Upstash Redis or another managed Redis service)
21
+ - Vercel project connected to this repository
22
+ - Optional but recommended: Clerk app for JWT auth
23
+
24
+ ## 2. Verify Repo Files
25
+
26
+ These files should already exist:
27
+
28
+ - `api/index.ts`
29
+ - `vercel.json`
30
+
31
+ `vercel.json` rewrites these routes to the function:
32
+
33
+ - `/`
34
+ - `/mcp`
35
+ - `/health`
36
+ - `/ready`
37
+ - `/auth/info`
38
+
39
+ ## 3. Configure Vercel Environment Variables
40
+
41
+ Set these in Vercel Project Settings -> Environment Variables.
42
+
43
+ Required:
44
+
45
+ - `PORTKEY_API_KEY`
46
+ - `MCP_SESSION_MODE=stateless`
47
+ - `MCP_EVENT_STORE=redis`
48
+ - `MCP_REDIS_URL=rediss://<ACL-user>:<password>@...`
49
+ - `MCP_EVENT_ENCRYPTION_KEY=<base64-encoded-32-byte-key>`
50
+ - `ALLOWED_ORIGINS=https://your-app-domain`
51
+ - `MCP_TRUST_PROXY=true`
52
+ - `RATE_LIMIT_STORE=redis`
53
+
54
+ Recommended:
55
+
56
+ - `MCP_READY_CHECK_MODE=portkey`
57
+ - `RATE_LIMIT_ENABLED=true`
58
+ - `RATE_LIMIT_REDIS_URL=rediss://...` (optional; falls back to `MCP_REDIS_URL`)
59
+
60
+ The shared limiter applies an IP bucket before authentication and a separate
61
+ principal-plus-IP bucket after authentication.
62
+
63
+ Generate the replay encryption key locally with `openssl rand -base64 32`. Store
64
+ it only as a Vercel secret. Rotating it makes unexpired replay events unreadable;
65
+ the default replay TTL is five minutes.
66
+
67
+ Auth option A (recommended for teams): Clerk JWT
68
+
69
+ - `MCP_AUTH_MODE=clerk`
70
+ - `CLERK_ISSUER=https://<your-clerk-domain>`
71
+ - `CLERK_AUDIENCE=<your-audience>` (required)
72
+ - `CLERK_JWKS_URL=...` (optional; auto-derived from issuer if omitted)
73
+ - At least one authorization constraint: `CLERK_ALLOWED_SUBJECTS`,
74
+ `CLERK_ALLOWED_ORGANIZATION_IDS`, `CLERK_ALLOWED_ROLES`, or
75
+ `CLERK_REQUIRED_PERMISSIONS`. Every configured constraint must match.
76
+
77
+ Auth option B (internal shared token):
78
+
79
+ - `MCP_AUTH_MODE=bearer`
80
+ - `MCP_AUTH_TOKEN=<long-random-secret>`
81
+
82
+ Do not set:
83
+
84
+ - `MCP_TLS_KEY_PATH`
85
+ - `MCP_TLS_CERT_PATH`
86
+ - `MCP_TLS_CA_PATH`
87
+
88
+ Vercel terminates HTTPS at the edge.
89
+
90
+ ## 4. Deploy
91
+
92
+ Use Vercel dashboard or CLI:
93
+
94
+ ```bash
95
+ vercel
96
+ vercel --prod
97
+ ```
98
+
99
+ After deploy, your endpoint is:
100
+
101
+ - `https://<your-project>.vercel.app/mcp`
102
+
103
+ ## 5. Post-Deploy Checks
104
+
105
+ Unauthenticated endpoints:
106
+
107
+ ```bash
108
+ curl -sS https://<your-project>.vercel.app/health
109
+ curl -sS https://<your-project>.vercel.app/ready
110
+ curl -sS https://<your-project>.vercel.app/auth/info
111
+ ```
112
+
113
+ Set `MCP_PUBLIC_BASE_URL=https://<your-project>.vercel.app` in Vercel so `/auth/info`
114
+ and the built-in status page advertise a fixed deployment URL instead of deriving it
115
+ from incoming request headers.
116
+
117
+ MCP endpoint check:
118
+
119
+ ```bash
120
+ MCP_TEST_BASE_URL=https://<your-project>.vercel.app \
121
+ MCP_TEST_BEARER_TOKEN=<token-if-using-bearer> \
122
+ npm run test:http
123
+ ```
124
+
125
+ If using Clerk auth, provide a valid Clerk JWT in:
126
+
127
+ - `MCP_TEST_AUTH_HEADER='Authorization: Bearer <clerk-jwt>'`
128
+
129
+ ## 6. Public Repo Security Checklist
130
+
131
+ Treat this as required before making the repo public.
132
+
133
+ 1. Never commit secrets
134
+
135
+ - Keep `.env` local only (already gitignored).
136
+ - Never commit Vercel env exports.
137
+ - Never paste real keys in README, issues, or PR comments.
138
+
139
+ 2. Assume key leakage can happen
140
+
141
+ - Rotate leaked keys immediately in Portkey/Clerk/Redis.
142
+ - Prefer short-lived or scoped credentials where supported.
143
+
144
+ 3. Keep auth enabled in production
145
+
146
+ - Do not run `MCP_AUTH_MODE=none` in hosted environments.
147
+ - Do not set `MCP_ALLOW_UNAUTHENTICATED_HTTP=true` in hosted environments.
148
+
149
+ 4. Restrict origins
150
+
151
+ - Set exact domains in `ALLOWED_ORIGINS`.
152
+ - Avoid `*` except temporary local debugging.
153
+
154
+ 5. Use least-privilege Portkey API scopes
155
+
156
+ - Only grant scopes this server actually needs for your workflows.
157
+
158
+ 6. Isolate Redis
159
+
160
+ - Require TLS (`rediss://`) and an ACL user limited to the configured replay and
161
+ rate-limit prefixes.
162
+ - Use a dedicated namespace and credentials per environment.
163
+ - Keep `MCP_EVENT_TTL_SECONDS` short; the default is 300 seconds.
164
+
165
+ 7. Enable repository protections
166
+
167
+ - Enable GitHub secret scanning and push protection.
168
+ - Require PR reviews before merge to `main`.
169
+
170
+ 8. Keep dependencies current
171
+
172
+ - Run `npm audit` regularly.
173
+ - Patch `jose`, `express`, and `redis` updates promptly.
174
+
175
+ ## 7. Limits and Expected Behavior
176
+
177
+ - Some Portkey endpoints can still return `403 AB03` if key scopes are missing.
178
+ - Vercel Functions are request-duration constrained; this repo sets `maxDuration` in `vercel.json`.
179
+ - WebSockets are not required for this server; use Streamable HTTP/SSE.
180
+
181
+ ## 8. Team Operations
182
+
183
+ For team access:
184
+
185
+ - Use one shared Vercel project per environment (`staging`, `production`).
186
+ - Manage secrets in Vercel project envs, not in local files.
187
+ - Keep each environment on a separate Portkey key and Redis namespace.
188
+
189
+ Suggested naming convention:
190
+
191
+ - `MCP_REDIS_KEY_PREFIX=portkey-admin-mcp:prod`
192
+ - `MCP_REDIS_KEY_PREFIX=portkey-admin-mcp:staging`
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "lint": "biome lint .",
12
12
  "format": "biome format --write .",
13
13
  "check": "biome check --write .",
14
- "test": "tsx --test tests/config.test.ts tests/security.test.ts tests/contract.test.ts tests/contract-extended.test.ts tests/unit.test.ts tests/http-server.test.ts tests/tools-observability.test.ts tests/tools-catalog.test.ts tests/tools-platform.test.ts tests/auth-clerk.test.ts",
14
+ "test": "tsx --test tests/config.test.ts tests/security.test.ts tests/contract.test.ts tests/contract-extended.test.ts tests/unit.test.ts tests/http-server.test.ts tests/tools-observability.test.ts tests/tools-catalog.test.ts tests/tools-platform.test.ts tests/current-api.test.ts tests/release-readiness.test.ts tests/auth-clerk.test.ts",
15
15
  "dev": "tsx --watch src/index.ts",
16
16
  "dev:http": "tsx --watch src/server.ts",
17
17
  "smoke": "tsx tests/smoke.ts",
@@ -20,12 +20,14 @@
20
20
  "test:contract": "tsx --test tests/contract.test.ts",
21
21
  "test:redis": "tsx --test tests/redis-integration.test.ts",
22
22
  "record:fixtures": "tsx tests/fixtures/record.ts",
23
+ "verify:tool-quality": "node scripts/check-tool-definition-quality.mjs",
23
24
  "verify:readme-tools": "node scripts/verify-readme-tools.mjs",
24
25
  "knip": "knip",
25
- "ci": "npm run lint && npm run knip && npm run typecheck && npm run typecheck:tests && npm run test && npm run build && npm run test:e2e && npm run verify:readme-tools",
26
+ "ci": "npm run lint && npm run knip && npm run typecheck && npm run typecheck:tests && npm run test && npm run build && npm run verify:tool-quality && npm run test:e2e && npm run verify:readme-tools",
26
27
  "start:http": "node build/server.js",
27
28
  "generate:lobehub-tools": "npm run build && node scripts/generate-lobehub-tools.mjs && biome format --write lhm.plugin.json",
28
- "publish:lobehub": "npm run generate:lobehub-tools && npx -y @lobehub/market-cli plugin publish --dir \"$PWD\"",
29
+ "update:lobehub": "npm run generate:lobehub-tools && npx -y @lobehub/market-cli plugin update --dir \"$PWD\"",
30
+ "publish:lobehub": "npm run update:lobehub",
29
31
  "prepare": "[ -n \"$CI\" ] || [ -f /.dockerenv ] || [ ! -d .git ] || lefthook install",
30
32
  "prepublishOnly": "npm run ci"
31
33
  },
@@ -34,7 +36,10 @@
34
36
  },
35
37
  "packageManager": "npm@12.0.2",
36
38
  "files": [
37
- "build"
39
+ "build",
40
+ "ENDPOINTS.md",
41
+ "docs/PRISMA_AIRS_INTEROPERABILITY.md",
42
+ "docs/VERCEL_DEPLOYMENT.md"
38
43
  ],
39
44
  "dependencies": {
40
45
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -48,7 +53,7 @@
48
53
  },
49
54
  "name": "portkey-admin-mcp",
50
55
  "mcpName": "io.github.CodesWhat/portkey-admin-mcp",
51
- "version": "0.6.2",
56
+ "version": "0.7.0",
52
57
  "main": "build/index.js",
53
58
  "keywords": [
54
59
  "mcp",
@@ -61,11 +66,13 @@
61
66
  "prompts",
62
67
  "observability",
63
68
  "gateway",
69
+ "prisma-airs",
70
+ "palo-alto-networks",
64
71
  "anthropic"
65
72
  ],
66
73
  "author": "Scott Benson",
67
74
  "license": "MIT",
68
- "description": "Full Portkey Admin API MCP server",
75
+ "description": "Portkey Admin API MCP server with current control-plane coverage and Prisma AIRS interoperability guidance",
69
76
  "repository": {
70
77
  "type": "git",
71
78
  "url": "git+https://github.com/CodesWhat/portkey-admin-mcp.git"