@definitive-fi/flash-mcp) lets an AI agent quote, execute, and manage Flash trades directly from any MCP client — Claude Code, Claude Desktop, Cursor, Codex, and others. It’s the fastest way to give an agent a working Flash integration: no code to write, no signing flow to implement.
The server handles the entire order lifecycle for you — quote → wrap/approve → sign → submit → poll for fill — across both EVM wallets and Solana, routing over 200+ liquidity sources on 14 chains.
npm
@definitive-fi/flash-mcpGitHub
Open source — MIT. Doubles as a reference implementation of the quote → sign → submit flow.
Tools
Install
The server is published to npm — no clone or build needed. Pick your client:- Claude Code
- Cursor
- Codex
- Claude Desktop / other
First-run setup
Run the interactive wizard in your own terminal — it walks through everything in one pass:1
Generate a Flash API key
The wizard opens the Definitive MCP setup page (
app.definitive.fi/account/organization/mcp-setup). Log in, click Generate API Key, Copy & Close, and paste the key when prompted.2
Add your funder wallet(s)
Paste your EVM funder wallet private key, your Solana funder wallet secret, or both. Press Enter to skip either — you can add one later. Secrets are typed into hidden prompts and written straight to the OS keychain; they never appear on screen, in shell history, or in any chat transcript.
3
(Optional) Set custom RPCs
Provide a personal RPC endpoint per chain. The public defaults work but are rate-limited — a personal endpoint is recommended if you trade often.
flash_status to confirm, flash_quote to price, flash_submit_order to trade.
Individual CLI commands
Each wizard step is also available as a one-shot command (prompts are hidden, secrets go to the keychain):npx -y @definitive-fi/flash-mcp set-key evm.
Credential storage
Secrets are stored in the macOS Keychain (servicedefinitive-flash-mcp), encrypted at rest by the OS — never written to a dotfile in plaintext. On non-macOS hosts, or to inject credentials without running flash_setup, set environment variables (these take precedence over the keychain):
RPC precedence, highest first: per-call
rpcUrl argument → DEFINITIVE_RPC_<CHAIN> env var → flash_setup config (~/.config/definitive-flash-mcp/config.json) → public default.
Good to know
flash_submit_orderspends real funds. It quotes fresh, signs with your stored key, and submits. For market orders it polls until the order reaches a terminal status.- EVM trades may send a one-time ERC-20 approve (and a wrap tx for native-asset trades) before signing — your wallet needs a little gas for those.
qtyis the amount being spent:contraAssetunits for buys,targetAssetunits for sells. See Placing Orders for the target/contra model.- Supported chains: ethereum, optimism, bsc, polygon, base, arbitrum, avalanche, hyperevm, robinhood, plasma, monad, ink, arc, solana.
Prefer to build the flow yourself instead of running the server? The MCP is a reference implementation of the same three steps documented in AI Integration: quote → sign → submit.