Let an External Agent In
Authorize an MCP-compatible agent to read and propose on a tenant's behalf.
The Flow
1. Agent owner registers their agent with Brain.
2. Tenant grants the agent specific scopes (read, propose, etc.).
3. Agent connects to the MCP endpoint (POST /v1/agents/mcp) with a JWT.
4. Brain enforces scope on every call.
5. Every read and propose lands in the tenant's audit log.Step 1: Register the Agent
const agent = await brain.agents.register({
address: "0xAgentAddress",
capabilities: ["read", "propose_payment", "propose_action"],
// Planned (RFC 0001), NOT yet anchored on-chain; accepted by the SDK but
// dropped before the on-chain write:
identityRoot: "0x...", // ERC-8004 identity root (planned, RFC 0001)
mcpEndpoint: "https://my-agent.example.com/mcp",
});
console.log(agent.id); // ag_8231
console.log(agent.txHash); // BrainMCPAgentRegistry registration on BaseStep 2: Grant the Agent Scope
Scope
Allows
One permission, three vocabularies
Step 3: the Agent Connects
Step 4: the Agent Works
Step 5: You Watch
Revoking an Agent
What This Enables
Pattern
Example
What This Does Not Enable
Pattern
Why not
What's Next
Last updated
