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

<div align="center">

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&center=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&center=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&center=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

bash
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):

json
{
  "mcpServers": {
    "portkey-admin": {
      "command": "npx",
      "args": ["-y", "portkey-admin-mcp"],
      "env": {
        "PORTKEY_API_KEY": "your_api_key"
      }
    }
  }
}

Run directly

bash
PORTKEY_API_KEY=your_key npx -y portkey-admin-mcp
<details> <summary><strong>Build from source</strong></summary>
bash
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:

json
{
  "mcpServers": {
    "portkey-admin": {
      "command": "node",
      "args": ["/path/to/portkey-admin-mcp/build/index.js"],
      "env": {
        "PORTKEY_API_KEY": "your_api_key"
      }
    }
  }
}
</details>

What You Can Do

CategoryToolsExamples
Prompts14Create, version, render, execute, migrate, promote prompts
Prompt Partials7Reusable prompt fragments with versioning
Prompt Labels5Organize prompt versions (production, staging, dev)
Configs6Gateway routing, caching, retry, loadbalancing
API Keys5Create and manage scoped API keys
Virtual Keys5Manage provider access keys
Collections5Group prompts by app or project
Providers5Manage AI provider configurations
Integrations10Provider integrations, models, workspace access
MCP Integrations10External MCP tool integrations
MCP Servers10MCP server registry and capabilities
Guardrails5Content safety policies
Usage Limits7Cost and token consumption limits
Rate Limits5Request frequency controls
Analytics20Cost, latency, errors, tokens, cache, feedback
Logging8Log ingestion and export
Tracing3Feedback and trace retrieval
Users & Workspaces20User management, invites, workspace members
Audit1Audit 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:

FeatureRequired
Analytics, log exports, audit logsEnterprise plan + analytics.view scope
User management, invitesOrganization-level API key
Integration models/workspacesOrganization-level API key
Prompt completionscompletions.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:

bash
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):

bash
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

VariableDefaultDescription
PORTKEY_API_KEY(required)Your Portkey API key
MCP_HOST127.0.0.1Bind address
MCP_PORT3000Port
MCP_PUBLIC_BASE_URLPublic absolute base URL to advertise from /auth/info and the status page; recommended for hosted deployments
MCP_AUTH_MODEnonenone, bearer, or clerk (none is blocked for HTTP unless explicitly overridden)
MCP_AUTH_TOKENSecret for bearer auth
MCP_ALLOW_UNAUTHENTICATED_HTTPSet to true only for intentional local unauthenticated HTTP debugging
MCP_SESSION_MODEstatefulstateful or stateless
MCP_MAX_SESSIONS100Maximum concurrent stateful MCP sessions before new initialize requests are rejected
MCP_EVENT_STOREoffoff, memory, or redis
MCP_REDIS_URLRedis URL for shared event store
MCP_TLS_KEY_PATHTLS key for native HTTPS
MCP_TLS_CERT_PATHTLS cert for native HTTPS
ALLOWED_ORIGINSCORS allow-list
MCP_TRUST_PROXYfalseTrust proxy headers (for reverse proxies)
RATE_LIMIT_MAX_BUCKETS10000Maximum distinct in-memory rate-limit buckets before new clients share an overflow bucket
<details> <summary><strong>Vercel deployment</strong></summary>

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_URL to your deployment URL so advertised MCP endpoints never depend on request headers
  • Vercel does not support WebSockets — Streamable HTTP/SSE only
</details> <details> <summary><strong>Docker</strong></summary>
bash
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
</details>

Health Endpoints

PathPurpose
GET /healthServer liveness
GET /readyReadiness (includes optional Portkey connectivity check)
GET /auth/infoAuth configuration metadata

Development

bash
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

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论