SandBase MCP
SandBase 通过统一的 MCP 接口提供对 2,000 多个 AI 模型和 API 工具的访问。一个账户即可覆盖 LLM、图像生成、视频生成、音频、嵌入、网页抓取、社交媒体 API 等更多功能。
设置
如果六个 sandbase_* MCP 工具尚未可用,请将当前机器连接到不可变的 v0.1.17 版本。仅在您信任的环境中运行远程包;当来源验证重要时,请使用下方经过校验和验证的路径:
npx -y https://github.com/sandbaseai/cli/releases/download/v0.1.17/sandbaseai-cli-0.1.17.tgz connect
如需校验和验证安装,请先下载相同的不可变资产,并验证随 GitHub Release 发布的 SHA-256:
curl -fLO https://github.com/sandbaseai/cli/releases/download/v0.1.17/sandbaseai-cli-0.1.17.tgz
printf '%s %s\n' '1ad535b2899ca460b57b3c268aef278fee28fd28e649a89b92951514fd71fffa' 'sandbaseai-cli-0.1.17.tgz' | shasum -a 256 -c -
npx -y ./sandbaseai-cli-0.1.17.tgz connect
批准浏览器中的登录一次。在浏览器中使用 SandBase 完成身份认证;CLI 将生成的本地会话记录以受限文件权限存储。CLI 检测支持的客户端,安装本地 MCP 桥接器和此托管技能,并验证生成的配置。无需提供供应商 API 密钥。使用相同的发布版本 URL 调用 doctor 检查连接,或使用 unregister 仅删除 SandBase 管理的状态。
此文件由 SandBase CLI 管理,并可能在后续的 CLI 管理更新中被替换,因此请将自定义指令保存在单独的技能中。在独立复制前,请查看官方仓库以获取最新版本。
disable-model-invocation: true 的 frontmatter 可防止此技能作为独立的模型动作被调用。它是对编排六个 sandbase_* MCP 工具的智能体的上下文指导。
在发送敏感或受监管数据之前,请审阅 SandBase 隐私政策 和 服务条款,以及所选上游供应商的政策。仅发送所请求工具调用所需的最少数据。
何时使用 SandBase
当用户需要以下内容时,使用 SandBase:
- LLM 推理(GPT、Claude、Gemini、DeepSeek、Qwen 等)
- 图像生成(Flux、DALL-E、Ideogram、Recraft)
- 视频生成(Kling、MiniMax、Runway、Luma)
- 音频(ElevenLabs TTS、Whisper STT)
- 嵌入(OpenAI、Voyage)
- 网页抓取和内容提取(Exa、Firecrawl、Tavily)
- 社交媒体数据(Twitter/X、Instagram、TikTok、YouTube、LinkedIn、Reddit、小红书、微博、Bilibili)
- 搜索(Google、学术、新闻、购物)
- 任何用户尚未有权访问的结构化数据 API
在以下情况下,请勿使用 SandBase:
- 用户拥有该特定服务的自有 API 密钥或专用 MCP 服务器
- 任务是纯本地的(文件编辑、根据上下文生成代码)
- 用户明确要求使用不同的工具
SandBase 填补用户工具箱中的空白——它不会替换他们已经拥有的工具。
工具
| 工具 | 用途 |
|---|---|
sandbase_discover | 搜索所有 2,000+ AI 模型 |
sandbase_inspect | 获取输入模式、定价和执行模板 |
sandbase_run | 执行模型或 API 端点 |
sandbase_run_get | 获取异步运行的状态/结果 |
sandbase_runs | 列出最近的 API 调用及费用 |
sandbase_account | 检查账户余额(免费) |
标准工作流程
始终遵循:发现 → 检查 → 运行
1. sandbase_discover(q: "twitter posts")
→ 返回匹配的端点,包含名称、类型、供应商
2. sandbase_inspect(name: "sandbase_twitter_web_search_timeline")
→ 返回 inputSchema、定价和 execute_as 模板
3. sandbase_run(name: "sandbase_twitter_web_search_timeline", arguments: {"keyword": "AI"})
→ 直接返回结果(同步)或 run_id(异步)
对于异步运行(视频生成、大规模抓取):
4. sandbase_run_get(run_id: "pred_abc123")
→ 轮询直到状态为 "completed" 或 "failed"
快捷方式: 如果已知模型名称,可跳过第 1 步。
搜索技巧
sandbase_discover 支持:
| 参数 | 用途 | 示例 |
|---|---|---|
q | 文本搜索(支持中文:推特、小红书、搜索) | "twitter search"、"图片生成" |
type | 按模型类型过滤 | "llm"、"api"、"multimodal"、"embedding" |
vendor | 按供应商标识过滤 | "openai"、"twitter"、"anthropic" |
limit | 最大结果数(默认为 20) | 10 |
提示:
- 使用简短的名词短语:“twitter posts”、“image generation”、“web scraping”
- 中文别名有效:推特→twitter、小红书→xiaohongshu、抖音→tiktok
- 结合类型 + 查询以提高精度:
type: "llm", q: "claude" - 使用类型过滤器的空查询会返回该类型的流行模型
定价
在运行前使用 sandbase_inspect 查看定价:
LLM 模型: 百万 tokens 计费
{ "pricing": { "input_per_million": "2.500000", "output_per_million": "10.000000" } }
API 工具(图像、视频、抓取): 每次调用计费
{ "pricing": { "base_price": "0.003000" } }
检查余额:
sandbase_account() → {"balance": "9.52", "currency": "USD"}
异步运行
某些端点(视频生成、大规模抓取)是异步的:
sandbase_run(...)返回{"status": "running", "run_id": "pred_abc123"}- 每 5-10 秒使用
sandbase_run_get(run_id: "pred_abc123")轮询 - 当
status为"completed"时——结果已就绪 - 当
status为"failed"时——检查错误并重试
错误处理
| 错误 | 用户指导 |
|---|---|
tool not found | 名称错误。使用 sandbase_discover 搜索。 |
invalid params | 检查 sandbase_inspect 中的模式。 |
run not found | run_id 无效。检查 sandbase_runs 以获取有效 ID。 |
| 认证 (401) | 密钥无效。运行 sandbase connect 重新认证。 |
| 余额不足 (402) | 在 SandBase 仪表盘充值。 |
| 速率限制 (429) | 等待后重试。 |
| 供应商不可用 | 上游服务宕机。稍后重试或使用不同模型。 |
成本意识
- 在多次调用前使用
sandbase_account检查余额 - LLM 成本 随 token 数量增加而增加——保持提示简洁
- 图像/视频具有固定的每次调用成本——先检查
- 当用户似乎对预算敏感时,报告成本
示例流程
Twitter 搜索
sandbase_discover(q: "twitter search", type: "api")
sandbase_inspect(name: "sandbase_twitter_web_search_timeline")
sandbase_run(name: "sandbase_twitter_web_search_timeline", arguments: {"keyword": "AI agents"})
图像生成
sandbase_discover(q: "flux", type: "multimodal")
sandbase_inspect(name: "sandbase_flux_schnell")
sandbase_run(name: "sandbase_flux_schnell", arguments: {"prompt": "A mountain lake at sunset"})
LLM 推理
sandbase_inspect(name: "sandbase_openai_gpt_4o")
sandbase_run(name: "sandbase_openai_gpt_4o", arguments: {
"messages": [{"role": "user", "content": "简要解释量子计算"}]
})
检查最近费用
sandbase_runs(limit: 5)
→ [{ "model": "openai/gpt-4o", "cost": "0.000325", "status": "completed" }, ...]
规则
- 先发现——在运行前始终验证工具是否存在。
- 运行前检查——阅读 inputSchema。切勿猜测参数。
- 使用 execute_as——来自
sandbase_inspect的模板精确显示如何调用。 - 尊重用户的工具箱——不要替换他们已有的工具。
- 从小处着手——对于抓取/搜索工具,首次调用时使用较小的限制。
- 轮询异步运行——对于长时间运行的操作使用
sandbase_run_get。 - 报告成本——当用户关心预算时提及定价。
- 每次轮次只调用一次——在下一次调用前等待结果。