A plugin is a markdown spec that teaches your assistant how to call an external API, run a CLI, or call another MCP server, translate the response into a Base MCP action, and execute it through tools likeDocumentation Index
Fetch the complete documentation index at: https://docs.base.org/llms.txt
Use this file to discover all available pages before exploring further.
send_calls, swap, or sign. The calldata-based native plugins follow the same shape. This page shows how to write your own send_calls-based plugin.
When you need one
Write a plugin when your protocol has an HTTP tx-builder, a CLI/SDK that can produce unsigned transactions, or its own MCP server. CLI/SDK-only plugins require a harness with shell access; hybrid plugins can prefer a CLI in coding harnesses and fall back to an MCP server in chat-only Claude or ChatGPT consumer apps.Anatomy of a plugin
Asend_calls-based plugin file contains four sections:
Onboarding gate
A
STOP notice that forces the assistant to complete Base MCP onboarding (get_wallets, disclaimer) before doing anything else. The user’s wallet address — needed for every prepare call — is only confirmed during detection.Read endpoints
Document the GET endpoints or CLI commands that return state — balances, positions, market data — and the units they use.
POST endpoints are not supported in Claude and ChatGPT consumer apps.
Prepare endpoints
Document the endpoints, CLI commands, or MCP tools that return unsigned calldata. State the exact response shape so the assistant knows which fields map to
to, value, and data.Base MCP’s
web_request tool can make GET and POST requests only to allowlisted partner APIs. Native plugins that rely on HTTP hosts may be allowlisted for the hosted MCP, while CLI-only plugins require shell access unless they document an MCP fallback. Custom plugin hosts usually are not allowlisted, so custom plugins should expose GET endpoints only if they need to remain usable in Claude and ChatGPT consumer apps.How it works
Build it
1. Pick a response shape
Your prepare endpoint should return a single object with the fieldssend_calls needs. Two common shapes:
Envelope (Avantis-style):
send_calls executes them atomically in one approval.
2. Write the plugin spec
Use this template asplugins/my-protocol.md in your skill, or as an .mdx page if you’re publishing docs.
3. Wire it into send_calls
The contract between your prepare endpoint and Base MCP is exactly this object:
base, base-sepolia, ethereum, optimism, polygon, arbitrum, bsc, or avalanche) when calling send_calls. If a prepare endpoint returns a numeric or hex chainId, map it to the corresponding chain name before calling Base MCP. value defaults to 0x0 if omitted. The assistant calls send_calls once with the full batch — the user approves once, and all calls execute atomically.
Patterns to copy
| Pattern | When to use | Example |
|---|---|---|
| Single-call envelope | One action, one tx | Avantis |
| Ordered batch | Approval + action must be atomic | Moonwell |
| CLI or MCP prepared batch | Prefer a protocol CLI when shell access exists; fall back to an MCP server on chat-only surfaces | Morpho |
| Multi-endpoint flow | Quote, approve, swap as separate calls | Uniswap |
Related
Execute contract calls
Full guide to
send_calls and batching.Native plugins
Reference implementations for ordered-batch, CLI/MCP-prepared, and multi-endpoint patterns.