Alephant MCP
Alephant MCP server for AI cost control, BYO-key routing, 50+ providers, and 320+ models.
README
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 | ALEPHANT_VIRTUAL_KEY |
Cockpit-scoped usage + 3 VK tools (8 tools total incl. shared) |
| Manager | ALEPHANT_PAT + ALEPHANT_WORKSPACE_ID |
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.js
To verify npx the same way end users do, run it from any other directory (e.g. the parent folder):
cd ..
npx -y @alephantai/mcp
From a normal project folder (after npm install @alephantai/mcp), you can also run:
node .\node_modules\@alephantai\mcp\bin\alephant-mcp.js
If npx -y @alephantai/mcp still fails outside the clone, try:
npx --yes --package=@alephantai/mcp alephant-mcp
Published packages 0.0.2+ include the bin/alephant-mcp.js shim for reliable npm bin resolution when installed from the registry.
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 = 120
For 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 alephant
OpenCode
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 alephant
For 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 --audit
- VK: 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 build
Package
Published as @alephantai/mcp (alephant-mcp binary).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。