Guardian MCP
Security layer for AI agents that evaluates transaction intents and returns verdicts (ALLOW/WARN/DENY) using deterministic rules, on-chain checks, and simulation.
README
Guardian — Transaction Firewall for AI Agents
An OKX.AI A2MCP service. Every agent that can sign can also be tricked. Guardian is the check that runs first.
The agent economy has a hole in the middle of it. We are handing autonomous agents the ability to move money, and the only thing standing between a prompt-injected agent and an empty wallet is the agent's own judgment. That is not a security model.
Guardian is the layer that says no. An agent submits the transaction it intends to sign; Guardian returns ALLOW, WARN or DENY, with every reason. It never sees a private key, and it never signs anything.
Agent → "I want to sign this" → Guardian → ALLOW / WARN / DENY → Wallet
│
decode · policy · on-chain scan · simulate
What it actually catches
Not a risk score handed down from a black box — deterministic rules, each with a stated reason.
| Rule | What it stops |
|---|---|
unlimited_approval |
approve(spender, MAX_UINT256) — the single most exploited pattern in crypto. One compromised contract, and the whole balance is gone years later. |
set_approval_for_all |
A blanket grant over an entire NFT collection. |
approval_to_eoa |
Spending power granted to a personal wallet instead of a contract. Real protocols are contracts. This is a drainer signature. |
fresh_recipient |
Recipient with zero balance, zero nonce and no code — a freshly generated address, i.e. the wallet an attacker made ten minutes ago. |
zero_address |
Funds sent into the void and destroyed. |
max_spend_exceeded |
The agent exceeding its budget. |
unknown_selector |
Calldata the agent cannot prove the meaning of. |
simulation_revert |
A transaction that reverts on-chain. |
Tools
| Tool | Purpose |
|---|---|
guardian_assess_transaction |
The main event. Full verdict: decode + policy + on-chain scan + simulation. |
guardian_decode_calldata |
Raw hex → plain language. "Grant 0xabc… UNLIMITED permission to spend your USDC." |
guardian_scan_address |
Contract or wallet? Funded? Ever used? How much bytecode? |
guardian_simulate_transaction |
Dry-run: does it revert, what does it cost? |
guardian_supported_chains |
Chain list. |
Chains
X Layer (196, default) · X Layer Testnet (1952) · Ethereum · Base · BNB Chain · Arbitrum · Polygon
Each chain carries several RPC endpoints and fails over between them. A protocol error ("execution reverted") is a real answer from a healthy node, so it propagates immediately; only transport failures (timeout, 5xx, dead origin) move to the next endpoint. npm run test:live health-checks every configured URL, so a rotting provider surfaces in CI rather than in front of a user.
The design decision that matters
A security tool that guesses when it cannot see is worse than no security tool, because it is trusted.
An early version of Guardian used soft RPC fallbacks: if a call failed, it substituted an empty value and carried on. The result was a system that, whenever the network hiccuped, confidently reported that Vitalik's wallet was a freshly generated drainer address and that the Uniswap router was a personal wallet — because "no code" and "could not read the code" had collapsed into the same value.
Guardian now separates the chain says no from the chain did not answer:
- DENY is deterministic. Policy checks and hard security rules are computed offline, so a flaky RPC can never soften a DENY.
- On-chain enrichment may only add risk. A failed lookup never manufactures a finding.
- No blind ALLOW. If the chain is unreachable, the response carries
degraded: trueand the verdict is capped at WARN. Guardian will tell you it does not know.
This is enforced by tests, not by convention. See suite 4, "an unreachable chain must never be faked."
Run it
npm test # 37 assertions: protocol, decoder, policy, degraded mode
npm run test:live # real attack scenarios against live chain state
npm run dev # http://localhost:8787/mcp
No dependencies. No build step. Node 18+.
Deploy
vercel --prod
Your MCP endpoint is https://<your-domain>/api/mcp. That HTTPS URL is what you register with OKX.AI.
Call it
curl -X POST https://<your-domain>/api/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
A worked example — an agent about to grant an unlimited USDC allowance:
{
"verdict": "DENY",
"riskScore": 80,
"degraded": false,
"summary": "Grant 0x1111…1111 UNLIMITED permission to spend your USDC",
"findings": [
{ "severity": "critical", "rule": "unlimited_approval",
"message": "Unlimited spend approval… the entire USDC balance can be drained — today or years from now." },
{ "severity": "high", "rule": "approval_to_eoa",
"message": "Spending power is being granted to an EOA, not a contract. Legitimate protocols are contracts." }
],
"recommendation": "DO NOT SIGN. Fix: request an exact-amount approval instead of an unlimited one. Fix: never grant token allowances to a personal wallet address."
}
Pricing
Free. Guardian is infrastructure: the more agents that check before they sign, the safer the marketplace everyone is building on.
MIT.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。