HTTP Middleware & Agent Tool Schema
Add MpcFirewall in front of any Python, LangGraph, CrewAI, Eliza, or TypeScript agent using plain HTTP requests and standard LLM tool schemas.
Pre-Flight Inspection Request
Send any proposed transaction to POST /api/inspect before signing. The response tells your agent whether to proceed, escalate to the team DAO, or abort with exact human-readable reasons.
typescriptInspect & Gate Transaction
// Call /api/inspect before letting your agent sign or broadcast any transaction
const res = await fetch('https://mpc-firewall.netlify.app/api/inspect', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
chainKind: 'evm',
rawUnsignedHex: unsignedEip1559Hex,
agentIntent: 'Pay vendor #402 25 USDC on Base for monthly API invoice'
})
});
const { data } = await res.json();
const { decision, teeAudit, mpcDispatch, daoProposalPayload } = data.record;
if (decision.outcome === 'BLOCKED') {
throw new Error(`Transaction rejected: ${decision.reasons.join('; ')}`);
}Ready-to-Use LLM Tool Schema
jsonOpenAI / Anthropic / NEAR AI Function Schema
{
"type": "function",
"function": {
"name": "mpc_firewall_inspect_tx",
"description": "Inspect raw unsigned EVM or Bitcoin transaction bytes before MPC signing to verify spend caps, calldata safety, and alignment with user intent.",
"parameters": {
"type": "object",
"properties": {
"chainKind": { "type": "string", "enum": ["evm", "bitcoin"] },
"rawUnsignedHex": { "type": "string", "description": "0x-prefixed EVM RLP tx or raw BTC tx hex" },
"agentIntent": { "type": "string", "description": "Plain-English summary of what the agent intends to do" },
"bip143Input": {
"type": "object",
"properties": {
"inputIndex": { "type": "integer" },
"prevoutValueSats": { "type": "string" },
"scriptCodeHex": { "type": "string" }
},
"required": ["inputIndex", "prevoutValueSats", "scriptCodeHex"]
}
},
"required": ["chainKind", "rawUnsignedHex", "agentIntent"]
}
}
}Available API Endpoints
| Route | Method | Purpose |
|---|---|---|
| /api/inspect | POST | Decode raw EVM/BTC hex, evaluate policy + TEE audit, return dispatch or DAO proposal |
| /api/near/execute | POST | Broadcast verify_and_sign_evm, verify_and_sign_btc_bip143, or dao_add_proposal on Testnet (12 TX/min cap) |
| /api/policy | GET / PATCH / POST | Read/patch spend rules or reset sandbox state (auth-gated when REQUIRE_ADMIN_AUTH=true) |
| /api/intents/quote & /tokens | POST / GET | Query live 1Click cross-chain swap tokens and dry quotes with explicit depositType |
| /api/near/account & /health | GET | Check live v1.signer-prod.testnet key status and server config |
| /api/presets | GET | Fetch all 7 real-byte safe, escalation, and attack scenarios |