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-mcpTo expose only a focused subset of tools in stdio clients, set PORTKEY_TOOL_DOMAINS:
PORTKEY_API_KEY=your_key \
PORTKEY_TOOL_DOMAINS=prompts,analytics \
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 | 2 | Feedback creation and updates on traces |
Users & Workspaces | 20 | User management, invites, workspace members |
Audit | 1 | Audit log access |
150 tools total. See ENDPOINTS.md for the full list with descriptions.
API Key Scopes
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.
Enterprise-gated tools (28)
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.
Area | Tools | Required scope |
Analytics (20) |
| org-level |
Audit |
|
|
Org-level integrations |
|
|
Org-level users |
|
|
Other scope requirements
Feature | Required |
Prompt completions ( |
|
Org-level service API key creation via |
|
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=127.0.0.1 \
MCP_PORT=3000 \
MCP_PUBLIC_BASE_URL=https://mcp.example.com \
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-httpFor local-only HTTP use, leave MCP_HOST at its default 127.0.0.1. Set MCP_HOST=0.0.0.0 only when you intentionally need to accept connections from outside the local machine, such as Docker or a reverse proxy on another interface.
Configuration
Variable | Default | Description |
| (required) | Your Portkey API key |
| โ | Optional comma-separated stdio/HTTP default tool subset, e.g. |
|
| Bind address |
|
| Port |
| โ | Public absolute base URL to advertise from |
|
|
|
| โ | Secret for bearer auth |
| โ | Set to |
|
|
|
|
| Maximum concurrent stateful MCP sessions before new initialize requests are rejected |
|
|
|
| โ | 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) |
|
| Maximum distinct in-memory rate-limit buckets before new clients share an overflow bucket |
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)Set
MCP_PUBLIC_BASE_URLto your deployment URL so advertised MCP endpoints never depend on request headersVercel 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)npm run dev:http now requires MCP_AUTH_MODE=bearer or MCP_AUTH_MODE=clerk by default. For deliberate local-only unauthenticated testing, set MCP_ALLOW_UNAUTHENTICATED_HTTP=true.
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