The Q AI MCP (Model Context Protocol) server exposes 16 read-only tools that provide platform observability. These tools are designed for AI agents and LLMs to query the MEV engine without risk of state mutation.
Overview
The MCP server implements the Model Context Protocol standard, enabling any MCP-compatible client (Claude Desktop, Cursor, custom agents) to access YoorQuezt MEV platform data through structured tool calls.
All 16 tools are read-only -- they query the MEV engine and return structured data. No tool can modify engine state, submit transactions, or trigger any side effects.
How It Works
- Client connects to the MCP server via stdio or HTTP transport.
- Tool discovery -- the client requests the list of available tools and their schemas.
- Tool invocation -- the client (or LLM) calls a tool with parameters.
- Server executes the corresponding query against the MEV engine HTTP API.
- Response returned as structured JSON to the client.
┌──────────────┐ MCP Protocol ┌──────────────┐ HTTP ┌──────────────┐
│ MCP Client │ ──────────────────► │ MCP Server │ ──────────────► │ MEV Engine │
│ (Claude, │ tool call │ (:9101) │ GET /api/v1/.. │ (:8080) │
│ Cursor, │ ◄────────────────── │ │ ◄────────────── │ │
│ custom) │ structured result │ │ JSON response │ │
└──────────────┘ └──────────────┘ └──────────────┘
Tools Reference
| Tool | JSON-RPC Method | Description |
|---|---|---|
platform_health_summary | mev_getHealth | Overall platform health, uptime, and component status |
get_active_ride | mev_getActiveAuction | Current active auction round details |
get_ride | mev_getAuction | Specific auction by ID |
get_order | mev_getBundle | Bundle details by hash |
list_orders | mev_listBundles | List recent bundles with filters |
list_stale_orders | mev_listStaleBundles | Bundles stuck in pending state |
order_funnel_stats | mev_getBundleFunnel | Bundle lifecycle funnel (submitted/simulated/landed) |
get_booking | mev_getBlock | Block details including MEV extracted |
get_assignment | mev_getRelayAssignment | Relay assignment for a block |
list_assignments | mev_listRelayAssignments | All relay assignments |
get_wallet | mev_getWallet | Wallet balance and transaction history |
get_payment_intent | mev_getPaymentIntent | Payment intent status |
list_payment_methods | mev_listPaymentMethods | Available payment methods |
get_surge_pricing | mev_getSurgePricing | Current gas surge pricing data |
get_available_slots | mev_getAvailableSlots | Available block builder slots |
explain_error | mev_explainError | Human-readable explanation of error codes |
Error Codes
| Code | Name | Description |
|---|---|---|
-32700 | Parse Error | Invalid JSON received |
-32600 | Invalid Request | JSON is not a valid request object |
-32601 | Method Not Found | The tool/method does not exist |
-32602 | Invalid Params | Invalid tool parameters |
-32603 | Internal Error | Internal MCP server error |
1001 | Engine Unavailable | MEV engine is not reachable |
1002 | Resource Not Found | Requested resource (bundle, block, etc.) not found |
1003 | Rate Limited | Too many requests |
1004 | Timeout | Upstream request timed out |
1005 | Auth Failed | Authentication failed |
Error response format:
{
"error": {
"code": 1002,
"message": "Bundle not found",
"data": {
"bundle_hash": "0xabc123...",
"suggestion": "The bundle may have expired or was never submitted."
}
}
}
Configuration
| Variable | Description | Default |
|---|---|---|
MCP_PORT | Server listen port | 9101 |
MCP_ENGINE_URL | MEV engine HTTP URL | http://localhost:8080 |
MCP_TRANSPORT | Transport mode (stdio, http) | stdio |
MCP_LOG_LEVEL | Log level | info |
MCP_TIMEOUT | Upstream request timeout | 30s |
MCP_CORS_ORIGINS | Allowed CORS origins (HTTP mode) | * |
Code Examples
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"yoorquezt": {
"command": "yqmcp",
"args": ["--engine-url", "http://localhost:8080"],
"env": {
"MCP_LOG_LEVEL": "info"
}
}
}
}
Direct Tool Call (HTTP Transport)
# Start MCP server in HTTP mode
MCP_TRANSPORT=http MCP_PORT=9101 yqmcp
# Call a tool
curl -X POST http://localhost:9101/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "platform_health_summary",
"arguments": {}
}
}'
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\"status\":\"healthy\",\"uptime\":\"14d 3h 22m\",\"engine\":{\"status\":\"running\",\"version\":\"1.4.2\"},\"chains\":{\"connected\":11,\"total\":11},\"relays\":{\"active\":5,\"total\":5},\"bundles\":{\"pending\":3,\"landed_24h\":142},\"profit_24h\":\"2.847 ETH\"}"
}
]
}
}
TypeScript MCP Client
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "yqmcp",
args: ["--engine-url", "http://localhost:8080"],
});
const client = new Client({ name: "my-app", version: "1.0.0" }, {});
await client.connect(transport);
// List available tools
const tools = await client.listTools();
console.log("Available tools:", tools.tools.map(t => t.name));
// Call a tool
const result = await client.callTool({
name: "get_order",
arguments: { id: "0xbundle_hash" },
});
console.log("Bundle:", result.content);
Python MCP Client
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
server_params = StdioServerParameters(
command="yqmcp",
args=["--engine-url", "http://localhost:8080"],
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# List tools
tools = await session.list_tools()
for tool in tools.tools:
print(f" {tool.name}: {tool.description}")
# Call a tool
result = await session.call_tool(
"platform_health_summary", arguments={}
)
print("Health:", result.content)
asyncio.run(main())