StableDomains.net runs a remote MCP server at /api/mcp, so any agent framework that speaks MCP can search for a domain, buy it in USDC and set its DNS. Below are working recipes for LangChain, CrewAI and the Vercel AI SDK.
Real domains. Paid in stablecoins. Bought by agents.
Step 1: get a free API key
Searching and quoting need no key. Ordering does. Get a guest key in one call, with no email:
curl -s -X POST /api/v1/agents/signup
# {"api_key":"sd_...", ...}
export SD_KEY=sd_...
Step 2: the buy flow
The tools are search_domains, quote_domain, create_order, pay_order (or x402), check_order and set_dns. The order response holds the exact USDC amount and address. Pay by transfer, gasless x402, or send a human to the order page. Full step-by-step: llms.txt.
LangChain (Python)
# pip install langchain-mcp-adapters langgraph langchain-openai
import asyncio, os
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
async def main():
client = MultiServerMCPClient({"stabledomains": {
"url": "/api/mcp", "transport": "streamable_http",
"headers": {"Authorization": f"Bearer {os.environ['SD_KEY']}"}}})
tools = await client.get_tools()
agent = create_react_agent("openai:gpt-4.1", tools)
r = await agent.ainvoke({"messages": "Find an available .dev name for a cat-photo agent under $20 and create an order paid in USDC on Base."})
print(r["messages"][-1].content)
asyncio.run(main())
CrewAI
# pip install "crewai-tools[mcp]"
import os
from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
server = {"url": "/api/mcp", "transport": "streamable-http",
"headers": {"Authorization": f"Bearer {os.environ['SD_KEY']}"}}
with MCPServerAdapter(server) as tools:
buyer = Agent(role="Domain buyer", goal="Register the best available domain", backstory="Pays in USDC.", tools=tools)
task = Task(description="Search names for 'acme robotics', pick the cheapest available .com or .ai, create the order and return the order id and payment details.", expected_output="order id, amount, pay_to", agent=buyer)
print(Crew(agents=[buyer], tasks=[task]).kickoff())
Vercel AI SDK (TypeScript)
// npm i ai @ai-sdk/mcp @ai-sdk/openai
import { experimental_createMCPClient as createMCPClient } from "@ai-sdk/mcp";
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
const mcp = await createMCPClient({ transport: { type: "http", url: "/api/mcp",
headers: { Authorization: `Bearer ${process.env.SD_KEY}` } } });
const { text } = await generateText({
model: openai("gpt-4.1"), tools: await mcp.tools(), stopWhen: stepCountIs(8),
prompt: "Check if myagent.dev is available, quote it, and create a USDC order on Base.",
});
console.log(text);
await mcp.close();
Paying
The agent gets back pay_to, token_address and amount_units. A wallet-enabled agent can pay gaslessly with x402 (retry create_order with the payment header) or send the transfer and call pay_order with the transaction hash. Otherwise, hand a person the link /order/{id} to pay from a wallet or card.
Related
Prefer drop-in instructions? Point your agent at /skills.md and /skill_register.md. Pay in USDC or USDT, and opt in to a backlink on the showcase once your site is live.
FAQ
Do I need an account? No. A guest key from POST /api/v1/agents/signup is enough to order. You can claim the account later.
Which MCP transport is it? Streamable HTTP (stateless JSON) at /api/mcp. OAuth 2.1 is also supported for clients like Claude.
Can the agent set DNS after buying? Yes. Use set_dns with A, AAAA, CNAME, MX or TXT records, or set custom nameservers.