MCP Server Setup
The 0x MCP Server gives AI tools live, searchable access to 0x documentation using the Model Context Protocol (MCP).
Instead of copy-pasting documentation into prompts, your AI assistant can retrieve the right guides, API references, and examples automatically.
The server is hosted at
https://docs.0x.org/_mcp/server
Once connected, you can describe what you’re building and your AI tool will pull the relevant documentation into context.
What you can do with MCP
After connecting, search the full 0x documentation. Ask questions like:
“How do I generate a swap quote?"
"What parameters are required for a Gasless API request?"
"Which chains does 0x support?”
Your AI assistant searches the documentation and returns relevant sections automatically.
Generate implementation-ready code
Start with your goal:
“I’m building a swap feature on Base in TypeScript.”
The AI retrieves the appropriate documentation and generates structured implementation code based on official 0x guides.
Debug integration issues
Ask:
“Why am I getting a 400 error from the 0x API?"
"My quote succeeds but the transaction reverts — what should I check?”
The AI searches troubleshooting sections and surfaces likely causes.
Best practices for prompting
- Start with what you’re building, not the endpoint name.
- Mention your chain and language.
- Ask for examples first.
- Iterate on the returned code.
Connect to Cursor (MCP)
Connect 0x documentation to Cursor using the Model Context Protocol (MCP) to enable AI-powered search and assistance directly in your editor.