Guardian Mcp

io.github.Odingard由 GitHub 账号 Odingard 发布v0.3.2更新于 Nov 5, 2026

Routes agent tool calls through Guardian for ALLOW/ASK/DENY before execution.

已验证STDIO仅桌面效率与工作流安全与监控

概览

AI 生成的概览

将智能体的工具调用先交由 Guardian 判定 ALLOW/ASK/DENY 再执行,支持人工审批与可验证回执。

可以做什么
  • 向 Guardian 提交工具调用提案,在执行前获得 ALLOW、ASK 或 DENY 的确定性判定
  • 领取已获人工批准的 ASK 请求的能力并执行,返回执行回执
  • 按请求 id 获取机器可读的证据回执
  • 通过代理方式管控已有的 MCP 服务器
适用场景
适用于助手会执行有后果的操作、需要在执行前设置策略闸门与人工确认,并在事后留下防篡改证据的场景。适合需要对付款、退款、发消息等高风险工具调用设置审批流程的团队。
运行要求
以 npm 包 @odingard/guardian-mcp 通过 stdio 在本机运行。需要 GUARDIAN_BASE_URL 提供 Guardian 控制平面地址、GUARDIAN_AGENT_CREDENTIAL 提供智能体凭据、GUARDIAN_CONNECTION_ID 提供默认连接 id;GUARDIAN_ADAPTER_ID 为可选项。需要能访问 Guardian 服务的网络。
安装前请注意
需要 Guardian 智能体凭据(GUARDIAN_AGENT_CREDENTIAL,gak_ 前缀),该凭据可代表你执行操作。判定为 ALLOW 的调用会立即执行,因此策略配置决定了哪些操作无需复核即可运行。工具参数与回执会发送至 Guardian 控制平面,托管服务在免费额度之外有付费方案。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Guardian Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Guardian — human authority for AI]

Guardian SDK

[npm version] [MCP registry] [Guardian MCP server on mcprush] [License]

Human Authority Infrastructure for Autonomous AI. The agent proposes; the human decides. Every tool call an agent makes gets a deterministic ALLOW / ASK / DENY decision before it runs, and every execution produces a tamper-evident receipt you can verify without an account.

Hosted Guardian: guardian.odingard.com — free tier, no card required. Pricing: Free, Developer $99/month with 25,000 billable executions included, Business via sales.

Packages

PackageUse it whenDocs
@odingard/guardian-sdkYou call Guardian from your own agent code: createGuard for your own action code, plus the core client, receipts and approvalspackages/sdk
odingard-guardian (PyPI)You build in Python (LangChain, CrewAI, OpenAI Agents, Claude Agent SDK, plain code), sync or asyncpackages/python
@odingard/guardian-mcpYour agent speaks MCP (Claude, Cursor, …), with no code needed. guardian-mcp proxy governs any existing MCP serverpackages/mcp
@odingard/guardian-langchainYou build with LangChain.js / LangGraphpackages/langchain
@odingard/guardian-vercel-aiYou build with the Vercel AI SDKpackages/vercel-ai
@odingard/guardian-steelYour browser agent checks out on Steelpackages/steel

Quickstart

bash
npm install @odingard/guardian-sdk
ts
import { classifyRequestResult, createGuardianClient } from "@odingard/guardian-sdk";
const guardian = createGuardianClient({  baseUrl: "https://guardian-api.odingard.com",  credential: process.env.GUARDIAN_AGENT_CREDENTIAL!, // gak_… issued per agent});
const d = classifyRequestResult(  await guardian.request({    action: "tool.invoke",    connectionId: "con_…",    toolName: "refund_order",    arguments: { orderId: "ord_123" },  }),);
if (d.decision === "ALLOW") {  await guardian.execute({ requestId: d.requestId, capabilityToken: d.capabilityToken });}// ASK → held for a human (keep d.requestId, then guardian.claim). DENY → never runs.

Govern your own action code (any framework)

ts
import { createGuard } from "@odingard/guardian-sdk";
const guard = createGuard({ client: guardian, connectionId: "con_…" });const payInvoice = guard("pay_invoice", async (inv) => myPaymentProvider.pay(inv)); // your codeawait payInvoice({ invoiceId: "INV-1002", amountCents: 1_240_000, payeeId: "acme" });// ALLOW → your code runs + receipt. ASK → GuardianApprovalPending (resume() after approval). DENY → never runs.
python
from odingard_guardian import Guard, GuardianClient
guard = Guard(GuardianClient(credential=...), connection_id="con_…")
@guard("pay_invoice")def pay_invoice(invoice_id: str, amount_cents: int, payee_id: str): ...  # your code

Govern an MCP server you already use

bash
guardian-mcp proxy -- npx -y your-whatsapp-mcp-server

Full guides: packages/sdk · packages/python · packages/mcp.

Examples

Runnable demos in examples/ — each prints SIMULATED (local demo policy) or LIVE (real hosted Guardian or real published keys).

bash
npm install && npm run buildcd examplesnode verify-receipt.mjs         # LIVE, no account: verify a real receipt offline, then tampernode demo-classes.mjs           # the 7 demo classesnode steel-checkout.mjs         # Steel checkout → ASK → resumenode shopping-agent.mjs         # purchase → ASK, human approves, receiptnode prompt-injection-deny.mjs  # injected "export contacts" → DENYnode coding-agent-ask.mjs       # consequential command → ASKnode invoice-agent.mjs          # B2B invoices: ALLOW under $5k, ASK above, DENY unknown payee (createGuard)python python/invoice_agent.py  # the same, in Python (pip install odingard-guardian)

Repository layout

text
packages/sdk        @odingard/guardian-sdk      core clientpackages/mcp        @odingard/guardian-mcp      MCP serverpackages/langchain  @odingard/guardian-langchainpackages/vercel-ai  @odingard/guardian-vercel-aipackages/steel      @odingard/guardian-steelpackages/python     odingard-guardian (PyPI)    Python SDKexamples/           runnable demos

packages/sdk/src/contracts, packages/sdk/src/evidence, the SDK client, guard, lifecycle and receipts sources, and the Steel adapter sources are generated from the Guardian monorepo — don't edit them here. See CONTRIBUTING.md.

License

Apache-2.0

来源:README.md,提交 d1c2608

工具

3

guardian_invoke_tool

Propose a tool invocation to Guardian. ALLOW executes immediately and returns the execution receipt; ASK is held for human approval (call guardian_claim with the returned requestId after the human approves); DENY refuses the action with a reason code.

输入参数purposetoolName必填argumentsconnectionId

guardian_claim

Collect the capability for a request that was held as ASK and approved by the human, then execute it and return the receipt.

输入参数requestId必填

guardian_receipt

Fetch the machine-readable evidence receipts for a request id.

输入参数requestId必填

版本历史

3
  1. v0.3.2最新Nov 5, 2026
  2. v0.3.0Nov 5, 2026
  3. v0.1.1Nov 1, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分