关于 mcp-gateway
mcp-gateway 是 Civic 的 MCP 网关,为 Agent 访问工具提供身份认证、权限控制和审计。权限层独立于 Agent,并支持撤销访问及配置防护规则。
主要功能
- 01通过 Civic 令牌认证 Agent
- 02按工具范围授予权限
- 03记录工具调用及时间
- 04撤销令牌后立即停用访问
- 05配置速率限制、审批和拒绝名单
适用场景
- 01限制 Gmail 发信并记录审计
- 02约束 Google Calendar 操作
- 03限制 PostgreSQL 查询并遮蔽敏感列
MCP 相关
它在远程端点通过 Streamable HTTP 提供 MCP 服务,使用 Bearer 令牌认证,并按配置管理工具访问。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://app.civic.com/hub/mcpclaude mcp add --transport http titus-civic-mcp-gateway https://app.civic.com/hub/mcp{"mcpServers":{"titus-civic-mcp-gateway":{"type":"http","url":"https://app.civic.com/hub/mcp"}}}在 Cursor 中打开{"servers":{"titus-civic-mcp-gateway":{"type":"http","url":"https://app.civic.com/hub/mcp"}}}在 VS Code 中打开{"mcpServers":{"titus-civic-mcp-gateway":{"type":"http","url":"https://app.civic.com/hub/mcp"}}}{"mcpServers":{"titus-civic-mcp-gateway":{"serverUrl":"https://app.civic.com/hub/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
Civic MCP Gateway
通过 Civic MCP Gateway 将 AI Agent 连接到工具和数据后,开发者在调用 MCP 工具时即可使用防护措施、范围受限的权限、审计记录和可撤销的访问权限。Civic 将权限层与 AI Agent 分离,使其无法绕过限制。
此仓库包含集成元数据、配置文件和客户端示例。网关本身运行于 app.civic.com。
功能
如果没有身份层,任何 AI Agent 都可以调用任何 MCP 工具,而且不会记录授权者、访问内容或如何撤销其访问权限。Civic 解决了这些问题:
- Agent 身份 — Agent 使用 Civic 签发的持有者令牌进行身份验证
- 范围受限的权限 — 仅授予 Agent 使用特定工具的权限
- 审计记录 — 每次工具调用都会记录 Agent 身份和时间戳
- 可撤销的访问权限 — 撤销令牌后,Agent 会立即失去访问权限
- 防护措施 — 通过配置器设置速率限制、审批工作流和拒绝列表
MCP 端点
https://app.civic.com/hub/mcp
传输方式: Streamable HTTP 身份验证: 持有者令牌(在 app.civic.com 生成)
快速入门
1. 获取令牌
在 app.civic.com 登录,并通过引导流程生成持有者令牌。
2. 配置 MCP 客户端
Claude Desktop — 原生 Streamable HTTP:
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"civic": {
"url": "https://app.civic.com/hub/mcp"
}
}
}
Claude Code — 原生 HTTP 传输方式(无需桥接):
claude mcp add --transport http civic https://app.civic.com/hub/mcp
或通过 Hub Bridge 使用 stdio:
claude mcp add civic "npx @civic/hub-bridge"
Cursor — 原生 Streamable HTTP:
添加到 Cursor MCP 配置:
{
"mcpServers": {
"civic": {
"url": "https://app.civic.com/hub/mcp"
}
}
}
Cline(VS Code)— 添加到 cline_mcp_settings.json:
{
"mcpServers": {
"civic": {
"url": "https://app.civic.com/hub/mcp",
"headers": {
"Authorization": "Bearer YOUR_CIVIC_TOKEN"
}
}
}
}
Windsurf — 原生 Streamable HTTP,无需桥接:
添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"civic": {
"serverUrl": "https://app.civic.com/hub/mcp"
}
}
}
Windsurf 会在首次连接时自动处理 OAuth。
3. 可选:锁定到某个配置
追加 ?profile=your-toolkit,将网关限定为特定配置:
https://app.civic.com/hub/mcp?profile=your-toolkit
自动化 Agent(基于令牌的身份验证)
对于无法完成 OAuth 流程的非交互式 Agent,请在 app.civic.com 生成持有者令牌并直接传入:
curl -X POST https://app.civic.com/hub/mcp \
-H "Authorization: Bearer $CIVIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
从注册表安装
| 注册表 | 链接 |
|---|---|
| Smithery | smithery.ai/servers/@civic/civic-mcp-gateway |
| ClawHub | clawhub.ai/civictechuser/openclaw-civic-skill |
示例用例
| 用例 | Civic 提供的功能 |
|---|---|
| Gmail 防护措施与审计 | 阻止发送包含机密信息的邮件,删除邮件内容中的个人身份信息,记录每次发送 |
| Google Calendar 防护措施与审计 | 防止删除日程,限制为工作时间,阻止外部参会者 |
| PostgreSQL 防护措施与审计 | 阻止破坏性查询,强制执行只读访问,删除敏感列内容 |
文档
完整文档请访问 docs.civic.com
可运行示例
请参阅 civicteam/nexus-demo,查看使用 Next.js、联合身份验证和 MCP 工具可视化的完整客户端集成示例。
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。