支持的请求头格式
推荐通过标准 Bearer 头传递 API Key,也可使用 X-API-Key 头;POST /api/mcp 在缺失或无效凭据时一律返回 HTTP 401。
Authorization: Bearer key_<id>.<secret> # 或使用 / Or use: X-API-Key: key_<id>.<secret>
Agent 友好 · 原生 Inbound MCP Server + 完整 OpenAPI 3.0
InboxAide提供原生 Streamable HTTP MCP Server(POST /api/mcp,内置 41 个结构化工具与通用 api_request)、项目级 RBAC API Key、全量 REST API、SSE 实时事件流与交互式 OpenAPI 3.0 文档。
01快速鉴权
在控制台「设置 → API Keys」或调用 POST /api/credentials 创建密钥。每把 Key 均可限定角色(admin / manager / agent)与项目范围,MCP 与 REST 严格复用同一套租户权限边界。
推荐通过标准 Bearer 头传递 API Key,也可使用 X-API-Key 头;POST /api/mcp 在缺失或无效凭据时一律返回 HTTP 401。
Authorization: Bearer key_<id>.<secret> # 或使用 / Or use: X-API-Key: key_<id>.<secret>
调用 GET /api/mcp 可公开获取 MCP 协议版本(2025-03-26)、支持的方法、工具数量与文档链接,便于客户端自动探测。
curl -s https://inboxaide.lumorb.com/api/mcp | jq .
02原生 Inbound MCP Server
遵循 Streamable HTTP JSON-RPC 2.0(protocolVersion 2025-03-26),支持 initialize、ping、tools/list、tools/call 以及 resources/list 与 resources/read(inboxaide://openapi、inboxaide://guide)。
{
"mcpServers": {
"message-center": {
"url": "https://inboxaide.lumorb.com/api/mcp",
"headers": {
"Authorization": "Bearer key_<id>.<secret>"
}
}
}
}
{
"mcpServers": {
"message-center": {
"transport": "streamable-http",
"url": "https://inboxaide.lumorb.com/api/mcp",
"headers": {
"X-API-Key": "key_<id>.<secret>"
}
}
}
}
# 1. Initialize MCP session
curl -s -X POST https://inboxaide.lumorb.com/api/mcp \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'
# 2. List all 41 tools
curl -s -X POST https://inboxaide.lumorb.com/api/mcp \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
0341 个结构化工具 + 通用调用
除 40 个高频领域工具外,内置通用 api_request 工具,允许授权 Agent 在当前 RBAC 权限内进程内安全调用任意 /api/* 路由(严格路径白名单,无 SSRF、无越权)。
创建、查询、更新与归档多项目空间。
管理 11 类渠道并一键拉起临时在线客服或表单链接与二维码。
拉取会话、外发回复、写内部备注、暂停 AI 或触发草稿生成/改写。
管理渠道绑定的 AI 角色预设与 SKILL.md 技能模块。
语义/关键词检索知识库,增删改标准业务口径条目。
配置项目级外部 MCP 数据源、管理 API Key、查询配额及调用任意 REST 路由。
04REST API · OpenAPI · SSE
全部后台功能均有对应 REST 路由,可在 Swagger UI 在线调试,或订阅 SSE 事件流实时响应入站消息、草稿就绪与人工审批事件。
| 入口 | 路径 | 用途 |
|---|---|---|
| 交互式 OpenAPI 浏览器 | GET /api/docs/ui |
Swagger UI 在线浏览与试跑全部租户接口 |
| OpenAPI 3.0 规范 | GET /api/docs |
标准 JSON Schema,可用于 SDK 自动生成或导入 Agent 工具集 |
| 实时事件流(SSE) | GET /api/events?realtime=1 |
实时推送新入站消息、AI 回复、草稿状态与会话变更 |
| MCP 协议资源 | inboxaide://openapi · inboxaide://guide |
通过 MCP resources/read 直接读取最新接口规范与上手指南 |
05代码示例
复制即可运行:创建项目、一键拉起社媒临时在线客服/表单、触发 AI 草稿与发送回复,或通过 TypeScript 调用 MCP Server。
curl -s -X POST https://inboxaide.lumorb.com/api/projects \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{
"name": "Global Store Support",
"description": "Cross-border e-commerce pre-sales & after-sales"
}'
curl -s -X POST https://inboxaide.lumorb.com/api/projects/<project_id>/quick-channels \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{
"mode": "temp_chat",
"name": "Product Launch Social Chat",
"expiresInHours": 168
}'
# 返回可直接投放社交平台的 shareUrl 与 QR Code / Returns shareUrl & QR code
# 1. Generate AI draft (does not send or persist)
curl -s -X POST https://inboxaide.lumorb.com/api/sessions/<session_id>/suggest \
-H "Authorization: Bearer key_<id>.<secret>"
# 2. Send approved reply to customer
curl -s -X POST https://inboxaide.lumorb.com/api/sessions/<session_id>/reply \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{"text": "Your order #1042 refund was processed yesterday and arrives in 3–5 business days."}'
# 1. Create a reusable tenant skill
curl -s -X POST https://inboxaide.lumorb.com/api/agent-skills \
-H "Authorization: Bearer key_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{
"name": "Refund Policy Checker",
"description": "Verify order refund eligibility before quoting timelines",
"whenToUse": "Customer asks about refund status or return window",
"body": "Always check order status via MCP before confirming refund dates."
}'
async function callMcpTool(name: string, args: Record<string, unknown>) {
const res = await fetch('https://inboxaide.lumorb.com/api/mcp', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: Date.now(),
method: 'tools/call',
params: { name, arguments: args },
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
// Example: create a social temporary live chat via MCP
const result = await callMcpTool('quick_channel_create', {
projectId: 'proj_123',
mode: 'temp_chat',
name: 'X Launch Support',
expiresInHours: 72,
});
console.log(result);