Alephant MCP
OfficialThe Alephant MCP server provides AI cost analytics and virtual key management for Alephant BYO-KEY, usable from MCP-compatible hosts like Cursor and Claude Desktop. It operates in two modes:
All Modes
Check API Connectivity — Verify the Alephant API is reachable and credentials are valid
Usage Summary — Total spend, request counts, and token usage for a chosen period (24h, 7d, 30d, or billing cycle)
Daily Costs — Day-by-day AI spend breakdown
Cost by Model — Spend and request volume broken down by AI model
List Available Models — Discover accessible AI models under the current credential scope
Virtual Key (VK) Mode
View virtual key scope, limits, and accessible resources
Check budget status and remaining allowance
Browse recent API requests (with pagination)
Manager Mode (Personal Access Token)
Workspace overview, budget status, and subscription info
Manage virtual keys (create, update budget, revoke)
Agent, member, and department analytics
Set budget policies and view live 24h data
Advanced insights: cost anomaly diagnosis, executive dashboards, spend drill-downs, idle resource detection, and entity period comparisons
Pre-built prompts for cost audit reports and optimization
Alephant MCP Server
Model Context Protocol server for Alephant BYO-KEY: FinOps metrics, virtual keys, and workspace analytics from Cursor, Claude Desktop, or any MCP host.
Modes
Mode | Environment | Tools |
VK |
| Cockpit-scoped usage + 3 VK tools (8 tools total incl. shared) |
Manager |
| Workspace-wide management (27 tools total incl. shared) |
PAT takes precedence when ALEPHANT_PAT is non-empty. If neither VK nor PAT is set, the process exits with an error (no mock data).
Required (both modes): ALEPHANT_API_BASE_URL
Optional: ALEPHANT_RATE_LIMIT_RPM (default 60, use 0 to disable client-side throttling)
Windows / npx troubleshooting
From this repo’s root (alephant-mcp/): do not use npx -y @alephantai/mcp to “smoke test” the published package. npm treats the current directory as the local @alephantai/mcp project and does not link the root package’s bin into node_modules/.bin, so Windows then fails with 'alephant-mcp' is not recognized (or the Chinese CMD equivalent).
Use one of these instead while developing in the clone:
npm start
# or
node .\bin\alephant-mcp.jsTo verify npx the same way end users do, run it from any other directory (e.g. the parent folder):
cd ..
npx -y @alephantai/mcpFrom a normal project folder (after npm install @alephantai/mcp), you can also run:
node .\node_modules\@alephantai\mcp\bin\alephant-mcp.jsIf npx -y @alephantai/mcp still fails outside the clone, try:
npx --yes --package=@alephantai/mcp alephant-mcpPublished packages 0.0.2+ include the bin/alephant-mcp.js shim for reliable npm bin resolution when installed from the registry.
Related MCP server: TokenSaver MCP
MCP client config
Alephant MCP is a local stdio server. Use one server entry per credential scope. For multiple workspaces, create multiple entries with different names and environment variables.
Cursor / Claude Desktop
Virtual Key (read-only / scoped cockpit):
{
"mcpServers": {
"alephant": {
"command": "npx",
"args": ["-y", "@alephantai/mcp"],
"env": {
"ALEPHANT_API_BASE_URL": "https://alephant.io",
"ALEPHANT_VIRTUAL_KEY": "vk-..."
}
}
}
}Personal Access Token (manager):
{
"mcpServers": {
"alephant-workspace-a": {
"command": "npx",
"args": ["-y", "@alephantai/mcp"],
"env": {
"ALEPHANT_API_BASE_URL": "https://alephant.io",
"ALEPHANT_PAT": "pat_...",
"ALEPHANT_WORKSPACE_ID": "00000000-0000-0000-0000-000000000000"
}
}
}
}Use separate mcpServers entries per workspace when you have multiple PATs.
Codex
Add a stdio MCP server in ~/.codex/config.toml:
[mcp_servers.alephant]
command = "npx"
args = ["-y", "@alephantai/mcp"]
env = {
ALEPHANT_API_BASE_URL = "https://alephant.io",
ALEPHANT_VIRTUAL_KEY = "vk-..."
}
startup_timeout_sec = 20
tool_timeout_sec = 120For Manager mode, replace the VK env with:
env = {
ALEPHANT_API_BASE_URL = "https://alephant.io",
ALEPHANT_PAT = "pat_...",
ALEPHANT_WORKSPACE_ID = "00000000-0000-0000-0000-000000000000"
}Verify with:
codex mcp list
codex mcp get alephantOpenCode
Add a local MCP server under mcp in your OpenCode config, for example opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"alephant": {
"type": "local",
"command": ["npx", "-y", "@alephantai/mcp"],
"enabled": true,
"environment": {
"ALEPHANT_API_BASE_URL": "https://alephant.io",
"ALEPHANT_VIRTUAL_KEY": "vk-..."
}
}
}
}For Manager mode, use ALEPHANT_PAT and ALEPHANT_WORKSPACE_ID in environment instead of ALEPHANT_VIRTUAL_KEY.
Claude Code
Use the CLI to add Alephant as a local stdio server:
claude mcp add-json alephant '{"type":"stdio","command":"npx","args":["-y","@alephantai/mcp"],"env":{"ALEPHANT_API_BASE_URL":"https://alephant.io","ALEPHANT_VIRTUAL_KEY":"vk-..."}}' --scope user
claude mcp list
claude mcp get alephantFor a shared project config, create .mcp.json in the project root:
{
"mcpServers": {
"alephant": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@alephantai/mcp"],
"env": {
"ALEPHANT_API_BASE_URL": "https://alephant.io",
"ALEPHANT_VIRTUAL_KEY": "vk-..."
}
}
}
}For Manager mode, replace the VK env with ALEPHANT_PAT and ALEPHANT_WORKSPACE_ID.
CLI audit
npx --yes --package=@alephantai/mcp alephant-mcp --auditVK: prints cockpit
scope+usage-summary(billing cycle).Manager: prints workspace id +
GET /api/v1/analytics/overview.
Tools (summary)
Shared (both modes): check_alephant_connection, get_usage_summary, get_daily_costs, get_cost_by_model, list_available_models
VK only: get_my_scope, get_my_budget, get_my_recent_requests
Manager only: get_workspace_overview, get_workspace_budget_status, list_virtual_keys, create_virtual_key, update_key_budget, revoke_virtual_key, list_agents, get_agent_analytics, list_members, get_member_analytics, list_departments, get_department_analytics, get_subscription_info, set_budget_policy, get_live_24h, get_usage_timeseries, get_sparklines, diagnose_cost_anomaly, get_executive_dashboard, drill_down_spend, find_idle_resources, compare_entity_periods
get_request_logs is not included (JWT-only backend route).
Prompts & resources
cost_audit_report — both modes
cost_optimization — manager only
Documentation
中文:在 AI Agent 中如何使用 MCP — 自然语言提问示例、
/alephant-…快捷模板、工具对照表Marketplace submission: see
docs/marketplace-submission.mdfor official MCP Registry, Smithery, and Glama submission notes.
Development
npm install
npm test
npm run buildPackage
Published as @alephantai/mcp (alephant-mcp binary).
Available Tools
8 toolscheck_alephant_connectionARead-onlyIdempotent
Checks Alephant API connectivity and credential usability for the current MCP mode.
Inputs: no named parameters.
get_cost_by_modelARead-onlyIdempotent
Breaks down AI spend and request volume by model for the selected period.
Inputs: period.
get_daily_costsARead-onlyIdempotent
Returns daily AI spend for the selected period.
Inputs: period.
get_my_budgetARead-onlyIdempotent
Returns budget status for the current virtual key.
Inputs: period.
get_my_recent_requestsBRead-onlyIdempotent
Returns recent requests made with the current virtual key.
Inputs: limit, offset.
get_my_scopeARead-onlyIdempotent
Returns the current virtual key scope, limits, and accessible resources.
Inputs: no named parameters.
get_usage_summaryARead-onlyIdempotent
Returns total spend, requests, and token usage for the selected period.
Inputs: period.
list_available_modelsARead-onlyIdempotent
Lists models available through Alephant for the current credential scope.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct aspect: connection check, cost breakdowns (by model, daily, total), budget status, recent requests, scope, and model listing. No two tools have overlapping purposes.
All tools follow a consistent verb_noun pattern (e.g., check_alephant_connection, get_cost_by_model, list_available_models) with clear, predictable naming.
With 8 tools, the server is well-scoped for monitoring and managing Alephant API usage. The count is neither too sparse nor excessive.
The set covers essential monitoring needs (connection, costs, budget, requests, scope, models). Missing are management actions like updating budgets or keys, but the core monitoring surface is complete.
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP server for building and testing AI agents with multi-model experimentation and insights.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.230MIT
- AlicenseAqualityDmaintenanceAn MCP server that reduces AI API costs by up to 97% through token measurement, compression, caching, and pruning, all without changing prompts.101Apache 2.0
- FlicenseAqualityDmaintenanceUnified MCP server for querying multiple LLM providers (Gemini, OpenAI, Anthropic, etc.) with advanced routing, cost optimization, and fallback resilience.236 npm-
- AlicenseNot gradedqualityDmaintenanceMCP server that routes AI chat requests to the best available provider (Anthropic, OpenAI, Groq, etc.) with automatic fallback, budget caps, and model-tier routing.MIT