# MCP 服务器与命令行工具

通过托管的 MCP 服务器在 AI 智能体中使用聊天、图像和视频模型，或在终端中使用 apistore 命令行工具。

## MCP

通过我们托管的 MCP 服务器（Streamable HTTP），在 AI 智能体中使用这些模型。将下方 URL 添加到 Claude Code、Cursor、Windsurf、VS Code 或任意 MCP 客户端，并在 Authorization 请求头中填入你的 API 密钥。调用从你的余额中扣费，价格与 API 相同。

```
URL: https://api.apistore.cloud/mcp
Authorization: Bearer sk-...
```

```
# Claude Code
claude mcp add --transport http apistore https://api.apistore.cloud/mcp \
  --header "Authorization: Bearer sk-..."

# Cursor (~/.cursor/mcp.json), Windsurf, VS Code and other MCP clients
{
  "mcpServers": {
    "apistore": {
      "url": "https://api.apistore.cloud/mcp",
      "headers": { "Authorization": "Bearer sk-..." }
    }
  }
}
```

工具：list_models（模型及你的价格）、chat（向模型发送提示词或 messages 并获取回答）、create_image（生成图像并获取链接）、create_video（发起视频任务并获取其 id）、get_video（查询状态，完成后获取文件链接）以及 get_balance（你的密钥还可消费的金额）。

配置指南: [Cursor](https://apistore.cloud/zh/docs/cursor) · [Cline](https://apistore.cloud/zh/docs/cline) · [Claude Code](https://apistore.cloud/zh/docs/claude-code) · [LiteLLM](https://apistore.cloud/zh/docs/litellm)

## CLI

apistore 命令可在终端或 shell 脚本中运行聊天、图像和视频模型：输入文本，输出回答，文件保存到你指定的位置。需要 Node 20 或更高版本。

```
npm install -g @apistorecloud/apistore
apistore login --key sk-...

apistore chat -m claude-haiku-5-5 "Hello!"
apistore chat "Summarize this" < notes.md
apistore image "a red bicycle on a white wall" -o bike.png
apistore video "waves at sunset, slow pan" --resolution 720p --seconds 5
```

每个命令都支持 --json 以获取原始 API 响应；在脚本和 CI 中，密钥也可以从 APISTORE_API_KEY 读取。运行 apistore --help 查看全部选项。

---

Source: https://apistore.cloud/zh/docs/mcp
