What is MCP?
Model Context Protocol (MCP) is an open standard that connects AI applications to external data sources. Instead of relying on general web search, your AI tool searches DFlow documentation directly during response generation, giving you current API methods, correct parameters, and working examples.Connecting to the DFlow MCP Server
Use the contextual menu at the top of any documentation page for one-click setup, or follow the manual instructions below.- Claude Code
- Claude
- Cursor
- VS Code
- Windsurf
Run the following command:Or add to your project’s Verify with:
.mcp.json:What You Get
Once connected, your AI tool can search DFlow documentation while generating responses. This includes:- Trading API: Order, imperative, and declarative endpoints with parameters and examples.
- Metadata API: Prediction market discovery, orderbooks, candlesticks, websockets.
- Proof API: KYC verification endpoints.
- Code Recipes: End-to-end implementation patterns for common use cases.
- Concepts: How routing, slippage, priority fees, and platform fees work.
- Debugging: Draws from a large FAQ library that is continuously updated based on real integration questions from builders, so your AI tool can troubleshoot issues using the same answers our team gives in support channels.
The MCP server is automatically generated from this documentation and stays in sync as pages are updated.
Example Prompts
Try these with the DFlow MCP server connected: Arbitrage and Market Scanning- “Build a scanner that finds active prediction markets where the combined YES and NO ask prices sum to less than $1.”
- “Write a function that monitors orderbook depth across markets and flags any where the top-of-book spread is wider than 5 cents.”
- “Write a bot that streams websocket price updates and automatically buys YES when the ask drops below a target price.”
- “Build an auto-redemption bot that polls for markets transitioning to determined status and redeems winning outcome tokens immediately.”
- “Write a script that monitors market lifecycle status and places a trade the moment a market goes active.”
- “Build a portfolio tracker that maps a wallet’s outcome token balances to their current market prices and shows unrealized P&L.”
- “Write a function that automatically decreases a position when the bid price hits a take-profit target.”
- “How do I track all my open prediction market positions and calculate total exposure?”
- “Write an imperative trade that routes through a single DEX using the dexes parameter for deterministic execution.”
- “How do I use USDC as the input mint to skip the spot swap leg and get the lowest latency prediction market trade?”
- “How do I use priority fee presets like auto, medium, high, and veryHigh to speed up time-sensitive trades?”
- “Write a TypeScript function that executes an imperative token swap on DFlow with custom slippage.”
- “How do I add dynamic platform fees to prediction market trades?”
- “How do I trade BONK into a prediction market outcome token position?”
- “My trade is returning
route_not_found, how do I debug this?” - “Why is my swap transaction failing onchain after getting a successful quote?”
Tips
- Be specific: “How do I submit a declarative trade with platform fees?” works better than “help with trading.”
- Mention your stack: “Using TypeScript and Next.js, show me how to…” gives better results.
- Iterate: Use generated code as a starting point and ask for modifications.
- Prepare: Read the docs first, so you know how to properly frame your commands.