portkey-admin-mcp
The Portkey Admin MCP Server provides 151 tools for managing Portkey AI infrastructure through the Model Context Protocol (MCP), enabling comprehensive administration across the following areas:
๐ฅ User & Access Management โ Invite, list, update, and delete users; manage pending invitations; retrieve user activity statistics; control role-based permissions.
๐ข Workspace Management โ Create, configure, and delete workspaces; manage workspace members and their roles (admin, manager, member).
โ๏ธ Gateway Configuration โ Set up and manage configs with load balancing, fallback routing, simple/semantic caching, and retry policies; view version history.
๐ API & Virtual Key Management โ Create and manage Portkey API keys (org-level and workspace-scoped) and virtual keys for securely storing AI provider credentials (OpenAI, Anthropic, Azure, Google, etc.).
๐ Prompt Management โ Create, version, publish, render, and execute prompt templates with variable substitution and tool/function definitions; organize into collections; manage reusable partials and labels; migrate and promote prompts across environments (dev โ staging โ prod).
๐ก๏ธ Governance & Safety โ Create and manage guardrails for content moderation and security; set usage limits (tokens, requests, cost) on daily/weekly/monthly periods; configure rate limits.
๐ Analytics & Reporting โ Query time-series analytics for cost, requests, token usage, latency, errors, cache hit rates, feedback scores, and user activity; group by user, model, or metadata.
๐ Logging & Observability โ Insert custom log entries; create and manage log export jobs; retrieve detailed trace information; create and update feedback on AI generations; view audit logs for all administrative actions.
๐ Integrations & Providers โ Manage custom AI providers, third-party integrations, MCP server registrations, and workspace access configurations.
The server supports deployment via npx, Docker, or self-hosting, with HTTP/HTTPS transports, stateful/stateless modes, and bearer/Clerk authentication. It integrates with Claude Code, Cursor, Windsurf, and VS Code. Enterprise features (full analytics, log exports, audit logs) require a Portkey Enterprise plan.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@portkey-admin-mcplist all users in my organization"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Portkey Admin MCP Server
MCP server for the Portkey Admin API. Manage prompts, configs, analytics, API keys, and more from any MCP client.
Quick Start
You need a Portkey API key with appropriate scopes. Get one from your Portkey dashboard under API Keys.
Claude Code
claude mcp add -e PORTKEY_API_KEY=your_key portkey-admin -- npx -y portkey-admin-mcpCursor / Windsurf / VS Code
Add to your MCP config (.cursor/mcp.json, .windsurf/mcp.json, or .vscode/mcp.json):
{
"mcpServers": {
"portkey-admin": {
"command": "npx",
"args": ["-y", "portkey-admin-mcp"],
"env": {
"PORTKEY_API_KEY": "your_api_key"
}
}
}
}Run directly
PORTKEY_API_KEY=your_key npx -y portkey-admin-mcpgit clone https://github.com/s-b-e-n-s-o-n/portkey-admin-mcp.git
cd portkey-admin-mcp
npm install && npm run buildThen use this config:
{
"mcpServers": {
"portkey-admin": {
"command": "node",
"args": ["/path/to/portkey-admin-mcp/build/index.js"],
"env": {
"PORTKEY_API_KEY": "your_api_key"
}
}
}
}What You Can Do
Category | Tools | Examples |
Prompts | 14 | Create, version, render, execute, migrate, promote prompts |
Prompt Partials | 7 | Reusable prompt fragments with versioning |
Prompt Labels | 5 | Organize prompt versions (production, staging, dev) |
Configs | 6 | Gateway routing, caching, retry, loadbalancing |
API Keys | 5 | Create and manage scoped API keys |
Virtual Keys | 5 | Manage provider access keys |
Collections | 5 | Group prompts by app or project |
Providers | 5 | Manage AI provider configurations |
Integrations | 10 | Provider integrations, models, workspace access |
MCP Integrations | 10 | External MCP tool integrations |
MCP Servers | 10 | MCP server registry and capabilities |
Guardrails | 5 | Content safety policies |
Usage Limits | 7 | Cost and token consumption limits |
Rate Limits | 5 | Request frequency controls |
Analytics | 20 | Cost, latency, errors, tokens, cache, feedback |
Logging | 8 | Log ingestion and export |
Tracing | 3 | Feedback and trace retrieval |
Users & Workspaces | 20 | User management, invites, workspace members |
Audit | 1 | Audit log access |
151 tools total. See ENDPOINTS.md for the full list with descriptions.
API Key Scopes
Different tools require different API key scopes. A workspace-scoped service key with broad permissions works for most operations. Some features need additional access:
Feature | Required |
Analytics, log exports, audit logs | Enterprise plan + |
User management, invites | Organization-level API key |
Integration models/workspaces | Organization-level API key |
Prompt completions |
|
If a tool returns a 403 with Portkey error AB03, it means missing scopes โ not a broken endpoint.
HTTP Server (Experimental)
Status: The HTTP transport works but hosted deployment is not fully validated for production. Use stdio (npx) for reliable operation.
The server supports Streamable HTTP for remote access:
PORTKEY_API_KEY=your_key \
MCP_HOST=0.0.0.0 \
MCP_PORT=3000 \
MCP_AUTH_MODE=bearer \
MCP_AUTH_TOKEN=your_secret \
node build/server.jsOr via npx (the portkey-admin-mcp package includes the HTTP binary):
PORTKEY_API_KEY=your_key MCP_AUTH_MODE=bearer MCP_AUTH_TOKEN=your_secret \
npx -y -p portkey-admin-mcp portkey-admin-mcp-httpConfiguration
Variable | Default | Description |
| (required) | Your Portkey API key |
|
| Bind address |
|
| Port |
|
|
|
| โ | Secret for bearer auth |
|
|
|
|
|
|
| โ | Redis URL for shared event store |
| โ | TLS key for native HTTPS |
| โ | TLS cert for native HTTPS |
| โ | CORS allow-list |
|
| Trust proxy headers (for reverse proxies) |
Experimental Vercel support is included. See docs/VERCEL_DEPLOYMENT.md for setup instructions.
Key points:
Uses stateless mode with Redis event store
Requires Clerk or bearer auth
Leave
MCP_TLS_*unset (Vercel terminates HTTPS)Vercel does not support WebSockets โ Streamable HTTP/SSE only
docker build -t portkey-admin-mcp .
docker run \
-e PORTKEY_API_KEY=your_key \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=3000 \
-e MCP_AUTH_MODE=bearer \
-e MCP_AUTH_TOKEN=your_secret \
-p 3000:3000 \
portkey-admin-mcpHealth Endpoints
Path | Purpose |
| Server liveness |
| Readiness (includes optional Portkey connectivity check) |
| Auth configuration metadata |
Development
npm run dev # stdio with hot reload
npm run dev:http # HTTP with hot reload
npm test # unit + contract tests
npm run test:e2e # MCP protocol tests
npm run test:http # HTTP endpoint smoke test
npm run ci # full pipeline (lint + typecheck + test + build + e2e + verify)MIT License ยท Inspired by r-huijts/portkey-admin-mcp-server
โ Back to top
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server