Skip to content

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

Open
Zambala108 wants to merge 1 commit into
BlockRunAI:mainfrom
Zambala108:feat/blockrun-talent
Open

feat(talent): blockrun_talent — discover + hire BlockRun marketplace skills#18
Zambala108 wants to merge 1 commit into
BlockRunAI:mainfrom
Zambala108:feat/blockrun-talent

Conversation

@Zambala108

Copy link
Copy Markdown

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

…v0.22.0

New MCP tool exposing the BlockRun agent marketplace (business.blockrun.ai) to
any MCP host. action:"list" (default) browses/searches the catalog for free,
ranked by call volume; action:"run" hires a skill by slug, signing ONE standard
single-leg `exact` USDC x402 payment from the wallet on Base and returning its
output — budget-gated against the quoted price, charged only on a successful
run (the marketplace settles only on success, so a failed run is free).

Mirrors the manual-402 pattern in speech.ts/music.ts (same @blockrun/llm
signer, checkBudget/recordSpending, getChain Base guard), with the two
marketplace deltas: the 402 challenge arrives in the JSON body (not a
PAYMENT-REQUIRED header) and the signed payment goes in the `x-payment` header
(not PAYMENT-SIGNATURE). ASCII-safe payment description (createPaymentPayload
base64s with btoa). scripts/smoke-talent.ts added.

Live-tested end-to-end against real Coinbase CDP /verify on Base mainnet:
402 -> @blockrun/llm-signed x-payment -> {"valid":true}, exact-price gate
10000 == 10000, result returned, $0.01 recorded. tools/list handshake shows
blockrun_talent among 19 tools.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant