io.github.s-b-e-n-s-o-n/portkey-admin-mcp
平台与服务by s-b-e-n-s-o-n
完整封装 Portkey Admin API 的 MCP server,提供 116 个工具,覆盖 prompts、analytics、governance 等管理功能。
什么是 io.github.s-b-e-n-s-o-n/portkey-admin-mcp?
完整封装 Portkey Admin API 的 MCP server,提供 116 个工具,覆盖 prompts、analytics、governance 等管理功能。
README
Portkey Admin MCP Server
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://readme-typing-svg.demolab.com?font=Fira+Code&pause=1000&color=FFFFFF¢er=true&vCenter=true&width=500&lines=151+tools+for+Portkey+Admin+API;Prompts%2C+Configs%2C+Analytics;Full+MCP+Protocol+1.0+Server"> <source media="(prefers-color-scheme: light)" srcset="https://readme-typing-svg.demolab.com?font=Fira+Code&pause=1000&color=000000¢er=true&vCenter=true&width=500&lines=151+tools+for+Portkey+Admin+API;Prompts%2C+Configs%2C+Analytics;Full+MCP+Protocol+1.0+Server"> <img src="https://readme-typing-svg.demolab.com?font=Fira+Code&pause=1000&color=000000¢er=true&vCenter=true&width=500&lines=151+tools+for+Portkey+Admin+API;Prompts%2C+Configs%2C+Analytics;Full+MCP+Protocol+1.0+Server" alt="Typing SVG"> </picture>MCP server for the Portkey Admin API. Manage prompts, configs, analytics, API keys, and more from any MCP client.
<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> <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> <a href="https://github.com/s-b-e-n-s-o-n/portkey-admin-mcp/actions/workflows/ci.yml"><img src="https://github.com/s-b-e-n-s-o-n/portkey-admin-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node.js"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
<a href="https://glama.ai/mcp/servers/s-b-e-n-s-o-n/portkey-admin-mcp"><img src="https://glama.ai/mcp/servers/s-b-e-n-s-o-n/portkey-admin-mcp/badges/card.svg" alt="portkey-admin-mcp MCP server"></a>
</div>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-mcp
Cursor / 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-mcp
git clone https://github.com/s-b-e-n-s-o-n/portkey-admin-mcp.git
cd portkey-admin-mcp
npm install && npm run build
Then 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 + analytics.view scope |
| User management, invites | Organization-level API key |
| Integration models/workspaces | Organization-level API key |
| Prompt completions | completions.write scope + billing metadata |
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.js
Or 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-http
For 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 |
|---|---|---|
PORTKEY_API_KEY | (required) | Your Portkey API key |
MCP_HOST | 127.0.0.1 | Bind address |
MCP_PORT | 3000 | Port |
MCP_PUBLIC_BASE_URL | — | Public absolute base URL to advertise from /auth/info and the status page; recommended for hosted deployments |
MCP_AUTH_MODE | none | none, bearer, or clerk (none is blocked for HTTP unless explicitly overridden) |
MCP_AUTH_TOKEN | — | Secret for bearer auth |
MCP_ALLOW_UNAUTHENTICATED_HTTP | — | Set to true only for intentional local unauthenticated HTTP debugging |
MCP_SESSION_MODE | stateful | stateful or stateless |
MCP_MAX_SESSIONS | 100 | Maximum concurrent stateful MCP sessions before new initialize requests are rejected |
MCP_EVENT_STORE | off | off, memory, or redis |
MCP_REDIS_URL | — | Redis URL for shared event store |
MCP_TLS_KEY_PATH | — | TLS key for native HTTPS |
MCP_TLS_CERT_PATH | — | TLS cert for native HTTPS |
ALLOWED_ORIGINS | — | CORS allow-list |
MCP_TRUST_PROXY | false | Trust proxy headers (for reverse proxies) |
RATE_LIMIT_MAX_BUCKETS | 10000 | 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 headers - 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-mcp
Health Endpoints
| Path | Purpose |
|---|---|
GET /health | Server liveness |
GET /ready | Readiness (includes optional Portkey connectivity check) |
GET /auth/info | 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.
<div align="center">
MIT License · Inspired by r-huijts/portkey-admin-mcp-server
<a href="#portkey-admin-mcp-server">↑ Back to top</a>
</div>常见问题
io.github.s-b-e-n-s-o-n/portkey-admin-mcp 是什么?
完整封装 Portkey Admin API 的 MCP server,提供 116 个工具,覆盖 prompts、analytics、governance 等管理功能。
相关 Skills
MCP构建
by anthropics
聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。
✎ 想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。
Slack动图
by anthropics
面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。
✎ 帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。
MCP服务构建器
by alirezarezvani
从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。
✎ 帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。
相关 MCP Server
Slack 消息
编辑精选by Anthropic
Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。
✎ 这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。
by netdata
io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。
✎ 这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。
by d4vinci
Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。
✎ 这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。