Moonwell Plugin
[!IMPORTANT] Complete the short Base MCP onboarding flow defined inMoonwell is a Compound v2 lending protocol on Base and Optimism. UseSKILL.mdbefore calling any Moonwell endpoint. The user’s wallet address — required forprepareand position queries — is fetched lazily when needed.
web_request to call the Moonwell HTTP API to read positions/rates and prepare unsigned calldata, then execute via send_calls.
No additional MCP server required — everything goes through web_request + send_calls.
Prerequisite: api.moonwell.fi must be in the MCP server’s web_request allowlist. If requests to that hostname are rejected, inform the user that the Moonwell API is not yet whitelisted on this MCP instance.
Supported chains: Base (8453), Optimism (10).
Orchestration Pattern
transactions[] are ordered — approve and enter-market come before the protocol action. Execute them as a single send_calls batch.
Read Endpoints (use web_request GET)
positions, health, rewards, token-balance) are never cached.
/positions returns an array — one entry per market. Use ?active=true to filter out markets where both suppliedUsd and borrowedUsd are zero.
Prepare Endpoints (use web_request → send_calls)
Verbs:supply, withdraw, borrow, repay.
GET form (query params):
body object parameter to web_request):
Key parameters
| Field | Notes |
|---|---|
chain | base (default), optimism, or chain ID |
asset | Symbol: USDC, WETH, ETH (alias for WETH) |
amountDecimal | Human-readable string, e.g. "100". Use this or amount (base units), never both. |
from | User’s wallet address (from get_wallets) |
Response → send_calls mapping
calls array to send_calls, mapping chainId from any transaction item to the Base MCP chain string (base for Base mainnet, optimism for Optimism).
Example Flows
Supply 100 USDC on Base
Borrow USDC against collateral
Check positions and health
Protocol Notes
- mTokens — ERC-20 receipt tokens (mUSDC, mWETH…); exchange rate accrues over time
- WETH special-case — borrow/withdraw deliver native ETH; supply/repay require ERC-20 WETH. Both
asset=ETHandasset=WETHresolve to the same mWETH market - Compound v2 error codes —
mint,borrow,repayreturn non-zero codes for business-logic failures without reverting. Check the onchain receipt after broadcast - Base has two mUSDC entries — the current market and a deprecated bridged-USDC market. Disambiguate by
marketAddressordeprecated: true
Health factor guide
| Value | Status |
|---|---|
> 1.5 | Healthy |
1.1 – 1.5 | Caution |
< 1.1 | Liquidation risk |
null | No borrows |
Chain IDs from Moonwell
| Chain | Moonwell chainId | Base MCP chain |
|---|---|---|
| Base mainnet | 0x2105 | base |
| Optimism | 0xa | optimism |