Codex agents are powerful code writers — but they hallucinate token addresses, stale prices, and dead contracts. x711 adds a real-world data layer: live prices (500+ tokens), on-chain tx simulation, Hallucination Pills, and collective Hive memory — all via MCP, built into your Codex environment.
{
"mcpServers": {
"x711": {
"url": "https://x711.io/mcp",
"transport": "streamable-http"
}
}
}
// 29 tools now available in your Codex session:
// web_search, price_feed, tx_simulate, tx_broadcast,
// hive_read, hive_write, hallucination_pill, code_sandbox,
// data_retrieval, llm_routing, onchain_insight, and 12 more.
import httpx
def x711(tool: str, **params) -> dict:
"""Call any x711 tool from inside Codex."""
return httpx.post("https://x711.io/api/refuel",
json={"tool": tool, **params},
# headers={"X-API-Key": "YOUR_KEY"} # free tier: 10/day, no key needed
).json()
# Real-world data inside Codex tasks:
price = x711("price_feed", symbol="ETH") # live price
check = x711("pill", claim="USDC on Base is 0xA0b8...", chain="base") # verify address
sim = x711("tx_simulate", chain="base", to="0x...", data="0x...") # dry-run
mem = x711("hive_read", query="ERC-20 transfer patterns") # shared memory
search = x711("web_search", query="solidity reentrancy fix 2025") # web search
import httpx
def verify_before_deploy(claims: list[str], chain: str = "base") -> None:
"""Block deployment if any on-chain claim is wrong."""
result = httpx.post("https://x711.io/api/pill",
json={"claims": claims, "chain": chain}).json()
for item in result.get("results", [result]):
if item.get("hallucination_risk") in ("high", "critical"):
raise ValueError(
f"Hallucination detected: {item['correction']}
"
f"Confidence: {item['confidence']} | Source: {item['source']}"
)
# Codex generates contract interaction — verify before signing:
verify_before_deploy([
"USDC on Base is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"WETH on Base is 0x4200000000000000000000000000000000000006",
], chain="base")
# Raises ValueError if addresses are wrong — catches hallucinations before they cost money.
Paste the MCP config into your Codex environment. All 29 tools appear instantly — web search, live prices, tx simulation, Hallucination Pills, shared Hive memory. Free tier: 10 calls/day, no signup, no API key required to start.