portkey-admin-mcp 0.4.1 → 0.5.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.
Files changed (4) hide show
  1. package/README.md +68 -28
  2. package/build/index.js +1213 -633
  3. package/build/server.js +1597 -683
  4. package/package.json +16 -13
package/README.md CHANGED
@@ -2,28 +2,44 @@
2
2
 
3
3
  <img src="./assets/portkey-balloon-spin-light.webp" alt="Portkey Admin MCP icon" width="180" height="180">
4
4
 
5
- # Portkey Admin MCP Server
5
+ <h1>Portkey Admin MCP Server</h1>
6
6
 
7
- MCP server for the [Portkey](https://portkey.ai/) Admin API. Manage prompts, configs, analytics, API keys, and more from any MCP client.
7
+ **The full [Portkey](https://portkey.ai/) Admin API as an MCP server — 156 tools across prompts, configs, keys, analytics, and more.**
8
8
 
9
- <a href="https://www.npmjs.com/package/portkey-admin-mcp"><img src="https://img.shields.io/npm/v/portkey-admin-mcp.svg" alt="npm version"></a>
10
- <a href="https://www.npmjs.com/package/portkey-admin-mcp"><img src="https://img.shields.io/npm/dm/portkey-admin-mcp.svg" alt="npm downloads"></a>
11
- <a href="https://github.com/CodesWhat/portkey-admin-mcp/actions/workflows/ci.yml"><img src="https://github.com/CodesWhat/portkey-admin-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
12
- <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D24-brightgreen.svg" alt="Node.js"></a>
13
- <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
14
- <a href="https://github.com/punkpeye/awesome-mcp-servers"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome MCP Servers"></a>
15
- [![MCP Badge](https://lobehub.com/badge/mcp-full/codeswhat-portkey-admin-mcp?theme=light)](https://lobehub.com/mcp/codeswhat-portkey-admin-mcp)
9
+ </div>
16
10
 
17
- <a href="https://glama.ai/mcp/servers/CodesWhat/portkey-admin-mcp"><img src="https://glama.ai/mcp/servers/CodesWhat/portkey-admin-mcp/badges/card.svg" alt="portkey-admin-mcp MCP server"></a>
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/portkey-admin-mcp"><img src="https://img.shields.io/npm/v/portkey-admin-mcp.svg" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/portkey-admin-mcp"><img src="https://img.shields.io/npm/dm/portkey-admin-mcp.svg" alt="npm downloads"></a>
14
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D24-brightgreen.svg" alt="Node.js"></a>
15
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
16
+ <br>
17
+ <a href="https://github.com/CodesWhat/portkey-admin-mcp/actions/workflows/ci.yml"><img src="https://github.com/CodesWhat/portkey-admin-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
18
+ <a href="https://github.com/punkpeye/awesome-mcp-servers"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome MCP Servers"></a>
19
+ <a href="https://lobehub.com/mcp/codeswhat-portkey-admin-mcp"><img src="https://lobehub.com/badge/mcp/codeswhat-portkey-admin-mcp" alt="LobeHub MCP"></a>
20
+ </p>
18
21
 
19
- </div>
22
+ <p align="center">
23
+ <a href="https://glama.ai/mcp/servers/CodesWhat/portkey-admin-mcp"><img src="https://glama.ai/mcp/servers/CodesWhat/portkey-admin-mcp/badges/card.svg" alt="portkey-admin-mcp MCP server"></a>
24
+ </p>
20
25
 
21
- ---
26
+ <hr>
22
27
 
23
28
  > [!IMPORTANT]
24
29
  > **Maintenance mode.** Portkey was acquired by **Palo Alto Networks** (completed 2026‑05‑29) and is being folded into the Prisma AIRS platform. The Portkey Admin API this server targets is **live and unchanged as of June 2026**, and this project still works end‑to‑end — but it is now in **maintenance mode**: security and dependency patches only, no new features, pending Palo Alto's post‑acquisition API roadmap. If the hosted Admin API is ever deprecated, point `PORTKEY_BASE_URL` at a self‑hosted [Portkey gateway](https://github.com/Portkey-AI/gateway). See [docs/audit-2026-06.md](./docs/audit-2026-06.md) for the full assessment.
25
30
 
26
- ## Quick Start
31
+ <h2 align="center">📑 Contents</h2>
32
+
33
+ - [🚀 Quick Start](#quick-start)
34
+ - [🧰 What You Can Do](#what-you-can-do)
35
+ - [🔑 API Key Scopes](#api-key-scopes)
36
+ - [🌐 HTTP Server (Experimental)](#http-server)
37
+ - [🛠️ Development](#development)
38
+ - [🧾 Full tool list — ENDPOINTS.md](./ENDPOINTS.md)
39
+
40
+ <hr>
41
+
42
+ <h2 align="center" id="quick-start">🚀 Quick Start</h2>
27
43
 
28
44
  You need a **Portkey API key** with appropriate scopes. Get one from your [Portkey dashboard](https://app.portkey.ai/) under API Keys.
29
45
 
@@ -91,9 +107,9 @@ Then use this config:
91
107
 
92
108
  </details>
93
109
 
94
- ---
110
+ <hr>
95
111
 
96
- ## What You Can Do
112
+ <h2 align="center" id="what-you-can-do">🧰 What You Can Do</h2>
97
113
 
98
114
  | Category | Tools | Examples |
99
115
  |----------|-------|---------|
@@ -101,7 +117,8 @@ Then use this config:
101
117
  | **Prompt Partials** | 7 | Reusable prompt fragments with versioning |
102
118
  | **Prompt Labels** | 5 | Organize prompt versions (production, staging, dev) |
103
119
  | **Configs** | 6 | Gateway routing, caching, retry, loadbalancing |
104
- | **API Keys** | 5 | Create and manage scoped API keys |
120
+ | **API Keys** | 6 | Create, rotate, and manage scoped API keys |
121
+ | **Secret References** | 5 | Manage AWS, Azure, and HashiCorp external-secret references |
105
122
  | **Virtual Keys** | 5 | Manage provider access keys |
106
123
  | **Collections** | 5 | Group prompts by app or project |
107
124
  | **Providers** | 5 | Manage AI provider configurations |
@@ -117,11 +134,11 @@ Then use this config:
117
134
  | **Users & Workspaces** | 20 | User management, invites, workspace members |
118
135
  | **Audit** | 1 | Audit log access |
119
136
 
120
- **150 tools total.** See [ENDPOINTS.md](./ENDPOINTS.md) for the full list with descriptions.
137
+ **156 tools total.** See [ENDPOINTS.md](./ENDPOINTS.md) for the full list with descriptions.
121
138
 
122
- ---
139
+ <hr>
123
140
 
124
- ## API Key Scopes
141
+ <h2 align="center" id="api-key-scopes">🔑 API Key Scopes</h2>
125
142
 
126
143
  Most tools work with a **workspace-scoped service key** that has Select All permissions enabled. That covers prompts, configs, virtual/API keys, providers, guardrails, workspace integrations, MCP servers, rate/usage limits, logs, prompt completions, and workspace user management.
127
144
 
@@ -145,9 +162,9 @@ The following tools require an **organisation-level scope that is only available
145
162
 
146
163
  If a tool returns a `403` with Portkey error `AB03`, it means missing scopes — not a broken endpoint.
147
164
 
148
- ---
165
+ <hr>
149
166
 
150
- ## HTTP Server (Experimental)
167
+ <h2 align="center" id="http-server">🌐 HTTP Server (Experimental)</h2>
151
168
 
152
169
  > **Status**: The HTTP transport works locally and is covered by the integration test suite, but it is a proof of concept — there is **no hosted version** of this server, and hosted deployment is not currently a goal. Use stdio (npx) as the supported transport.
153
170
 
@@ -186,8 +203,8 @@ For local-only HTTP use, leave `MCP_HOST` at its default `127.0.0.1`. Set `MCP_H
186
203
  | `MCP_AUTH_TOKEN` | — | Secret for bearer auth |
187
204
  | `MCP_ALLOW_UNAUTHENTICATED_HTTP` | — | Set to `true` only for intentional local unauthenticated HTTP debugging |
188
205
  | `MCP_SESSION_MODE` | `stateful` | `stateful` or `stateless` |
189
- | `MCP_MAX_SESSIONS` | `100` | Maximum concurrent stateful MCP sessions before new initialize requests are rejected |
190
- | `MCP_EVENT_STORE` | `off` | `off`, `memory`, or `redis` |
206
+ | `MCP_MAX_SESSIONS` | `100` | Maximum concurrent stateful sessions or active stateless request handlers |
207
+ | `MCP_EVENT_STORE` | `off` | `off`, `memory`, or `redis`; stateless `GET /mcp` replay requires `memory` or `redis` |
191
208
  | `MCP_REDIS_URL` | — | Redis URL for shared event store |
192
209
  | `MCP_TLS_KEY_PATH` | — | TLS key for native HTTPS |
193
210
  | `MCP_TLS_CERT_PATH` | — | TLS cert for native HTTPS |
@@ -201,7 +218,7 @@ For local-only HTTP use, leave `MCP_HOST` at its default `127.0.0.1`. Set `MCP_H
201
218
  Vercel support is kept as a reference proof of concept — we do not run a hosted deployment. See [docs/VERCEL_DEPLOYMENT.md](./docs/VERCEL_DEPLOYMENT.md) if you want to self-deploy.
202
219
 
203
220
  Key points:
204
- - Uses stateless mode with Redis event store
221
+ - Uses stateless request handling with a shared Redis event store so `GET /mcp` can replay an interrupted SSE stream from `Last-Event-ID` without a session ID
205
222
  - Requires Clerk or bearer auth
206
223
  - Leave `MCP_TLS_*` unset (Vercel terminates HTTPS)
207
224
  - Set `MCP_PUBLIC_BASE_URL` to your deployment URL so advertised MCP endpoints never depend on request headers
@@ -235,9 +252,9 @@ docker run \
235
252
  | `GET /ready` | Readiness (includes optional Portkey connectivity check) |
236
253
  | `GET /auth/info` | Auth configuration metadata |
237
254
 
238
- ---
255
+ <hr>
239
256
 
240
- ## Development
257
+ <h2 align="center" id="development">🛠️ Development</h2>
241
258
 
242
259
  ```bash
243
260
  npm run dev # stdio with hot reload
@@ -254,8 +271,31 @@ npm run ci # full pipeline (lint + typecheck + test + build + e2e + v
254
271
 
255
272
  <div align="center">
256
273
 
257
- **MIT License** · Inspired by [r-huijts/portkey-admin-mcp-server](https://github.com/r-huijts/portkey-admin-mcp-server)
274
+ ### Built With
275
+
276
+ [![TypeScript](https://img.shields.io/badge/TypeScript_7.0-3178C6?logo=typescript&logoColor=fff)](https://www.typescriptlang.org/)
277
+ [![MCP SDK](https://img.shields.io/badge/MCP_SDK_1.29-000?logo=modelcontextprotocol&logoColor=fff)](https://github.com/modelcontextprotocol/typescript-sdk)
278
+ [![Zod 4](https://img.shields.io/badge/Zod_4-3E67B1?logo=zod&logoColor=fff)](https://zod.dev/)
279
+ [![Biome](https://img.shields.io/badge/Biome_2.5-60a5fa?logo=biome&logoColor=fff)](https://biomejs.dev/)
280
+ [![Node 24](https://img.shields.io/badge/Node_24-339933?logo=nodedotjs&logoColor=fff)](https://nodejs.org/)
281
+ [![Anthropic](https://img.shields.io/badge/Anthropic-CC785C?style=flat&logo=anthropic&logoColor=white)](https://claude.ai/)
282
+
283
+ [![SemVer](https://img.shields.io/badge/semver-2.0.0-blue)](https://semver.org/)
284
+ [![Conventional Commits](https://img.shields.io/badge/commits-conventional-fe5196?logo=conventionalcommits&logoColor=fff)](https://www.conventionalcommits.org/)
285
+ [![Keep a Changelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog-E05735)](https://keepachangelog.com/)
286
+
287
+ **[MIT License](LICENSE)** · Inspired by [r-huijts/portkey-admin-mcp-server](https://github.com/r-huijts/portkey-admin-mcp-server)
288
+
289
+ <a href="https://github.com/CodesWhat">
290
+ <picture>
291
+ <source media="(prefers-color-scheme: dark)" srcset="assets/codeswhat-logo-dark.svg" />
292
+ <source media="(prefers-color-scheme: light)" srcset="assets/codeswhat-logo-original.svg" />
293
+ <img src="assets/codeswhat-logo-original.svg" alt="CodesWhat" height="28">
294
+ </picture>
295
+ </a>
296
+
297
+ [![Sponsor](https://img.shields.io/badge/Sponsor-ea4aaa?logo=githubsponsors&logoColor=white)](https://github.com/sponsors/CodesWhat)
258
298
 
259
- <a href="#portkey-admin-mcp-server">↑ Back to top</a>
299
+ <a href="#portkey-admin-mcp-server">Back to top</a>
260
300
 
261
301
  </div>