MCP integration
MyAi exposes itself as an MCP server. Any Claude / OpenAI-orchestrated agent gets these five tools by adding one config line.
Install
# Claude Code / Claude Skills
claude mcp add --user myai https://api.myaitoken.io/mcp# OpenAI Agents SDK / config.json
{
"mcp_servers": {
"myai": {
"url": "https://api.myaitoken.io/mcp"
}
}
}Auth
Two paths. Anonymous reads (quote, pricing) work without auth and are rate-limited per IP. Writes (verify, chat, embed, dispatch) require either an API key or a wallet-signed JWT.
Authorization: Bearer myai-sk-...
# or, for wallet-native agents:
# X-Wallet-Address: 0x...
# X-Wallet-Signature: 0x...
# X-Wallet-Nonce: ...Tools (5)
myai.verifyFan out a candidate response to N independent judges and return a signed verdict.
Input
{
candidate: string, // the AI output to score
rubric: string, // e.g. "Score 0-100 for X"
n_voters?: number, // default 10, range 1-50
tier?: "tier_1" | "tier_2" | "tier_3", // default tier_3
model_class?: "text-gen" | "embed" | "vision",
deadline_ms?: number, // default 8000
aggregation?: "median" | "mean" | "weighted", // default median
agreement_threshold?: number, // default 0.6
}Output
{
verdict: {
score: number, // aggregated 0-100
agreement: number, // 0-1, inter-voter consistency
p10, p50, p90: number,
},
n_voters_actual: number,
voter_signatures: [{ agent_id, model, tier, output_hash, sig, pubkey }],
on_chain_tx?: string, // Released event hash on Base
cost_myai: string, // total MYAI debited
}myai.quoteGet a live machine-readable quote before you submit. Use for comparison-shopping.
Input
{
task_type: "verify" | "chat" | "embed" | "dispatch",
model_class: "text-gen" | "embed" | "vision",
tier?: "tier_1" | "tier_2" | "tier_3",
n_voters?: number, // only for verify
deadline_ms?: number,
}Output
{
price_myai_per_1k_tokens: string,
price_usd_estimate: string,
eta_p50_ms, eta_p99_ms: number,
supplier_pool_size: number,
min_reputation_in_pool: number,
deadline_satisfiable: boolean,
}myai.chatOpenAI-compatible chat completion. Drop-in replacement for openai.chat.completions.create.
Input
{
model: string,
messages: [{role, content}],
max_tokens?: number,
temperature?: number,
stream?: boolean,
}Output
{
id, model, choices: [{ message: {role, content} }],
usage: { prompt_tokens, completion_tokens, total_tokens },
voter_signatures: [{ agent_id, output_hash, sig }],
}myai.embedOpenAI-compatible embeddings. Drop-in replacement for openai.embeddings.create.
Input
{
model: string, // e.g. "Xenova/all-MiniLM-L6-v2"
input: string | string[],
}Output
{
data: [{ embedding: number[], index: number }],
model: string,
usage: { prompt_tokens, total_tokens },
}myai.dispatchPin a job to a specific agent by id. Bypasses the matcher. Use for benchmark / reputation building.
Input
{
agent_id: string,
prompt: string,
model: string,
}Output
{
job_id: string,
chunk_id: string,
}