Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(robinhood): add hood402/hood-mcp docs pages, small hood-api route fixes Co-Authored-By: Claude Sonnet 5 <[email protected]>
fudjiab75a69e57996
diff --git a/robinhood/hood-api/src/lib/errors.ts b/robinhood/hood-api/src/lib/errors.tsindex f19586a23..61523f552 100644--- a/robinhood/hood-api/src/lib/errors.ts+++ b/robinhood/hood-api/src/lib/errors.ts@@ -66,6 +66,22 @@ export class ApiError extends Error {}}+/**+ * Shared `defaultHook` for `OpenAPIHono` instances: turns a failed zod request+ * validation (bad param/query) into the same `{ error, hint, docs }` shape as+ * every other error path, instead of zod-openapi's raw `ZodError` JSON.+ */+export function apiValidationHook(+ result: { success: true } | { success: false; error: { issues: Array<{ message: string; path: PropertyKey[] }> } },+ c: { json: (body: ApiErrorBody, status: 400) => Response },+) {+ if (result.success) return+ const first = result.error.issues[0]+ const field = first?.path.join('.') || 'request'+ const err = ApiError.badRequest(`Invalid ${field}: ${first?.message ?? 'validation failed'}`, 'invalid_request')+ return c.json(err.toBody(), 400)+}+/** Convert any thrown value into an ApiError, mapping known SDK error names. */export function toApiError(err: unknown): ApiError {if (err instanceof ApiError) return errdiff --git a/robinhood/hood-api/src/routes/free.ts b/robinhood/hood-api/src/routes/free.tsindex e07dadcfe..f614ad163 100644--- a/robinhood/hood-api/src/routes/free.ts+++ b/robinhood/hood-api/src/routes/free.ts@@ -1,5 +1,5 @@import { createRoute, OpenAPIHono, z } from '@hono/zod-openapi'-import { ApiError, toApiError } from '../lib/errors.js'+import { ApiError, apiValidationHook, toApiError } from '../lib/errors.js'import { nowIso } from '../lib/response.js'import { SymbolParam, AddressParam, LaunchesQuery, CoinsQuery, ErrorSchema, LOOKBACK_BLOCKS } from '../schemas.js'import { getChain } from '../services/chain.js'@@ -10,7 +10,7 @@ import { mainnetClient } from '../upstreams/rpc.js'import { env } from '../lib/env.js'import pkg from '../../package.json' with { type: 'json' }-export const freeRoutes = new OpenAPIHono()+export const freeRoutes = new OpenAPIHono({ defaultHook: apiValidationHook })const JsonBody = z.record(z.string(), z.unknown())const errorResponse = { content: { 'application/json': { schema: ErrorSchema } }, description: 'Error' } as constdiff --git a/robinhood/hood-mcp/docs/install.html b/robinhood/hood-mcp/docs/install.htmlnew file mode 100644index 000000000..f294a4590--- /dev/null+++ b/robinhood/hood-mcp/docs/install.html@@ -0,0 +1,109 @@+<title>Install — hood-mcp</title>+<meta name="description" content="Install hood-mcp in Claude Code, Claude Desktop, Cursor, or any stdio MCP client." />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏹</text></svg>" />+<link rel="stylesheet" href="site.css" />++<nav class="top">+ <div class="wrap">+ <div class="brand"><span class="tick">hood</span>-mcp</div>+ <div class="links">+ <a href="index.html">Overview</a>+ <a href="install.html" aria-current="page">Install</a>+ <a href="tools.html">Tools</a>+ <a href="safety.html">Safety model</a>+ <a href="https://github.com/nirholas/hood-mcp">GitHub</a>+ </div>+ </div>+</nav>++<main class="wrap prose">+ <section style="border-top:none; padding-top:48px;">+ <h2 style="font-size:30px;">Install matrix</h2>+ <p class="section-lede">+ No API key, wallet, or config needed for the data server. Requires Node ≥ 20.+ </p>+ </section>++ <section>+ <h2>Claude Code</h2>+ <pre>claude mcp add hood-mcp -- npx -y hood-mcp</pre>+ <p style="color:var(--text-dim)">Verify: <code>claude mcp list</code> should show <code>hood-mcp</code> connected.</p>+ </section>++ <section>+ <h2>Claude Desktop</h2>+ <p style="color:var(--text-dim)">Edit your config file:</p>+ <ul style="color:var(--text-dim)">+ <li>macOS: <code>~/Library/Application Support/Claude/claude_desktop_config.json</code></li>+ <li>Windows: <code>%APPDATA%\Claude\claude_desktop_config.json</code></li>+ </ul>+ <pre>{+ "mcpServers": {+ "hood-mcp": {+ "command": "npx",+ "args": ["-y", "hood-mcp"]+ }+ }+}</pre>+ <p style="color:var(--text-dim)">Restart Claude Desktop after saving.</p>+ </section>++ <section>+ <h2>Cursor</h2>+ <p style="color:var(--text-dim)">Add to <code>.cursor/mcp.json</code> in your project (or the global Cursor MCP settings):</p>+ <pre>{+ "mcpServers": {+ "hood-mcp": {+ "command": "npx",+ "args": ["-y", "hood-mcp"]+ }+ }+}</pre>+ </section>++ <section>+ <h2>Any stdio MCP client</h2>+ <pre>npx -y hood-mcp</pre>+ <p style="color:var(--text-dim)">Speaks MCP over stdio. Pair with any client that supports a stdio transport.</p>+ </section>++ <section>+ <h2>Streamable HTTP</h2>+ <p style="color:var(--text-dim)">+ For a hosted deployment or a browser-based client, run the same package over HTTP instead:+ </p>+ <pre>HOOD_MCP_TRANSPORT=http HOOD_MCP_PORT=8730 npx -y hood-mcp</pre>+ <p style="color:var(--text-dim)">+ Serves <code>POST /mcp</code> (JSON-RPC, stateless — a fresh server per request) and+ <code>GET /health</code>. Point any Streamable-HTTP-capable client at+ <code>http://localhost:8730/mcp</code>.+ </p>+ </section>++ <section>+ <h2>Trading server (opt-in)</h2>+ <p style="color:var(--text-dim)">+ Separate binary, stdio only. Read the <a href="safety.html">safety model</a> first.+ </p>+ <pre>{+ "mcpServers": {+ "hood-mcp-trading": {+ "command": "npx",+ "args": ["-y", "hood-mcp-trading"],+ "env": {+ "HOOD_MCP_ENABLE_TRADING": "1",+ "ROBINHOOD_CHAIN_PRIVATE_KEY": "0xYOUR_KEY",+ "HOOD_MCP_MAX_SPEND_USDG": "25",+ "HOOD_MCP_MAX_SESSION_USDG": "100"+ }+ }+ }+}</pre>+ </section>++ <footer>+ MIT © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·+ <a href="https://three.ws">three.ws</a>+ </footer>+</main>diff --git a/robinhood/hood402/docs/index.html b/robinhood/hood402/docs/index.htmlnew file mode 100644index 000000000..6e46c4a3b--- /dev/null+++ b/robinhood/hood402/docs/index.html@@ -0,0 +1,238 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>hood402 — the x402 payment rail for USDG on Robinhood Chain</title>+<meta name="description" content="Spec-conformant x402 exact/EIP-3009 server middleware, client, and a self-hostable facilitator for USDG on Robinhood Chain (chain 4663). Interoperates with any standard x402 client.">+<link rel="stylesheet" href="./site.css">+<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E%F0%9F%92%B8%3C/text%3E%3C/svg%3E">+</head>+<body>++<nav class="top" aria-label="Site">+ <div class="wrap">+ <a class="brand" href="./index.html">hood<span class="tick">402</span></a>+ <div class="links">+ <a href="#quickstart">Quickstart</a>+ <a href="#flow" class="hide-sm">How it works</a>+ <a href="#conformance">Conformance</a>+ <a href="#compare">vs. r0x</a>+ <a href="https://github.com/nirholas/hood402">GitHub</a>+ </div>+ </div>+</nav>++<header class="hero wrap">+ <h1>The x402 payment rail<br>for <span class="grad">USDG on Robinhood Chain</span></h1>+ <p class="lede">+ Spec-conformant <code>exact</code>/EIP-3009 server middleware, a paying client, and a+ self-hostable facilitator — gasless USDG micropayments over plain HTTP 402, chain 4663.+ No vendor lock-in: any standard x402 client can pay a hood402 server, and hood402's+ client can pay any standard x402 server.+ </p>+ <div class="cta">+ <span class="install"><span class="dollar">$</span> npm install hood402 viem</span>+ <a class="btn primary" href="#quickstart">Get started</a>+ <a href="#flow" class="btn">See the flow</a>+ </div>+</header>++<main class="wrap">++<section class="block" id="flow">+ <div class="flow-head">+ <h2>Request → 402 → pay → 200</h2>+ </div>+ <p class="sub">+ The whole protocol in one round trip. The server never asks for a card, an API key, or+ an account — it prices the resource and the client pays for it in-band.+ </p>+ <div class="flow" role="img" aria-label="Animated diagram: client requests a resource, server replies 402 Payment Required with a price, client signs a USDG payment and retries, server settles and returns 200 with the resource.">+ <div class="actor">+ <div class="avatar">🧑💻</div>+ <div class="label">Client</div>+ </div>+ <div class="wire">+ <div class="track"></div>+ <div class="caption c1">1. GET /resource</div>+ <div class="caption c2">2. 402 Payment Required</div>+ <div class="caption c3">3. GET /resource + X-PAYMENT</div>+ <div class="caption c4">4. 200 OK + X-PAYMENT-RESPONSE</div>+ <div class="packet req"></div>+ <div class="packet pay"></div>+ </div>+ <div class="actor">+ <div class="avatar">🖥️</div>+ <div class="label">Resource server</div>+ </div>+ </div>+ <div class="flow-legend">+ <span><span class="dot req"></span> request leg</span>+ <span><span class="dot pay"></span> paid retry (EIP-3009 signature in the X-PAYMENT header)</span>+ </div>+</section>++<section class="block" id="quickstart">+ <h2>Quickstart</h2>+ <p class="sub">Node ≥ 20. <code>viem</code> is a peer dependency.</p>++ <div class="tabs" role="tablist" aria-label="Quickstart by package">+ <button class="tab-btn" role="tab" aria-selected="true" aria-controls="tab-server" id="btn-server">Server</button>+ <button class="tab-btn" role="tab" aria-selected="false" aria-controls="tab-client" id="btn-client">Client</button>+ <button class="tab-btn" role="tab" aria-selected="false" aria-controls="tab-facilitator" id="btn-facilitator">Facilitator</button>+ </div>++ <div class="tab-panel active" id="tab-server" role="tabpanel" aria-labelledby="btn-server">+<pre><code>import express from 'express'+import { paywall } from 'hood402/server'++const app = express()++app.get('/premium', paywall({+ price: '0.01', // USDG+ payTo: '0xYourReceivingAddress',+ network: 'robinhood', // or 'robinhood-testnet'+ facilitator: 'https://your-facilitator.example.com',+}), (req, res) => {+ res.json({ data: 'unlocked after a settled USDG payment' })+})</code></pre>+ <p class="sub">+ No <code>facilitator</code>? Pass <code>wallet</code> (a viem <code>WalletClient</code>+ with a gas key), <code>account</code>, and <code>reader</code> (a viem+ <code>PublicClient</code>) instead — the server settles locally.+ </p>+ </div>++ <div class="tab-panel" id="tab-client" role="tabpanel" aria-labelledby="btn-client">+<pre><code>import { Hood402Client, fromAccount } from 'hood402/client'+import { privateKeyToAccount } from 'viem/accounts'++const account = privateKeyToAccount(process.env.ROBINHOOD_CHAIN_PRIVATE_KEY)+const client = new Hood402Client({+ signer: fromAccount(account),+ maxSpendPerOrigin: '1.00', // hard cap, USDG+})++const res = await client.fetch('https://api.example.com/premium')+console.log(await res.json()) // the 402 was paid automatically</code></pre>+ </div>++ <div class="tab-panel" id="tab-facilitator" role="tabpanel" aria-labelledby="btn-facilitator">+<pre><code>git clone https://github.com/nirholas/hood402.git && cd hood402+npm install && npm run build+cd facilitator && npm install && npm run build++FACILITATOR_PRIVATE_KEY=0x... \+FACILITATOR_NETWORKS=robinhood,robinhood-testnet \+npm start+# -> GET /healthz /supported /metrics+# -> POST /verify /settle</code></pre>+ <p class="sub">Or build the Docker image — see the <a href="https://github.com/nirholas/hood402/tree/main/facilitator">facilitator README</a>.</p>+ </div>+</section>++<section class="block" id="conformance">+ <h2>Spec conformance</h2>+ <p class="sub">+ hood402 implements x402 v1's <code>exact</code> scheme for EVM verbatim — the+ <code>X-PAYMENT</code>/<code>X-PAYMENT-RESPONSE</code> header pair, the+ <code>PaymentRequirements</code> shape, and the facilitator <code>/verify</code>,+ <code>/settle</code>, <code>/supported</code> endpoints — so it interoperates with the+ wider x402 client ecosystem out of the box, not just its own client.+ </p>+ <div class="grid">+ <div class="card">+ <h3>Settlement mechanism</h3>+ <p>+ USDG is a facet/diamond stablecoin. Its base implementation doesn't expose+ EIP-3009, but <code>getFacet(bytes4)</code> proves <code>transferWithAuthorization</code>,+ <code>receiveWithAuthorization</code>, and <code>authorizationState</code> are all+ registered — verified live on both networks. hood402 settles with the standard+ gasless EIP-3009 path; the facilitator pays gas, the payer signs and needs no ETH.+ </p>+ </div>+ <div class="card">+ <h3>Domain separator</h3>+ <p>+ Reconstructed to match the on-chain <code>DOMAIN_SEPARATOR()</code> exactly:+ <code>name="Global Dollar"</code>, <code>version="1"</code>, the chain's own+ <code>chainId</code>, and the USDG proxy as <code>verifyingContract</code>.+ </p>+ </div>+ <div class="card">+ <h3>Replay protection</h3>+ <p>+ Every authorization carries a random 32-byte nonce. The facilitator checks+ <code>authorizationState(payer, nonce)</code> before broadcasting and claims an+ idempotency slot in its ledger first — a retried <code>/settle</code> for the same+ signed payment returns the original transaction instead of double-spending gas.+ </p>+ </div>+ <div class="card">+ <h3>Networks</h3>+ <p>+ Mainnet <code>robinhood</code> (chain 4663) and testnet <code>robinhood-testnet</code>+ (chain 46630) — both with live, verified USDG deployments.+ </p>+ </div>+ </div>+</section>++<section class="block" id="compare">+ <h2>hood402 vs. r0x</h2>+ <p class="sub">+ <a href="https://github.com/nhevers/project-r0x">r0x</a> is a hosted facilitator plus an+ agent-OS SDK and MCP plugin — you call r0x's service and its skill catalog. hood402 is+ the other end of that spectrum: protocol primitives you self-host, with no dependency on+ any one operator.+ </p>+ <div class="table-scroll">+ <table>+ <thead>+ <tr><th></th><th>hood402</th><th>r0x</th></tr>+ </thead>+ <tbody>+ <tr><td>What it is</td><td>Middleware + client + facilitator you run yourself</td><td>Hosted facilitator + agent SDK + MCP plugin</td></tr>+ <tr><td>x402 wire format</td><td>v1 — <code>X-PAYMENT</code> / <code>X-PAYMENT-RESPONSE</code>, matches the deployed client ecosystem (<code>x402-fetch</code>, <code>x402-axios</code>, etc.)</td><td>v2-style CAIP-2 network naming (<code>eip155:4663</code>) and a <code>PAYMENT-RESPONSE</code> header</td></tr>+ <tr><td>Settlement</td><td class="yes">EIP-3009 <code>transferWithAuthorization</code></td><td class="yes">EIP-3009 <code>TransferWithAuthorization</code></td></tr>+ <tr><td>Run your own facilitator</td><td class="yes">Yes — Dockerfile + Cloud Run docs included</td><td class="no">No — r0x operates the facilitator</td></tr>+ <tr><td>Skill catalog / agent OS</td><td class="no">Out of scope — protocol only</td><td class="yes">18 MCP tools (trade, bridge, liquidity, …)</td></tr>+ <tr><td>License</td><td>MIT</td><td>MIT</td></tr>+ </tbody>+ </table>+ </div>+ <p class="sub" style="margin-top:14px">+ They're complementary, not competing: an r0x agent can pay a hood402-protected endpoint,+ and a hood402 client can pay an r0x-facilitated one — both speak <code>exact</code>/EIP-3009+ USDG under the hood.+ </p>+</section>++<div class="disclosure">+ Stock Tokens on Robinhood Chain are tokenized debt securities and may not be offered to US+ persons (plus Canada, UK, Switzerland). hood402 moves USDG, Robinhood Chain's dollar+ stablecoin — not a security — so this restriction doesn't apply to payments made with it.+</div>++</main>++<footer class="wrap">+ <span>MIT licensed. Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></span>+ <span><a href="https://github.com/nirholas/hood402">GitHub</a> · <a href="https://github.com/nirholas/hood402/blob/main/facilitator/README.md">Facilitator docs</a></span>+</footer>++<script>+ const tabs = document.querySelectorAll('.tab-btn');+ tabs.forEach((btn) => {+ btn.addEventListener('click', () => {+ tabs.forEach((b) => b.setAttribute('aria-selected', 'false'));+ document.querySelectorAll('.tab-panel').forEach((p) => p.classList.remove('active'));+ btn.setAttribute('aria-selected', 'true');+ document.getElementById(btn.getAttribute('aria-controls')).classList.add('active');+ });+ });+</script>++</body>+</html>