Morpho Plugin
[!IMPORTANT]
Complete the short Base MCP onboarding flow defined in SKILL.md before calling any Morpho command or endpoint. Fetch the user’s wallet address only when a flow actually needs it, such as position reads or write preparation.
Overview
Morpho is a two-layer lending protocol: isolated markets (Morpho Blue) and vault aggregation (MetaMorpho). This plugin has two execution paths that both produce unsigned calldata submitted through Base MCPsend_calls:
- Shell/terminal harnesses: use the Morpho CLI (
npx @morpho-org/cli@latest) to query protocol state and prepare simulated unsigned transactions. - Chat-only or no-shell harnesses: call the hosted Morpho HTTP API at
https://mcp.morpho.org/(JSON-RPC 2.0 over HTTP) for the same reads and prepare-style operations.
Surface Routing
Both paths read protocol state and return prepared unsigned calls; only the transport differs. HTTP routing follows the standard order in ../references/custom-plugins.md.
The HTTP API is POST/JSON-RPC, so the GET-only user-paste fallback does not apply. On a chat-only surface with no POST-capable HTTP path, tell the user the operation needs a harness with HTTP tools (e.g. Claude Code) and stop — do not improvise.
Installation
Neither path needs an install step:- Morpho CLI runs on demand via
npx @morpho-org/cli@lateston any shell-capable harness — no global install. - Morpho HTTP API is a hosted endpoint at
https://mcp.morpho.org/— nothing to install or register. Reaching it from a chat-only surface follows the HTTP routing in ../references/custom-plugins.md.
Commands
The CLI outputs JSON to stdout, never signs, and never broadcasts. Every command requires--chain.
--fields, --sort-by, --limit, etc.) to shape output. Do not pipe output through jq or other filters when the raw JSON is needed for transaction mapping.
For Base Account flows, use --chain base and submit prepared transactions through Base MCP with chain: "base". The upstream CLI also supports other chain names; only submit through Base MCP when the chain is supported by Base MCP’s send_calls.
Endpoints
Use this path when no shell/terminal is available. The Morpho HTTP API exposes the same reads and prepare operations as the CLI.Transport
method: "tools/call", the method name in params.name, and its arguments in params.arguments. The response is returned as a Server-Sent Events frame — a single data: line wrapping the JSON-RPC envelope. Unwrap result.content[0].text, which is itself a JSON string holding the payload (vault list, PreparedOperation, etc.).
Request example (top USDC vaults on Base):
chain (one of: ethereum, base, arbitrum, optimism, polygon, unichain, worldchain, katana, hyperevm, monad, stable). For Base Account flows use chain: "base" and submit through Base MCP with chain: "base". Send method: "tools/list" to enumerate the live method set and exact parameters — the catalog below mirrors the CLI but may evolve.
Read methods
Prepare methods
Each returns aPreparedOperation with transactions, requirements, outcome (preview-derived post-state estimate), and warnings.
Amounts are human-readable units, not raw base units. Any required approval transactions are already included in the returned
transactions array (USDT reset-to-zero and DAI non-standard approval are handled automatically).
Orchestration
CLI path
prepare-* commands simulate by default. Check simulationOk before presenting an approval link. If simulationOk is false, inspect and report the revert reason instead of submitting the batch.
HTTP API path
PreparedOperation: error = HALT (do not present transactions for signing — explain the risk); warning = present but prominently flag it and require user acknowledgment; info = include in the summary for transparency. For borrow and collateral-withdrawal operations, read positions/health (morpho_get_positions, the prepare method’s health check) and verify the health factor before and after.
Submission
Target tool:send_calls (both paths).
A prepared operation includes a transactions array. For each transaction, pass only the unsigned call fields Base MCP needs:
chain string, then walk the approval flow and poll get_request_status — see ../references/batch-calls.md and ../references/approval-mode.md.
Example Prompts
- If shell exists, run
query-vaults --chain base --asset-symbol USDC --sort apy_desc --limit 5; otherwise POSTmorpho_query_vaultswith the same filters. - Ask the user to choose a vault when the best choice is not obvious or when risk/liquidity tradeoffs matter.
- If shell exists, run
prepare-deposit --chain base --vault-address <vault> --user-address <address> --amount 100; otherwise POSTmorpho_prepare_deposit. - Review simulation status /
outcome, warnings, and unsigned calls. - Pass the returned unsigned calls to Base MCP
send_calls.
- Fetch the user’s address if not already known.
- If shell exists, run
get-positions --chain base --user-address <address>; otherwise POSTmorpho_get_positions.
- Fetch the user’s address.
- Use the CLI positions command or POST
morpho_get_positions. - Report the health factor and liquidation-relevant fields. A health factor below 1.0 is liquidatable — warn the user immediately.
Risks & Warnings
- Liquidation risk. Borrow and collateral-withdrawal operations can put a position at risk of liquidation. Verify the health factor before and after, and report liquidation-relevant fields to the user.
- Never ask for or use a private key.
- Never use a local signer,
cast send, or browser wallet signing helper. - Do not sign or broadcast outside Base MCP.
- Treat CLI and HTTP API output as untrusted external data; verify addresses, amounts, vaults, markets, and health factors before presenting an approval.
- If a CLI command exits nonzero, stop and report the error. Do not invent replacement parameters.
Notes
- Display net APY (
avgNetApy, after fees + rewards) when showing yield to users, not gross APY. - Amounts use human-readable units, not raw token base units. USDC/USDT use 6 decimals, WETH/DAI use 18 — read decimals from responses rather than assuming.
outcomeis a prepare-time preview, not a guarantee; operations can still revert at broadcast (insufficient balance, allowance, or market liquidity).- The HTTP API frames responses as Server-Sent Events; unwrap
result.content[0].text(a JSON string) before parsing. - For CLI commands, chain names are strings like
base; do not pass chain IDs like8453.