mcpField
C
cQnce MCP

cQnce MCP

远程服务
github.com/cqnce-app安全14 周前更新
代码仓库

关于 cQnce MCP

cQnce MCP 服务为 AI Agent 和工作流操作加入人工授权,支持等待审批结果或立即返回请求。它既适用于有人监督的流程,也支持由宿主强制拦截敏感操作并要求审批。

主要功能

  1. 01等待人工审批决定
  2. 02非阻塞提交授权请求
  3. 03查询、列出和取消请求
  4. 04使用管理员凭据管理项目与 Agent
  5. 05通过 stdio 或远程 HTTP 连接

适用场景

  1. 01生产变更前要求审批
  2. 02删除数据前暂停 Agent
  3. 03通过宿主端审批门拦截敏感工具调用

MCP 相关

向 MCP 客户端提供 cQnce 授权及请求管理工具,支持 stdio 服务和远程 Streamable HTTP Worker;请求通过 API 密钥认证。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://mcp.cqnce.app/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

全部服务地址
Streamable HTTPhttps://mcp.cqnce.app/mcp需要授权
安装包
npm@cqnce/mcp-server0.1.3

工具

详细介绍

@cqnce/mcp-server

cQnce 的官方 MCP 服务 — 为任何 AI Agent 或工作流添加人工介入授权。

将 Claude、Cursor、GitHub Copilot 或任何兼容 MCP 的客户端连接到 cQnce,让 AI 在执行有风险或不可逆的操作前请求人工批准。

快速开始

npx @cqnce/mcp-server

运行前,请将项目 API 密钥设置为 CQNCE_API_KEY 环境变量。

审批模式

模式 1 — Agent 请求审批

Agent 按照系统提示词或通过工具发现的指示,自行调用 wait_for_approval 或 submit_authorization_request。这是最简单的集成方式,适用于有人监督的工作流。

风险: 受到入侵或配置错误的 Agent 可能根本不会调用该工具。

模式 2 — 强制审批关卡(生产环境推荐)

宿主应用或执行器会在每次敏感工具调用运行 之前 拦截它,并要求先获得 cQnce 审批,无论 Agent 请求了什么。审批关卡位于模型上下文之外 — Agent 无法绕过它。

这是一个真正的安全边界。企业级和对合规要求敏感的集成应采用此模式。

# Example: host-side interception (framework-agnostic)
HIGH_RISK_TOOLS = {"send_payment", "deploy_production", "delete_customer"}

def execute_tool_call(tool_call):
    if tool_call.name not in HIGH_RISK_TOOLS:
        return run_tool(tool_call)
    decision = cqnce.submit_and_wait(
        payload={"action": tool_call.name, "parameters": tool_call.arguments},
        timeout_seconds=300,
    )
    if decision["status"] != "APPROVED":
        return {"error": "not_authorized", "status": decision["status"]}
    return run_tool(tool_call)

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):

{
  "mcpServers": {
    "cqnce": {
      "command": "npx",
      "args": ["-y", "@cqnce/mcp-server"],
      "env": {
        "CQNCE_API_KEY": "your-project-api-key"
      }
    }
  }
}
Cursor

添加到项目中的 .cursor/mcp.json(或全局配置 ~/.cursor/mcp.json):

{
  "mcpServers": {
    "cqnce": {
      "command": "npx",
      "args": ["-y", "@cqnce/mcp-server"],
      "env": {
        "CQNCE_API_KEY": "your-project-api-key"
      }
    }
  }
}
任意 MCP 客户端(stdio 传输)
CQNCE_API_KEY=your-project-api-key npx @cqnce/mcp-server
云端 Agent(Streamable HTTP / 远程 MCP)

对于无法运行本地进程的云端托管 Agent,请使用部署在 Cloudflare Workers 上的 cQnce MCP Worker。它使用 MCP Streamable HTTP transport,且为无状态服务 — 每个请求都会使用你的 API 密钥进行身份验证。

将云端 Agent 框架配置为连接到:

https://mcp.cqnce.app/mcp
Authorization: Bearer <your-project-api-key>

示例(使用 MCP 的 Claude API):

import anthropic

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-opus-4-5",
    max_tokens=1024,
    mcp_servers=[
        {
            "type": "url",
            "url": "https://mcp.cqnce.app/mcp",
            "name": "cqnce",
            "authorization_token": "your-project-api-key",
        }
    ],
    messages=[{"role": "user", "content": "..."}],
    betas=["mcp-client-2025-04-04"],
)
自行托管

Worker 源代码位于此仓库中。将你自己的实例部署到 Cloudflare Workers:

npm install
npx wrangler deploy

如果使用私有 cQnce 部署,请在 Cloudflare 控制面板中设置 CQNCE_BASE_URL(默认值为 https://api.cqnce.app)。

配置

变量必填描述
CQNCE_API_KEY是来自 cqnce.app 的项目 API 密钥
CQNCE_BASE_URL否API 基础 URL(默认值:https://api.cqnce.app)
CQNCE_ADMIN_TOKEN否租户管理员 JWT — 启用项目/Agent/团队管理工具

工具

核心工具(需要 CQNCE_API_KEY)
工具描述
wait_for_approval提交请求并阻塞等待,直到人工批准或拒绝。这是人工介入工作流的主要工具。
submit_authorization_request提交请求并立即返回 requestId(非阻塞)。
poll_request_status根据 ID 检查请求的当前状态。
cancel_request取消待处理的请求。
list_requests列出此项目的请求(可按状态、日期和标签筛选)。
get_request获取单个请求的完整详情,包括 Agent 响应。
管理工具(需要 CQNCE_ADMIN_TOKEN)

项目管理、路由规则配置、Agent/团队管理和 Webhook 回调。

推荐的系统提示词

通过 Anthropic API 集成 Claude 时,添加此系统提示词以自动强制执行授权策略 — 无需依赖用户每次都提出请求:

You have access to the cQnce tool for human-in-the-loop authorization.

ALWAYS call wait_for_approval BEFORE performing any action that is:
- Destructive or irreversible (deleting data, dropping tables, removing files)
- Affecting production systems (deployments, database migrations, config changes)
- Financial (payments, transfers, subscription changes)
- Involving credentials or access control (creating/revoking API keys, changing permissions)

In the approval payload, include:
- "action": what you are about to do
- "target": what resource is affected
- "reason": why this action is needed
- "risk": what happens if approved or rejected
- "attachments": (optional) list of supporting files as { name, contentType, data (base64) }
  — include logs, diffs, screenshots, or any evidence that helps the reviewer decide

When the response status is "REJECTED":
- Read the rejection reason carefully.
- If the reason identifies missing information or context, gather that information,
  enrich the payload (or attachments), and resubmit via wait_for_approval.
- Only give up if the rejection reason makes clear the action itself is not permitted.

Proceed ONLY if the returned status is "APPROVED".
If "EXPIRED" or the rejection reason leaves no actionable path forward, stop and explain.

示例

配置完成后,你可以这样告诉 Claude:

“删除生产数据库之前,请通过 cQnce 请求人工批准。”

Claude 会使用操作详情调用 wait_for_approval,暂停等待人工通过 cQnce 移动应用批准或拒绝,并且只有在状态为 APPROVED 时才会继续。如果请求被拒绝并附有理由(例如“缺少回滚计划”),Claude 会收集相关信息并自动重新提交。

要求

  • Node.js 18+
  • cQnce 账户和项目 API 密钥 — 免费注册

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。