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
fix(mcp): close connector-key spend gap on card and wallet-provisioning tools
nirholas0012dcb3c3ed
diff --git a/api/_mcp/policy.js b/api/_mcp/policy.jsindex 886cd5180..4aa44732e 100644--- a/api/_mcp/policy.js+++ b/api/_mcp/policy.js@@ -140,8 +140,19 @@ export async function enablementFor(req, auth) {// funds. Every other financial tool spends, pays, launches or withdraws.const NON_SPENDING_CONFIRMS = new Set(['confirm_delete', 'confirm_run']);+// A handful of tools are money-adjacent without being POLICY's "financial"+// tier: they read or mint a virtual card's live data (quote, raw data, a+// connect link that can provision one), or stand up a wallet/paid endpoint.+// None carries a confirmFlag for the tier check above to catch, so they are+// named here instead. A key issued for an unattended agent may never call them.+const EXTRA_VALUE_TOOLS = Object.freeze({+ 'three.ws': new Set(['agent_card_quote', 'agent_card_data', 'agent_card_connect_link']),+ 'threews-agent': new Set(['provision_wallet', 'monetize_endpoint']),+});+/** True when a tool moves value, so a key issued for an unattended agent may never call it. */export function movesValue(serverId, name) {+ if (EXTRA_VALUE_TOOLS[serverId]?.has(name)) return true;const row = POLICY[serverId]?.[name];if (!row) return false;const entry = normalizeEntry(name, row);diff --git a/tests/mcp-grok-accounts.test.js b/tests/mcp-grok-accounts.test.jsindex 489f8faa2..83d231a20 100644--- a/tests/mcp-grok-accounts.test.js+++ b/tests/mcp-grok-accounts.test.js@@ -76,7 +76,7 @@ const { default: studioHandler } = await import('../api/mcp-studio.js');const { default: wkHandler } = await import('../api/wk.js');const { mintAccessToken } = await import('../api/_lib/auth.js');const { POLICY } = await import('@three-ws/mcp-policy');-const { spendScopeFor } = await import('../api/_mcp/policy.js');+const { movesValue: movesValueOnPolicy } = await import('../api/_mcp/policy.js');const { dispatch: coreDispatch } = await import('../api/_mcp/dispatch.js');const { toolCatalogFor } = await import('../api/_mcp-studio/dispatch.js');const { GROK_ACCOUNT_TOOLS, movesValue } = await import('../api/_mcp-studio/account-tools.js');@@ -166,7 +166,7 @@ async function listNames(headers = {}, opts = {}) {function expectNoValueMoving(tools) {for (const t of tools) {- for (const server of SERVER_IDS) expect(spendScopeFor(server, t.name), `${t.name} on ${server}`).toBeNull();+ for (const server of SERVER_IDS) expect(movesValueOnPolicy(server, t.name), `${t.name} on ${server}`).toBe(false);for (const server of SERVER_IDS) expect(POLICY[server]?.[t.name]?.tier, `${t.name} tier on ${server}`).not.toBe('financial');expect(t.pricing, `${t.name} price`).toBeUndefined();expect(PRICED_ON_CORE.has(t.name), `${t.name} is priced on /api/mcp`).toBe(false);