blockrun-mcp icon indicating copy to clipboard operation
blockrun-mcp copied to clipboard

feat(talent): blockrun_talent — discover + hire BlockRun marketplace skills

Open Zambala108 opened this issue 5 months ago • 0 comments

What

A new MCP tool, blockrun_talent, that exposes the BlockRun agent marketplace (business.blockrun.ai) — paid AI skills published by other creators — to any MCP host (Claude Desktop, Claude Code, Cursor, Cline, …).

Action For Cost
list (default) browse / search the catalog (query filters name, description, data source; ranked by call volume) free GET
run hire a skill by slug with input one standard USDC x402 on Base, only on a successful run

Why

The marketplace speaks standard single-leg exact x402, so the MCP server pays it with the same wallet + @blockrun/llm signer the other tools already use. One tool turns every MCP host into a buyer of marketplace talent — the agent can hire a specialized skill (live data, a domain analysis, a niche transform) for a sub-task, or when the user asks it to "find an agent for X".

How it follows the existing patterns

Mirrors speech.ts / music.ts (manual-402, Base only):

  • registerTalentTool(server, budget) → server.registerTool("blockrun_talent", { zod inputSchema }, handler)
  • getChain() Base guard, getOrCreateWalletKey() + privateKeyToAccount
  • checkBudget() before paying (against the real quoted price from the 402), recordSpending() after
  • formatError, { content:[{type:"text"}], structuredContent } responses, local fetchWithTimeout

Two deltas because the marketplace is standard x402 (not the gateway): the 402 challenge comes back in the JSON body (parsed straight into extractPaymentDetails, no PAYMENT-REQUIRED header) and the signed payment goes in the x-payment header (not PAYMENT-SIGNATURE). The payment description is ASCII-stripped because createPaymentPayload base64s the payload with btoa.

Spend safety

No interactive prompt is needed: hiring is gated by (a) the budget cap (checkBudget/recordSpending, per-agent via agent_id) and (b) the MCP host's own tool-approval UI. list is free and never touches the budget. A failed run is free (the route settles only on success).

Tested

  • npm run typecheck ✓ · npm run build ✓
  • stdio tools/list handshake returns 19 tools including blockrun_talent
  • scripts/smoke-talent.ts (added): list (free), list+query, missing-slug error, paid run
  • Live end-to-end vs real Coinbase CDP /verify on Base mainnet (buyer 0x1f44…):
    402 challenge (eip155:8453, $0.01)
    verifyPayment: {"valid":true,"payer":"0x1f44…"}
    signedValueMicro 10000 == 10000
    blockrun_talent run -> 🤝 Hired franklin-e2e · Paid $0.01 · result returned; budget $0.0100
    
    This proves CDP accepts the @blockrun/llm-signed x-payment and it clears the route's exact-price gate. (On-chain settle + creator payout are proven on mainnet in the business repo: settle 0x1cea9d…, payout 0xc0d971….)

Companion to the Franklin CLI's /market + agent_talent (BlockRunAI/Franklin#83) — same marketplace, same payment path.

🤖 Generated with Claude Code

Zambala108 avatar Jun 13 '26 08:06 Zambala108