BlockRun
Integrations / Claude Agent SDK

Give an agent built on the Claude Agent SDK every BlockRun model and tool through MCP

Add the BlockRun MCP server to a Claude Agent SDK agent's options and it can call any catalog model, generate media and read live data — no keys, pay per call.

How it works

The Claude Agent SDK runs the same agent loop Claude Code uses, in your own process, and takes MCP servers in its options. The BlockRun entry is the same command every MCP host uses: one npx call, no key. The agent then has the catalog as tools — other vendors' models for a second opinion, image and video generation, neural and live search, market and prediction data, chain RPC.

Payment is per call from a wallet the server creates on first run and keeps on the host; the SDK's own model calls are unchanged. This is the shape for an agent that has to buy things for itself: a research agent that pays per search, a pipeline agent that pays per clip.

Behind it is the BlockRun catalog: 78 chat models plus image, video, music and speech generation, search, market data and multi-chain RPC, priced per call. 6 open-weight models are free and need no wallet.

Setup

1. Install

npm install @anthropic-ai/claude-agent-sdk

2. Pass the server in options

import { query } from "@anthropic-ai/claude-agent-sdk";
for await (const msg of query({
  prompt: "Generate a hero image for the launch post and estimate its cost",
  options: { mcpServers: { blockrun: { command: "npx", args: ["-y", "@blockrun/mcp@latest"] } } },
})) console.log(msg);

Questions

How do I add BlockRun to a Claude Agent SDK agent?
Pass the BlockRun MCP server in the query options' mcpServers, as in the setup. The SDK starts it and exposes its tools to the agent; the wallet is created on the first paid call.
Can the agent call non-Anthropic models through BlockRun?
Yes. The blockrun_chat tool takes any catalog id, so the agent can ask a different vendor's model for a second opinion or a cheaper draft.
Does this change how the SDK's own model calls are paid?
No. The SDK's Claude calls keep their own authentication; BlockRun's tools pay for themselves from the wallet.
Where does the wallet live?
On the host running the agent, created by the MCP server on first run. Fund it with USDC or by card; the private key never leaves the machine.
Claude Agent SDK with BlockRun vs Claude Code with BlockRun?
The same MCP server and the same tools. Claude Code is the interactive harness; the Agent SDK is that loop inside a program you ship.
What does a call cost through this integration?
The provider's published token rate with no markup on tokens, plus a flat per-call fee, quoted in dollars in the 402 before the call runs. Image, video and speech calls are priced per unit the same way. The live rate card is on the models page.
Do I need an API key or an account?
No. On the pay-per-call door the request carries its own payment from a wallet the SDK or MCP server creates on first run; there is nothing to sign up for. Teams that prefer keys get an API key and a monthly invoice instead.