AI Admin API MCP Server
Query OpenAI Admin API for usage, costs, projects, users, and project API keys.
Click on "Deploy 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., "@AI Admin API MCP Server show my OpenAI usage for this month"
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.
AI Admin API MCP Server
Read-only MCP server for querying AI provider administration APIs and returning normalized usage, cost, and dashboard data.
Status
Built-in providers:
OpenAI Admin API usage, costs, projects, users, and project API keys.
Anthropic Admin API organization metadata, workspaces, API keys, messages usage, and costs.
ElevenLabs workspace credit usage analytics, API request analytics, audit logs, user/subscription metadata, service accounts, and service-account API keys.
OpenRouter management-key analytics, recent activity, credits, API key metadata, generation metadata, and model pricing metadata.
Planned providers:
Google Cloud Billing export through BigQuery. This provider is not implemented yet. When it ships, release notes must state that direct BigQuery billing export queries can incur Google Cloud query costs.
All MCP tools are read-only. The server does not expose provider mutation tools.
External provider plugins can be loaded at startup with AI_ADMIN_PROVIDER_PLUGINS. See Provider Plugins.
Related MCP server: openai-usage-mcp
Tech Stack
Node.js 22+
TypeScript
pnpm
@modelcontextprotocol/sdkZod input schemas
Vitest
Quick Start
Run the published package with npx:
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
npx @amaretto-software-labs/ai-admin-api-mcp --stdioPin a specific published version:
npx @amaretto-software-labs/ai-admin-api-mcp@0.0.1 --stdioFor local repo development:
pnpm install
pnpm check
pnpm testRun over STDIO:
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
pnpm start:stdioRun over Streamable HTTP:
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
MCP_HTTP_AUTH_TOKEN=local-proxy-token \
pnpm start:httpHTTP listens on http://127.0.0.1:8787/mcp. Pass --unsafe-local-http only for local development where another process already protects the endpoint.
Run the gateway-compatible local HTTPS endpoint with a local development certificate:
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
MCP_HTTP_AUTH_TOKEN=local-proxy-token \
MCP_HTTPS_CERT_PATH=/path/to/localhost.pem \
MCP_HTTPS_KEY_PATH=/path/to/localhost.key \
pnpm start:httpsHTTPS listens on https://127.0.0.1:8787/mcp.
Use the published package for Streamable HTTP or HTTPS by passing the same flags to npx:
MCP_HTTP_AUTH_TOKEN=local-proxy-token \
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
npx @amaretto-software-labs/ai-admin-api-mcp --http --port 8787MCP_HTTP_AUTH_TOKEN=local-proxy-token \
OPENAI_ADMIN_KEY=sk-admin-... \
ANTHROPIC_ADMIN_KEY=sk-ant-admin-... \
ELEVENLABS_API_KEY=xi-... \
OPENROUTER_MANAGEMENT_KEY=or-mgmt-... \
MCP_HTTPS_CERT_PATH=/path/to/localhost.pem \
MCP_HTTPS_KEY_PATH=/path/to/localhost.key \
npx @amaretto-software-labs/ai-admin-api-mcp --https --port 8787Configuration
Variable | Required | Description |
| No | Comma-separated provider ids. If omitted, loaded provider plugins may infer enablement from config/credentials. |
| No | Comma-separated trusted ESM module specifiers, paths, or |
| No | Comma-separated providers that must be enabled and report configured status at startup. |
| No | Only |
| OpenAI static mode | OpenAI Admin API key. |
| No | Override for tests or compatible OpenAI Admin API gateways. Defaults to |
| Anthropic static mode | Anthropic Admin API key, sent as |
| Anthropic static mode | Optional Anthropic OAuth bearer token with admin scope. |
| No | Override for tests or compatible Anthropic Admin API gateways. Defaults to |
| No | Anthropic API version. Defaults to |
| No | Comma-separated Anthropic beta headers, for example |
| ElevenLabs static mode | ElevenLabs API key, sent as |
| No | Override for tests or compatible ElevenLabs API gateways. Defaults to |
| OpenRouter aggregate reporting | OpenRouter management key, sent as bearer auth. Required for credits, activity, analytics, and API key metadata. |
| Optional OpenRouter static mode | OpenRouter API key for current-key, generation, and model metadata when no management key is configured. |
| No | Override for tests or compatible OpenRouter API gateways. Defaults to |
| No | Optional OpenRouter |
| No | Optional OpenRouter |
| HTTP mode | Bearer token required by the MCP HTTP endpoint unless unsafe local mode is used. |
| HTTPS mode | PEM certificate path for local HTTPS. |
| HTTPS mode | PEM private-key path for local HTTPS. |
| No | Dashboard bundle cache TTL in seconds. Metadata list tools cache for 300 seconds. Defaults to |
| No | Optional user agent context for future outbound request metadata. |
Credentials
Provider credentials must come from environment variables or an external host secret integration. They must never be sent as normal MCP tool arguments.
In v0.1 static mode, these credential refs are accepted:
credential:openai:staticcredential:anthropic:staticcredential:elevenlabs:staticcredential:openrouter:staticcredential:openrouter:managementcredential:openrouter:api
Omit credential_ref to use the static provider credential. Unknown refs are rejected.
Pass-through and broker modes are deployment contracts for an operator-supplied gateway. The gateway, credential store, tenant policy, audit layer, and envelope signing are outside this runtime build. See pass-through gateway docs.
Tools
Common tools:
ai_admin_list_providersai_admin_query_usageai_admin_query_costsai_admin_query_dashboard_bundle
Common query tools accept provider-specific arguments under provider_options[provider_id]:
{
"providers": ["openai"],
"provider_options": {
"openai": {
"usage_endpoint": "images",
"group_by": ["project_id", "model"]
}
},
"start": "2026-06-01T00:00:00Z",
"end": "2026-06-02T00:00:00Z",
"bucket_width": "1d"
}OpenAI tools:
openai_admin_query_usageopenai_admin_query_costsopenai_admin_list_projectsopenai_admin_list_usersopenai_admin_list_project_api_keysopenai_admin_query_dashboard_bundle
Anthropic tools:
anthropic_admin_get_organizationanthropic_admin_list_workspacesanthropic_admin_list_api_keysanthropic_admin_query_messages_usageanthropic_admin_query_costsanthropic_admin_query_dashboard_bundle
ElevenLabs tools:
elevenlabs_admin_get_userelevenlabs_admin_get_subscriptionelevenlabs_admin_list_service_accountselevenlabs_admin_list_service_account_api_keyselevenlabs_admin_list_audit_logselevenlabs_admin_list_api_requestselevenlabs_admin_query_usageelevenlabs_admin_query_dashboard_bundle
OpenRouter tools:
openrouter_admin_get_current_keyopenrouter_admin_list_api_keysopenrouter_admin_get_api_keyopenrouter_admin_get_creditsopenrouter_admin_get_activityopenrouter_admin_get_analytics_metaopenrouter_admin_query_analyticsopenrouter_admin_get_generationopenrouter_admin_list_modelsopenrouter_admin_query_usageopenrouter_admin_query_costsopenrouter_admin_query_dashboard_bundle
Resources and Prompts
Resources:
ai-admin://providersai-admin://providers/{provider}/capabilitiesai-admin://schema/provider-capability-v1ai-admin://schema/usage-fact-v1ai-admin://schema/cost-fact-v1ai-admin://schema/dashboard-bundle-v1openai-admin://capabilitiesanthropic-admin://capabilitieselevenlabs-admin://capabilitiesopenrouter-admin://capabilities
External provider plugins can register their own tools and resources.
Prompts:
build_usage_dashboardinvestigate_cost_spikeexport_finance_report
Provider Notes
OpenAI usage endpoints have endpoint-specific filters, groupings, and metrics. Unsupported parameters are rejected before any provider call.
Anthropic costs are reported in minor units and normalized to USD major units. Priority Tier costs are not included in the Anthropic cost endpoint.
Anthropic
speedusage filters/groupings requireANTHROPIC_BETA=fast-mode-2026-02-01.ElevenLabs workspace analytics reports credit usage. The provider exposes
credit_count; provider-reported monetary cost is not available from the implemented endpoint.OpenRouter aggregate reporting requires
OPENROUTER_MANAGEMENT_KEY. Analytics metadata/query endpoints are beta, activity is limited to the provider-supported completed UTC-day window, and generation metadata is a point lookup. OpenRouter spend values are normalized asopenrouter_credituntil USD semantics are confirmed.Google Cloud Billing support is planned only. BigQuery queries against billing export tables can be cost-bearing.
MCP Client Example
{
"mcpServers": {
"ai-admin-api": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/ai-admin-api-mcp", "start:stdio"],
"env": {
"OPENAI_ADMIN_KEY": "sk-admin-...",
"ANTHROPIC_ADMIN_KEY": "sk-ant-admin-...",
"ELEVENLABS_API_KEY": "xi-...",
"OPENROUTER_MANAGEMENT_KEY": "or-mgmt-..."
}
}
}
}Docker
docker build -t ai-admin-api-mcp .
docker run --rm -p 8787:8787 \
-e OPENAI_ADMIN_KEY \
-e ANTHROPIC_ADMIN_KEY \
-e ELEVENLABS_API_KEY \
-e OPENROUTER_MANAGEMENT_KEY \
-e MCP_HTTP_AUTH_TOKEN \
ai-admin-api-mcpThe Docker image starts Streamable HTTP mode by default.
Development
pnpm check
pnpm test
pnpm test:live:openai
pnpm test:live:anthropic
pnpm test:live:openrouterLive tests are skipped unless provider credentials are present.
Release
The Build and Publish GitHub Actions workflow runs pnpm check and pnpm test on pushes and pull requests targeting main.
Releases are manual through Actions -> Build and Publish -> Run workflow on main.
Inputs:
package-version: optional SemVer override. If omitted, the workflow uses the committed package version.npm-tag: npm dist-tag to use when publishing. Defaults tolatest.publish-to-npm: set totrueto publish@amaretto-software-labs/ai-admin-api-mcpto npm after the release is created.
The release job aligns the @amaretto-software-labs/ai-admin-api-mcp package version in the runner, rebuilds and tests the package, packs one npm tarball, pushes a v<package-version> git tag, creates a GitHub Release with the packed artifact, and optionally publishes @amaretto-software-labs/ai-admin-api-mcp to npm using trusted publishing. Configure npm trusted publishing for this repository and package before enabling publish-to-npm.
Available Tools
4 toolsai_admin_list_providersARead-only
List enabled providers, health, configured reporting surfaces, and known limitations.
Inputs: no named parameters.
ai_admin_query_costsARead-only
Query normalized cost facts from one or more enabled providers. Pass provider-specific options under provider_options[provider_id].
Inputs: end (required), start (required), providers, include_raw, +2 more.
ai_admin_query_dashboard_bundleARead-only
Build dashboard bundles across one or more enabled providers. Pass provider-specific options under provider_options[provider_id].
Inputs: end, start, top_n, providers, +4 more.
ai_admin_query_usageARead-only
Query normalized usage facts from one or more enabled providers. Pass provider-specific options under provider_options[provider_id].
Inputs: end (required), start (required), providers, include_raw, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct concern: listing providers, querying usage, querying costs, and querying dashboard bundles. The descriptions make clear boundaries between them, and the dashboard bundle is a combined view rather than overlapping the individual queries.
All tool names follow the same verb_noun pattern with a consistent 'ai_admin' prefix. The verbs are distinct and appropriately chosen for their actions, and the naming is uniform and predictable.
With 4 tools, the server is well-scoped for its purpose. Each tool fulfills a necessary role in the admin/query domain, and the count is neither too thin nor excessive.
The tools cover the core read-side needs for AI administration: listing providers and querying usage, costs, and dashboards. However, there are no write or management operations (e.g., enabling/disabling providers), which could be considered a gap for a full admin API, though it's acceptable for a monitoring-focused server.
Maintenance
Related MCP Connectors
- Costory FinOps MCPDeprecatedio.costory
FinOps harness MCP: cloud, data and LLM bills normalized and allocated to teams. Cloud read-only.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Read-only MCP for AI usage profiles, leaderboards, stats, and docs; no writes or private data.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server for unified cost tracking and analysis across AWS, OpenAI, and Anthropic. It enables users to query expenditures, compare costs across providers, and analyze usage trends through natural language.10MIT
- AlicenseAqualityDmaintenanceMCP server for querying OpenAI usage and cost data, including spend summaries, daily breakdowns, month-over-month comparisons, and token usage by model.3MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that reports AI agent costs (tokens, latency, dollars) with per-tenant isolation via OAuth, and includes an ADK agent for natural-language queries.Apache 2.0
- AlicenseAqualityCmaintenanceCloudOps MCP is a read-only Model Context Protocol server that exposes normalized operational infrastructure context (logs, metrics, deployments, health) to AI agents through a small set of typed, bounded tools.6MIT