Portkey Admin Mcp

io.github.s-b-e-n-s-o-n由 GitHub 帳號 s-b-e-n-s-o-n 發布v0.3.4更新於 Oct 28, 2026

Full Portkey Admin API MCP server — configs, prompts, keys, analytics, and more.

概覽

AI 產生的概覽

Portkey Admin API 的 MCP 伺服器,提供 194 個工具,涵蓋提示詞、設定、API 金鑰、護欄、分析與工作區管理。

可以做什麼
  • 建立、版本化、轉譯、執行與晉升提示詞,並管理片段、標籤與集合
  • 管理閘道設定、部署、供應商、虛擬金鑰與 API 金鑰
  • 管理護欄、存取政策、對外白名單、用量與速率限制
  • 查詢成本、延遲、權杖、錯誤、快取與回饋等分析資料,讀取日誌與稽核紀錄
  • 管理使用者、工作區、邀請、SCIM 對應、整合與 MCP 伺服器註冊
適用情境
適合需要管理 Portkey AI 閘道的情境:讓助理在對話中檢視或修改提示詞、路由設定、金鑰、護欄與用量資料。若只需少數領域,建議縮小暴露的工具領域,因為完整工具目錄相當龐大。
執行需求
透過 npx 以 stdio 在本機執行(需 Node.js),或從原始碼建置後執行。需要具備適當權限範圍的 Portkey API 金鑰,放在 PORTKEY_API_KEY 中;PORTKEY_BASE_URL 可指向自架閘道。選用的 PORTKEY_TOOL_DOMAINS 可限定暴露的工具領域。需要能連線至 Portkey Admin API 的網路。
安裝前請注意
此 API 金鑰可建立、輪替與刪除 API 金鑰、虛擬金鑰、設定、護欄及工作區成員,應授予最小必要權限。許多工具會寫入或刪除資料。56 個工具僅限企業版,其他方案會回傳 403。執行提示詞完成可能產生計費。選用的 HTTP 模式下,所有通過驗證的呼叫端共用同一個 Portkey 憑證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Portkey Admin Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Portkey Admin MCP icon]

Portkey Admin MCP Server

The Portkey Admin API as an MCP server — 194 tools across prompts, configs, keys, analytics, governance, deployments, and more.

[npm version] [Node.js] [License: MIT]

[CI] [OpenSSF Scorecard] [OpenSSF Best Practices] [Maintainability] [Code Coverage]

[npm downloads] [Mentioned in Awesome MCP Servers] [MCP Registry] [Sponsor]


[!IMPORTANT] Active compatibility development. Palo Alto Networks completed its Portkey acquisition on 2026‑05‑29 and now presents Portkey as the core of Prisma AIRS AI Gateway. The Portkey Admin API remains live, and its official OpenAPI and product changelog continued adding control-plane surfaces through October 2026; this project has therefore resumed API-coverage work. It targets the Portkey-compatible API (x-portkey-api-key), not Prisma AIRS/Strata Cloud Manager directly. Palo Alto now publishes a Prisma AIRS management specification, but it uses different authentication, multiple management bases, and a smaller domain set, so it is not a PORTKEY_BASE_URL swap. See the short Prisma AIRS interoperability guide for the supported side-by-side model and adapter criteria.

Contents


Documentation

ResourceLink
Tool referenceENDPOINTS.md
Compatibility and deprecationsCOMPATIBILITY.md
ChangelogCHANGELOG.md
RoadmapROADMAP.md
ArchitectureArchitecture
DeploymentHTTP configuration, Vercel guide
DistributionDirectories and release records, verify a release
Prisma AIRSInteroperability guide
Contributing and governanceCONTRIBUTING.md, GOVERNANCE.md, Code of Conduct
SecurityReporting policy, assurance case

Quick Start

You need a Portkey API key with appropriate scopes. Get one from your Portkey dashboard under API Keys.

Version 0.15.0 uses MCP SDK v2 and serves protocol revision 2026-07-28 and older clients on the same endpoint. It retires HTTP sessions and replay; obsolete settings warn and are ignored. See compatibility and deprecations before upgrading from 0.14.x.

Claude Code

bash
claude mcp add -e PORTKEY_API_KEY=your_key portkey-admin -- npx -y portkey-admin-mcp

Cursor / Windsurf

Add to your MCP config (Cursor: .cursor/mcp.json or ~/.cursor/mcp.json; Windsurf: ~/.codeium/windsurf/mcp_config.json):

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

VS Code

VS Code's .vscode/mcp.json uses a top-level servers key and needs a type:

json
{  "servers": {    "portkey-admin": {      "type": "stdio",      "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

To expose only a focused subset of tools in stdio clients, set PORTKEY_TOOL_DOMAINS:

bash
PORTKEY_API_KEY=your_key \PORTKEY_TOOL_DOMAINS=prompts,analytics \npx -y portkey-admin-mcp

Scoping domains is also the biggest lever on context cost, not just access. tools/list is paginated, and the complete 194-tool catalog is roughly 400 KB once a client follows nextCursor through every page. Narrowing to the domains a client actually needs cuts that roughly proportionally.

Build from source
bash
git clone https://github.com/CodesWhat/portkey-admin-mcp.gitcd portkey-admin-mcpnpm 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"      }    }  }}

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
Deployments5Register, inspect, update, and archive self-hosted Gateways
API Keys6Create, rotate, and manage scoped API keys
Secret References5Manage AWS, Azure, and HashiCorp external-secret references
Virtual Keys5Manage provider access keys
Collections5Group prompts by app or project
Providers5Manage AI provider configurations
Integrations11Provider integrations, model pricing, models, workspace access
MCP Integrations10External MCP tool integrations
MCP Servers12MCP server registry, capabilities, and live connections
Guardrails14LLM and MCP-tool policies, server mappings, organisation defaults, workspace exclusions
Access Policies5Allow/deny users, groups, and agents access to MCP tools and provider models
Egress Allowlist5Organisation trust for custom outbound hosts
Usage Limits7Cost and token consumption limits
Rate Limits5Request frequency controls
Analytics25Cost, latency, errors, tokens, cache, feedback, provider, MCP, A2A, and workspace groups; organisation scope and workspace exclusions
Logging10Log retrieval, ingestion, export, and field restrictions
Tracing2Feedback creation and updates on traces
Users & Workspaces24User management, invites, workspace members, SCIM group mappings
Audit1Audit log access

194 tools total across 22 tool domains. See ENDPOINTS.md for the full list with descriptions.

Portkey's newer product language increasingly presents provider credentials as Providers, while the current Admin API still exposes both /virtual-keys and /providers. This server keeps both domains: Virtual Keys manage provider access credentials, and Providers manage workspace provider configurations.


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.

If a tool returns a 403 with Portkey error AB03, it means missing scopes — not a broken endpoint.

Enterprise-gated tools and other scope requirements

Enterprise-gated tools (56)

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.

AreaToolsRequired scope
Analytics (25)get_cost_analytics, get_request_analytics, get_token_analytics, get_latency_analytics, get_error_analytics, get_error_rate_analytics, get_cache_hit_latency, get_cache_hit_rate, get_cache_summary, get_users_analytics, get_error_stacks_analytics, get_error_status_codes_analytics, get_user_requests_analytics, get_rescued_requests_analytics, get_feedback_analytics, get_feedback_models_analytics, get_feedback_scores_analytics, get_feedback_weighted_analytics, get_analytics_group_users, get_analytics_group_models, get_analytics_group_metadata, get_analytics_group_providers, get_analytics_group_mcp, get_analytics_group_a2a, get_analytics_group_workspacesorg-level analytics.view
Deployments (5)list_deployments, register_deployment, get_deployment, update_deployment, archive_deploymentEnterprise deployment administration
Auditlist_audit_logsaudit_logs.list
Org-level integrationsget_integration, list_integration_models, list_integration_workspacesorganisation_integrations.read
Org-level userslist_all_users, get_user, get_user_stats, list_user_invitesorganisation_users.list / organisation_users.read
Organisation guardrails (6)get_organisation_defaults, update_organisation_defaults, list_input_guardrail_workspace_exclusions, update_input_guardrail_workspace_exclusions, list_output_guardrail_workspace_exclusions, update_output_guardrail_workspace_exclusionsorganisation_settings.read/update and organisation_exclusions.list/update
Log exports (8)create_log_export, list_log_exports, get_log_export, start_log_export, cancel_log_export, download_log_export, update_log_export, get_log_export_field_restrictionsEnterprise Logs Export + logs.export
SCIM groups (4)list_scim_groups, list_scim_workspace_mappings, create_scim_workspace_mapping, delete_scim_workspace_mappingSCIM enabled + organisation admin access

Other scope requirements

FeatureRequired
Prompt completions (run_prompt_completion)completions.write scope + billing metadata (app, env)
Org-level service API key creation via create_api_keyorganisation_service_api_keys.create (Enterprise)

HTTP Server (Experimental)

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.

The server supports Streamable HTTP for remote access:

HTTP authentication controls access to the server, but it does not impersonate separate Portkey tenants. All authenticated principals use the same configured PORTKEY_API_KEY and can invoke any enabled tool and scope that credential grants. Run separate instances or deployments with separately scoped Portkey credentials and PORTKEY_TOOL_DOMAINS allowlists for different trust levels.

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.

Full environment variable reference
VariableDefaultDescription
PORTKEY_API_KEY(required)Your Portkey API key
PORTKEY_BASE_URLhttps://api.portkey.ai/v1Portkey Admin API base URL. Prisma AIRS/SCM URLs are not compatible; credentialed requests never auto-follow redirects
PORTKEY_ALLOW_PRIVATE_BASE_URL—Set to true to allow a literal loopback/private PORTKEY_BASE_URL
PORTKEY_ALLOW_INSECURE_HTTP—Separately set to true only when a trusted self-hosted gateway cannot use HTTPS
PORTKEY_TOOL_DOMAINS—Server-side allowlist of the 22 domains: users, workspaces, configs, deployments, keys, collections, prompts, analytics, guardrails, limits, audit, labels, partials, tracing, logging, providers, secret-references, integrations, mcp-integrations, mcp-servers, access-policies, egress-allowlist. HTTP ?tools= may narrow it but cannot expand it
MCP_TOOL_DOMAINS—Fallback for PORTKEY_TOOL_DOMAINS, used only when that is unset
MCP_TRANSPORTstdiostdio or http; the Docker image picks its entrypoint from this (set http for the HTTP server)
MCP_HOST127.0.0.1Bind address
MCP_PORT3000Port
PORT—Port override; takes precedence over MCP_PORT when set
MCP_PUBLIC_BASE_URL—Public 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_TOKEN—Secret for bearer auth
CLERK_ISSUER / CLERK_AUDIENCE—Required issuer and audience when MCP_AUTH_MODE=clerk
CLERK_JWKS_URL<CLERK_ISSUER>/.well-known/jwks.jsonJWKS endpoint for Clerk JWT verification; must be HTTPS. Set it only when the JWKS isn't at the default path
CLERK_ALLOWED_SUBJECTS—Optional CSV subject allowlist for Clerk; at least one Clerk authorization policy is required
CLERK_ALLOWED_ORGANIZATION_IDS / CLERK_ALLOWED_ROLES—Optional CSV organization and role constraints; every configured constraint must match
CLERK_REQUIRED_PERMISSIONS—Optional CSV permissions that must all be present in the verified Clerk JWT
MCP_ALLOW_UNAUTHENTICATED_HTTP—Set to true only for intentional local unauthenticated HTTP debugging
MCP_MAX_SESSIONS100Maximum concurrent HTTP MCP request handlers (retained name)
MCP_REDIS_URL—Fallback Redis URL for shared rate limiting, after RATE_LIMIT_REDIS_URL and before REDIS_URL; production requires rediss://
MCP_SESSION_MODE, MCP_SESSION_TIMEOUT, MCP_EVENT_*, MCP_REDIS_KEY_PREFIXIgnored as of 0.15.0Old session/replay settings produce a warning containing names only. 0.14.x behavior is unchanged; see compatibility.
MCP_TLS_KEY_PATH—TLS key for native HTTPS
MCP_TLS_CERT_PATH—TLS cert for native HTTPS
MCP_TLS_CA_PATH—Optional CA bundle for native HTTPS; only used when the TLS key and cert are set
MCP_SHUTDOWN_TIMEOUT_MS10000How long graceful shutdown waits before the process is forced to exit, in milliseconds; must be positive
MCP_MAX_REQUEST_SIZE1mbMaximum HTTP request body size; tool arguments also have a fixed budget of 10,000 array elements and object members, counted across nested input
MCP_READY_CHECK_MODElocallocal or portkey; portkey makes /ready also check Portkey connectivity
LOG_LEVELinfodebug, info, warn, or error
ALLOWED_ORIGINS—CORS allow-list; also used to validate the Host header (DNS-rebinding protection) when MCP_AUTH_MODE=none
CORS_ORIGIN—Legacy fallback for ALLOWED_ORIGINS, used only when that is unset
MCP_TRUST_PROXYloopbackExpress trust-proxy policy. Use an exact nonnegative hop count or trusted proxy subnet; true is rejected because it trusts forwarding headers from every peer
RATE_LIMIT_STOREmemoryredis for multi-instance/serverless deployments; production memory mode requires RATE_LIMIT_SINGLE_PROCESS=true
RATE_LIMIT_ENABLEDtrueSet to false to turn the pre-authentication rate limiter off
RATE_LIMIT_SINGLE_PROCESS—Set to true to acknowledge a single-process deployment when using in-memory limiting in production
RATE_LIMIT_REDIS_URL—Shared limiter Redis URL, falling back to MCP_REDIS_URL/REDIS_URL; production requires rediss://
RATE_LIMIT_REDIS_KEY_PREFIXmcp:rate-limitRedis namespace for atomic pre-authentication IP and principal-plus-IP token buckets
RATE_LIMIT_MAX60Maximum tokens in each pre-authentication IP and principal-plus-IP bucket
RATE_LIMIT_WINDOW_MS60000Rate-limit window in milliseconds
RATE_LIMIT_REFILL60Tokens refilled each window
RATE_LIMIT_MAX_BUCKETS10000Maximum local buckets in explicit memory mode before new clients share overflow capacity

Production containers must choose their rate-limit topology explicitly: set RATE_LIMIT_STORE=redis for multi-instance deployments, or set RATE_LIMIT_SINGLE_PROCESS=true only for a single long-lived process.

Vercel deployment

Vercel support is kept as a reference proof of concept — we do not run a hosted deployment. See docs/VERCEL_DEPLOYMENT.md if you want to self-deploy.

Key points:

  • Uses stateless request handling and a shared atomic Redis rate limiter (SDK v2); GET replay is retired
  • 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
Docker
bash
docker build -t portkey-admin-mcp .docker run \  -e PORTKEY_API_KEY=your_key \  -e MCP_TRANSPORT=http \  -e MCP_HOST=0.0.0.0 \  -e MCP_PORT=3000 \  -e MCP_AUTH_MODE=bearer \  -e MCP_AUTH_TOKEN=your_secret \  -e RATE_LIMIT_SINGLE_PROCESS=true \  -p 3000:3000 \  portkey-admin-mcp

This example runs one long-lived container with in-memory rate limiting. Use RATE_LIMIT_STORE=redis and a TLS Redis URL for multiple instances.

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 reloadnpm run dev:http      # HTTP with hot reloadnpm test              # unit + contract testsnpm run test:coverage # unit + contract tests with the enforced 80% line floornpm run test:e2e      # MCP protocol testsnpm run test:http     # HTTP endpoint smoke testnpm run smoke         # credentialed read-only Portkey API smoke suitenpm run ci            # full pipeline (lint + typecheck + coverage + build + e2e + verify)

The live smoke suite reports expected credential-scope denials and the explicitly tracked hosted control-plane route gaps as skips. Unexpected HTTP responses, network errors, and response-contract failures still fail the run.

list_audit_logs is Enterprise-only, so the smoke suite skips its check unless PORTKEY_ORGANISATION_ID is set. Set it to your organisation ID to exercise that route.

The required CI and release gates measure every TypeScript source file and fail below 80% line coverage. The CI and Coverage workflow reports show the current line, branch, and function coverage.

The CI workflow also runs the standalone Qlty CLI and publishes quality-reports artifacts for each analyzed commit, including lint/security results, duplication, complexity, and metrics. The Qlty maintainability badge remains Cloud-generated; local analysis does not update it. Coverage is reported through Codecov, not Qlty, and the Coverage workflow uploads it on every PR and on pushes to main and codex/**.

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.

Contributions use pull requests and the checks documented in CONTRIBUTING.md. Project decisions and maintainer roles are documented in GOVERNANCE.md. Report vulnerabilities through SECURITY.md, and see SECURITY-ASSURANCE.md for the public threat model and assurance case.


Roadmap

Release 0.15.0 moves to MCP SDK v2 and the 2026-07-28 spec. The roadmap separates completed work from upstream contract and tenant-verification gates. The MCP v2 migration shipped in 0.15.0 and keeps older clients on the same endpoint while retiring session and replay storage. See compatibility and deprecations.


Community

Questions and bug reports belong in Issues; broader discussion, ideas, and help using the server belong in Discussions.

The maintained package, registry, marketplace, and directory records are listed in Distribution and directories. Treat the generated tool catalog in this repository as authoritative when a third-party index lags.


Star History

[Star History chart for CodesWhat/portkey-admin-mcp]

來源:README.md,提交 c523690

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.4最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分