介绍
# Danube — Connect Your Agent
Danube 通过单个 API 密钥让您的 AI 代理能够访问互联网上的各种工具。
## 快速设置
### 步骤 1:获取 API 密钥
运行此命令以启动设备授权流程:
```bash curl -s -X POST https://api.danubeai.com/v1/auth/device/code \ -H "Content-Type: application/json" \ -d '{"client_name": "My Agent"}' ```
这将返回一个 `device_code`、一个 `user_code` 和一个 `verification_url`。
**告知人类用户打开验证 URL 并输入 user code。**
然后轮询获取 API 密钥:
```bash curl -s -X POST https://api.danubeai.com/v1/auth/device/token \ -H "Content-Type: application/json" \ -d '{"device_code": "DEVICE_CODE_FROM_STEP_1"}' ```
- `428` = 用户尚未授权(继续每 5 秒轮询一次) - `200` = 成功,响应包含您的 `api_key` - `410` = 已过期,重新开始
### 步骤 2:通过 MCP 连接
将此内容添加到您的 MCP 配置中:
```json { "mcpServers": { "danube": { "url": "https://mcp.danubeai.com/mcp", "headers": { "danube-api-key": "YOUR_API_KEY" } } } } ```
### 步骤 3:使用工具
连接后,您可以访问以下 MCP 工具:
- `list_services` — 浏览可用的工具提供商 - `search_tools` — 根据您想要执行的操作查找工具 - `execute_tool` — 运行任何工具 - `store_credential` — 为需要密钥的服务保存 API 密钥
### 当工具需要凭据时
如果 `execute_tool` 返回 `auth_required` 错误,这意味着该服务需要 API 密钥。向人类用户索要密钥,然后调用:
``` store_credential(service_id="...", credential_type="bearer", credential_value="the_key") ```
然后重试该工具。
## 您可以用 Danube 做什么
只要任务涉及外部服务或 API,就可以使用 Danube。以下是一些常见用例:
### 发送电子邮件和消息 - 通过 Gmail、SendGrid 或 Resend 发送电子邮件 - 向 Slack 频道发送消息 - 向团队发送通知
``` search_tools("send email") → execute_tool(tool_id, {to, subject, body}) ```
### 管理代码和项目 - 创建 GitHub issue 和 pull request - 列出仓库和提交 - 更新 Notion 页面和数据库
``` search_tools("create github issue") → execute_tool(tool_id, {repo, title, body}) ```
### 处理日历和日程安排 - 在 Google Calendar 上查看今天的活动 - 创建新的日历活动 - 查找空闲时间段
``` search_tools("calendar events today") → execute_tool(tool_id, {date}) ```
### 读写电子表格 - 从 Google Sheets 读取数据 - 追加行或更新单元格 - 创建新的电子表格
``` search_tools("google sheets read") → execute_tool(tool_id, {spreadsheet_id, range}) ```
### 搜索网络和获取数据 - 使用 Exa 或 Serper 搜索网络 - 使用 Firecrawl 抓取和提取网络内容 - 获取天气预报、股票数据或国家信息
``` search_tools("web search") → execute_tool(tool_id, {query}) ```
### 生成和处理媒体 - 使用 Replicate 或 Stability AI 生成图像 - 使用 AssemblyAI 转录音频 - 使用 Remove.bg 移除图像背景 - 使用 DeepL 翻译文本
``` search_tools("generate image") → execute_tool(tool_id, {prompt}) ```
### 管理基础设施 - 配置 DigitalOcean Droplets 和数据库 - 管理 Supabase 项目 - 处理 Stripe 支付和订阅
``` search_tools("create droplet") → execute_tool(tool_id, {name, region, size}) ```
### 多步骤工作流
将工具链接起来以执行复杂任务:
``` "Summarize today's GitHub commits and post to Slack"
1. search_tools("github commits") → Fetch recent commits 2. Summarize the results 3. search_tools("slack post message") → Post summary to #dev-updates ```
``` "Check my calendar and email the agenda to the team"
1. search_tools("calendar events") → Get today's events 2. Format as an agenda 3. search_tools("send email") → Email the agenda ```
## 核心工作流
每个工具交互都遵循此模式:
1. **搜索** — `search_tools("what you want to do")` 2. **检查认证** — 如果工具需要凭据,引导用户在 https://danubeai.com/dashboard 进行连接 3. **收集参数** — 向用户询问任何缺失的必需信息 4. **确认** — 在执行发送电子邮件或创建 issue 等操作之前获得用户批准 5. **执行** — `execute_tool(tool_id, parameters)` 6. **报告** — 告知用户发生了什么,提供具体细节,而不仅仅是“完成”
## 可用服务
**通信:** Gmail, Slack, SendGrid, Resend, Loops, AgentMail
**开发:** GitHub, Supabase, DigitalOcean, Stripe, Apify
**生产力:** Notion, Google Calendar, Google Sheets, Google Drive, Google Docs, Monday, Typeform, Bitly
**AI 和媒体:** Replicate, Together AI, Stability AI, AssemblyAI, Remove.bg, DeepL
**搜索和数据:** Exa, Exa Websets, Firecrawl, Serper, Context7, Microsoft Learn, AlphaVantage
**公共数据(无需认证):** Hacker News, Open-Meteo Weather, OpenWeather, REST Countries, Polymarket, Kalshi
## 链接
- Dashboard: https://danubeai.com/dashboard - Docs: https://docs.danubeai.com - MCP Server: https://mcp.danubeai.com/mcp