Alephant Mcp

io.github.AlephantAI由 GitHub 账号 AlephantAI 发布v0.1.3更新于 Oct 24, 2026

Alephant MCP server for AI cost control, BYO-key routing, 50+ providers, and 320+ models.

概览

AI 生成的概览

本地 stdio MCP 服务器,用于 Alephant BYO-key 的 AI 成本管控,向助手提供用量、预算与工作区 FinOps 分析。

可以做什么
  • 检查连接状态,读取用量汇总、每日成本、按模型成本与可用模型列表
  • 查看虚拟密钥驾驶舱范围、预算与最近请求(只读 VK 模式)
  • 查看工作区概览、预算状态、订阅信息、近 24 小时用量、时间序列与迷你趋势图
  • 管理虚拟密钥:列出、创建、调整预算与吊销
  • 分析智能体、成员与部门,设置预算策略,诊断成本异常、下钻支出、查找闲置资源并对比周期
  • 运行成本审计与成本优化提示词
适用场景
适合需要让助手回答 AI 花费、预算以及按模型或按团队成本问题,或在 Cursor、Claude Desktop、Codex、Claude Code 等聊天客户端中管理虚拟密钥与预算策略的场景。
运行要求
通过 npx 运行 npm 包 @alephantai/mcp,需要 Node.js。需设置 ALEPHANT_API_BASE_URL,并配置 ALEPHANT_VIRTUAL_KEY(只读 VK 模式)或 ALEPHANT_PAT 加 ALEPHANT_WORKSPACE_ID(Manager 模式);两者都未设置时进程会报错退出。可选 ALEPHANT_RATE_LIMIT_RPM 默认 60。需要能访问 Alephant API 的网络。
安装前请注意
需要密钥凭据:ALEPHANT_PAT(工作区级 Manager 权限)或 ALEPHANT_VIRTUAL_KEY;两者同时存在时 PAT 优先。Manager 模式可创建、吊销虚拟密钥并修改预算策略,助手操作会改变工作区设置。每个凭据范围应使用单独的服务器条目,避免把令牌写入共享项目配置。不提供请求日志。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Alephant Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

ModeEnvironmentTools
VKALEPHANT_VIRTUAL_KEYCockpit-scoped usage + 3 VK tools (8 tools total incl. shared)
ManagerALEPHANT_PAT + ALEPHANT_WORKSPACE_IDWorkspace-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:

powershell
npm start# ornode .\bin\alephant-mcp.js

To verify npx the same way end users do, run it from any other directory (e.g. the parent folder):

powershell
cd ..npx -y @alephantai/mcp

From a normal project folder (after npm install @alephantai/mcp), you can also run:

powershell
node .\node_modules\@alephantai\mcp\bin\alephant-mcp.js

If npx -y @alephantai/mcp still fails outside the clone, try:

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

json
{  "mcpServers": {    "alephant": {      "command": "npx",      "args": ["-y", "@alephantai/mcp"],      "env": {        "ALEPHANT_API_BASE_URL": "https://alephant.io",        "ALEPHANT_VIRTUAL_KEY": "vk-..."      }    }  }}

Personal Access Token (manager):

json
{  "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:

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 = 20tool_timeout_sec = 120

For Manager mode, replace the VK env with:

toml
env = {  ALEPHANT_API_BASE_URL = "https://alephant.io",  ALEPHANT_PAT = "pat_...",  ALEPHANT_WORKSPACE_ID = "00000000-0000-0000-0000-000000000000"}

Verify with:

bash
codex mcp listcodex mcp get alephant

OpenCode

Add a local MCP server under mcp in your OpenCode config, for example opencode.json:

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:

bash
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 userclaude mcp listclaude mcp get alephant

For a shared project config, create .mcp.json in the project root:

json
{  "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

bash
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

Development

bash
npm installnpm testnpm run build

Package

Published as @alephantai/mcp (alephant-mcp binary).

来源:README.md,提交 c4f4a1f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

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

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。