// The MCP server, spoken to as a client would: over the app's own POST /mcp, in both eras of the protocol. // Specification: https://modelcontextprotocol.io/specification/2026-07-28 (basic, basic/versioning, // basic/transports/streamable-http, server/discover, server/tools) and, for the handshake, // https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle import { test, describe } from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { MCP_LEGACY, MCP_MODERN, MCP_VERSIONS, TOOLS, checkArguments } from "../lib/mcp.mjs"; import { sshKey } from "./helpers.mjs"; import { world } from "./world.mjs"; const PUBLIC_TOOLS = ["list_gpus", "find_gpu", "quote_rental", "market", "quote_nvda_credits", "rental_status", "credits_contract"]; const ACCOUNT_TOOLS = ["get_balance", "list_instances", "rent_gpu", "end_instance"]; const META = { "io.modelcontextprotocol/protocolVersion": MCP_MODERN, "io.modelcontextprotocol/clientInfo": { name: "test-client", version: "1.0.0" }, "io.modelcontextprotocol/clientCapabilities": {} }; const closedWorld = () => world({ without: ["provider", "store", "sessionSecret", "treasury", "chain"] }); /** One POST to /mcp. Returns the HTTP status, the response headers and the parsed JSON-RPC message (or null). */ async function post(w, message, { headers = {}, token, raw, ip, origin } = {}) { const r = await w.app.handle({ method: "POST", path: "/mcp", ip: ip ?? "7.7.7.7", origin, headers, auth: token ? "Bearer " + token : undefined, body: raw ?? JSON.stringify(message) }); return { status: r.status, headers: r.headers, body: r.body ? JSON.parse(r.body) : null, text: r.body }; } let nextId = 1; /** A request of the 2026-07-28 revision: version and capabilities in _meta, mirrored in the headers. */ function modern(w, method, params = {}, o = {}) { const headers = { "mcp-protocol-version": MCP_MODERN, "mcp-method": method, ...(method === "tools/call" ? { "mcp-name": params.name } : {}), ...(o.headers ?? {}) }; for (const k of o.dropHeaders ?? []) delete headers[k]; return post(w, { jsonrpc: "2.0", id: nextId++, method, params: { ...params, _meta: o.meta ?? META } }, { ...o, headers }); } /** A request of the handshake revisions: no _meta, the negotiated version in a header. */ const legacy = (w, method, params, o = {}) => post(w, { jsonrpc: "2.0", id: nextId++, method, ...(params ? { params } : {}) }, { ...o, headers: { "mcp-protocol-version": "2025-11-25", ...(o.headers ?? {}) } }); const tool = async (w, name, args = {}, o = {}) => (await modern(w, "tools/call", { name, arguments: args }, o)).body.result; describe("the 2026-07-28 revision: every request carries what it needs", () => { test("server/discover says what the server speaks and offers, and who it is", async () => { const r = await modern(closedWorld(), "server/discover"); assert.equal(r.status, 200); assert.equal(r.headers["Content-Type"], "application/json"); assert.equal(r.headers["Cache-Control"], "no-store"); assert.deepEqual(Object.keys(r.body).sort(), ["id", "jsonrpc", "result"]); const res = r.body.result; assert.equal(res.resultType, "complete"); assert.deepEqual(res.supportedVersions, ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26"]); assert.deepEqual(res.capabilities, { tools: { listChanged: false } }); assert.deepEqual(res._meta["io.modelcontextprotocol/serverInfo"], { name: "idle-gpu", title: "Idle, the GPU cloud on Elysium", version: "0.4.0" }); assert.match(res.instructions, /rental_status/); assert.ok(Number.isInteger(res.ttlMs) && res.ttlMs >= 0); assert.equal(res.cacheScope, "public"); }); test("tools/list gives the ten tools, in a fixed order, each with a description and a JSON Schema", async () => { const w = closedWorld(); const r = await modern(w, "tools/list"); assert.equal(r.status, 200); const res = r.body.result; assert.deepEqual([res.resultType, res.cacheScope, res.ttlMs >= 0, "nextCursor" in res], ["complete", "public", true, false]); assert.deepEqual(res.tools.map((t) => t.name), [...PUBLIC_TOOLS, ...ACCOUNT_TOOLS]); for (const t of res.tools) { assert.deepEqual(Object.keys(t).sort(), ["annotations", "description", "inputSchema", "name", "title"]); assert.match(t.name, /^[A-Za-z0-9_.-]{1,128}$/); assert.ok(t.description.length > 60, t.name); assert.equal(t.inputSchema.type, "object"); assert.equal(t.inputSchema.additionalProperties, false); assert.equal(typeof t.annotations.readOnlyHint, "boolean"); } assert.deepEqual(res.tools.filter((t) => !t.annotations.readOnlyHint).map((t) => t.name), ["rent_gpu", "end_instance"]); assert.deepEqual((await modern(w, "tools/list")).body.result.tools, res.tools, "the same list every time"); // A key does not change which tools exist: only what they answer. const open = world(); assert.deepEqual((await modern(open, "tools/list", {}, { token: "idk_whatever" })).body.result.tools, res.tools); assert.equal((await modern(w, "tools/list", { cursor: "abc" })).body.error.code, -32602); }); test("the protocol version must be in the body and in the header, and they must agree", async () => { const w = closedWorld(); const missingHeader = await modern(w, "tools/list", {}, { dropHeaders: ["mcp-protocol-version"] }); assert.deepEqual([missingHeader.status, missingHeader.body.error.code], [400, -32020]); const mismatch = await modern(w, "tools/list", {}, { headers: { "mcp-protocol-version": "2025-11-25" } }); assert.deepEqual([mismatch.status, mismatch.body.error.code], [400, -32020]); assert.match(mismatch.body.error.message, /MCP-Protocol-Version header value '2025-11-25' does not match body value '2026-07-28'/); // The header says 2026-07-28 but the body carries no _meta: a malformed request of this revision. const noMeta = await post(w, { jsonrpc: "2.0", id: 1, method: "tools/list" }, { headers: { "mcp-protocol-version": MCP_MODERN, "mcp-method": "tools/list" } }); assert.deepEqual([noMeta.status, noMeta.body.error.code], [400, -32602]); const noCaps = await modern(w, "tools/list", {}, { meta: { "io.modelcontextprotocol/protocolVersion": MCP_MODERN } }); assert.deepEqual([noCaps.status, noCaps.body.error.code], [400, -32602]); assert.match(noCaps.body.error.message, /clientCapabilities/); assert.equal(noCaps.body.id > 0, true, "an error names the request it answers"); }); test("a version it does not speak is refused with the list of those it does", async () => { const w = closedWorld(); const meta = { ...META, "io.modelcontextprotocol/protocolVersion": "1900-01-01" }; const r = await modern(w, "tools/list", {}, { meta, headers: { "mcp-protocol-version": "1900-01-01" } }); assert.equal(r.status, 400); assert.deepEqual(r.body.error, { code: -32022, message: "Unsupported protocol version", data: { supported: MCP_VERSIONS, requested: "1900-01-01" } }); // The same when only the header names it. const headerOnly = await post(w, { jsonrpc: "2.0", id: 9, method: "tools/list" }, { headers: { "mcp-protocol-version": "2027-01-01" } }); assert.deepEqual([headerOnly.status, headerOnly.body.error.code, headerOnly.body.error.data.requested], [400, -32022, "2027-01-01"]); }); test("Mcp-Method and Mcp-Name must be there and must match the body", async () => { const w = closedWorld(); const code = async (o, method = "tools/call", params = { name: "market", arguments: {} }) => { const r = await modern(w, method, params, o); return [r.status, r.body.error?.code ?? null]; }; assert.deepEqual(await code({ dropHeaders: ["mcp-method"] }), [400, -32020]); assert.deepEqual(await code({ headers: { "mcp-method": "tools/list" } }), [400, -32020]); assert.deepEqual(await code({ dropHeaders: ["mcp-name"] }), [400, -32020]); assert.deepEqual(await code({ headers: { "mcp-name": "list_gpus" } }), [400, -32020]); assert.deepEqual(await code({}), [200, null]); // A name sent in the Base64 form the transport allows is decoded before it is compared. assert.deepEqual(await code({ headers: { "mcp-name": "=?base64?" + Buffer.from("market").toString("base64") + "?=" } }), [200, null]); assert.deepEqual(await code({ headers: { "mcp-name": "=?base64?" + Buffer.from("list_gpus").toString("base64") + "?=" } }), [400, -32020]); }); test("a method that is not part of the revision is a 404 with -32601; that includes initialize and ping", async () => { const w = closedWorld(); for (const method of ["ping", "resources/list", "prompts/list", "nope"]) { const r = await modern(w, method); assert.deepEqual([r.status, r.body.error.code], [404, -32601], method); } }); }); describe("the handshake revisions: initialize, then requests", () => { test("initialize answers with the client's version when it is one it serves, otherwise with its latest", async () => { const w = closedWorld(); const init = (protocolVersion) => post(w, { jsonrpc: "2.0", id: "init-1", method: "initialize", params: { protocolVersion, capabilities: {}, clientInfo: { name: "test-client", version: "1.0.0" } } }); const r = await init("2025-06-18"); assert.equal(r.status, 200); assert.deepEqual(r.body, { jsonrpc: "2.0", id: "init-1", result: { protocolVersion: "2025-06-18", capabilities: { tools: { listChanged: false } }, serverInfo: { name: "idle-gpu", title: "Idle, the GPU cloud on Elysium", version: "0.4.0" }, instructions: r.body.result.instructions } }); assert.equal(r.headers["Mcp-Session-Id"], undefined, "no session is minted: nothing is remembered between requests"); for (const v of MCP_LEGACY) assert.equal((await init(v)).body.result.protocolVersion, v); assert.equal((await init("2024-11-05")).body.result.protocolVersion, "2025-11-25"); assert.equal((await init("2026-07-28")).body.result.protocolVersion, "2025-11-25", "the handshake is how the earlier revisions spoke"); assert.equal((await post(w, { jsonrpc: "2.0", id: 2, method: "initialize", params: {} })).body.error.code, -32602); }); test("notifications are accepted with 202 and no body", async () => { const w = closedWorld(); for (const method of ["notifications/initialized", "notifications/cancelled"]) { const r = await post(w, { jsonrpc: "2.0", method }, { headers: { "mcp-protocol-version": "2025-11-25" } }); assert.deepEqual([r.status, r.text], [202, ""], method); } }); test("ping, tools/list and tools/call work with the negotiated version in the header, or with none", async () => { const w = closedWorld(); assert.deepEqual((await legacy(w, "ping")).body.result, {}); const list = (await legacy(w, "tools/list")).body.result; assert.deepEqual(Object.keys(list), ["tools"], "no field the earlier revisions did not have"); assert.equal(list.tools.length, 11); const call = await legacy(w, "tools/call", { name: "rental_status", arguments: {} }); assert.equal(call.status, 200); assert.deepEqual(Object.keys(call.body.result).sort(), ["content", "isError", "structuredContent"]); assert.equal(call.body.result.structuredContent.mode, "closed"); // 2025-03-26 clients send no version header at all. assert.deepEqual((await post(w, { jsonrpc: "2.0", id: 5, method: "ping" })).body.result, {}); for (const v of MCP_LEGACY) assert.equal((await legacy(w, "tools/list", undefined, { headers: { "mcp-protocol-version": v } })).status, 200); const unknown = await legacy(w, "resources/list"); assert.deepEqual([unknown.status, unknown.body.error.code], [200, -32601]); }); }); describe("the transport", () => { test("GET and DELETE answer 405: there is no stream to open and no session to end", async () => { const w = closedWorld(); for (const method of ["GET", "DELETE"]) { const r = await w.app.handle({ method, path: "/mcp", ip: "1.2.3.4" }); assert.deepEqual([r.status, r.headers.Allow, JSON.parse(r.body).error.code], [405, "POST", -32600], method); } }); test("a malformed message is refused as JSON-RPC says, without an id it could not read", async () => { const w = closedWorld(); const bad = async (raw) => { const r = await post(w, null, { raw }); return [r.status, r.body.error.code, "id" in r.body]; }; assert.deepEqual(await bad("{not json"), [400, -32700, false]); assert.deepEqual(await bad("[]"), [400, -32600, false]); assert.deepEqual(await bad(JSON.stringify([{ jsonrpc: "2.0", id: 1, method: "ping" }])), [400, -32600, false]); assert.deepEqual(await bad(JSON.stringify({ id: 1, method: "ping" })), [400, -32600, false]); assert.deepEqual(await bad(JSON.stringify({ jsonrpc: "1.0", id: 1, method: "ping" })), [400, -32600, false]); assert.deepEqual(await bad(JSON.stringify({ jsonrpc: "2.0", id: null, method: "ping" })), [400, -32600, false]); assert.deepEqual(await bad(JSON.stringify({ jsonrpc: "2.0", id: 1.5, method: "ping" })), [400, -32600, false]); assert.deepEqual(await bad('"ping"'), [400, -32600, false]); // A response is not something a client may send here. assert.deepEqual(await bad(JSON.stringify({ jsonrpc: "2.0", id: 4, result: {} })), [400, -32600, true]); assert.deepEqual(await bad(JSON.stringify({ jsonrpc: "2.0", id: 4, method: "tools/call", params: [1] })), [400, -32602, true]); }); test("an unknown tool is a protocol error, -32602, in both eras", async () => { const w = closedWorld(); const m = await modern(w, "tools/call", { name: "launch_rocket", arguments: {} }); assert.deepEqual([m.status, m.body.error.code, m.body.error.message], [400, -32602, "Unknown tool: launch_rocket"]); const l = await legacy(w, "tools/call", { name: "launch_rocket" }); assert.deepEqual([l.status, l.body.error.code], [200, -32602]); assert.equal((await legacy(w, "tools/call", {})).body.error.code, -32602); }); test("a browser may send the protocol's headers; a configured origin list is enforced; calls are rate limited", async () => { const w = world({ cfg: { origins: ["https://idle-elysium.vercel.app"], mcpPerMinute: 3 } }); const pre = await w.app.handle({ method: "OPTIONS", path: "/mcp", origin: "https://idle-elysium.vercel.app" }); assert.equal(pre.status, 204); for (const h of ["Authorization", "MCP-Protocol-Version", "Mcp-Method", "Mcp-Name"]) assert.ok(pre.headers["Access-Control-Allow-Headers"].includes(h), h); assert.equal((await modern(w, "server/discover", {}, { origin: "https://idle-elysium.vercel.app" })).status, 200); const foreign = await modern(w, "server/discover", {}, { origin: "https://evil.example" }); assert.deepEqual([foreign.status, foreign.body.error.code], [403, -32600]); assert.equal((await modern(w, "server/discover")).status, 200, "a client that is not a browser sends no Origin"); const limited = await modern(w, "server/discover"); assert.deepEqual([limited.status, limited.body.error.code], [429, 429]); assert.equal((await modern(w, "server/discover", {}, { ip: "8.8.8.8" })).status, 200); }); }); describe("the tools while rentals are closed", () => { test("a result carries the same thing twice: as text for a model, and as structured content", async () => { const w = closedWorld(); const r = await modern(w, "tools/call", { name: "rental_status", arguments: {} }); const res = r.body.result; assert.deepEqual(Object.keys(res).sort(), ["_meta", "content", "isError", "resultType", "structuredContent"]); assert.deepEqual([res.resultType, res.isError, res.content.length, res.content[0].type], ["complete", false, 1, "text"]); assert.deepEqual(JSON.parse(res.content[0].text), res.structuredContent); assert.equal(res._meta["io.modelcontextprotocol/serverInfo"].name, "idle-gpu"); }); test("the six tools that need no account all answer", async () => { const w = closedWorld(); const status = await tool(w, "rental_status"); assert.deepEqual([status.isError, status.structuredContent.mode, status.structuredContent.rentals, status.structuredContent.missing.length], [false, "closed", false, 5]); const gpus = await tool(w, "list_gpus"); assert.deepEqual([gpus.isError, gpus.structuredContent.source, gpus.structuredContent.gpus.length, gpus.structuredContent.gpus.every((g) => g.available === 0)], [false, "target", 7, true]); const found = await tool(w, "find_gpu", { minVram: 24, prefer: "secure" }); assert.equal(found.isError, false); assert.deepEqual([found.structuredContent.pick.model, found.structuredContent.pick.secure, found.structuredContent.rentableThroughIdle, found.structuredContent.rule.prefer], ["RTX A5000", true, false, "secure"]); assert.match(found.structuredContent.note, /not Idle's machines/); assert.equal((await tool(w, "find_gpu")).structuredContent.rule.prefer, "cheapest", "every argument is optional"); const quote = await tool(w, "quote_rental", { gpu: "h100", seconds: 1200 }); assert.deepEqual([quote.isError, quote.structuredContent.gpu, quote.structuredContent.seconds, quote.structuredContent.usd > 0], [false, "h100", 1200, true]); const market = await tool(w, "market"); assert.deepEqual([market.isError, market.structuredContent.equity.symbol, market.structuredContent.hypeMid], [false, "EQNVDA", 50]); const credits = await tool(w, "quote_nvda_credits", { amount: "1.5" }); assert.deepEqual([credits.isError, credits.structuredContent.token, credits.structuredContent.creditsUsd, credits.structuredContent.mode], [false, "EQNVDA", 224.687925, "closed"]); assert.equal(w.offerCalls.runpod, 1, "two find_gpu calls, one read of the sources"); }); test("the four that act on an account stay listed and answer a tool error not-open that says why", async () => { const w = closedWorld(); for (const [name, args] of [["get_balance", {}], ["list_instances", {}], ["rent_gpu", { gpu: "rtx-4090" }], ["end_instance", { id: "i0001" }]]) { const res = await tool(w, name, args, { token: "idk_" + "a".repeat(43) }); assert.equal(res.isError, true, name); assert.equal(res.structuredContent.error, "not-open"); assert.equal(res.structuredContent.missing.length, 5); assert.match(res.content[0].text, /^not-open: Rentals are not open on this deployment/); assert.match(res.content[0].text, /RUNPOD_API_KEY/); } }); test("bad arguments are a tool error a model can read and fix, not a protocol error", async () => { const w = closedWorld(); for (const [name, args, say] of [ ["quote_rental", { gpu: "h100" }, /seconds is required/], ["quote_rental", { gpu: "gtx-1080", seconds: 60 }, /gpu must be one of rtx-4090/], ["quote_rental", { gpu: "h100", seconds: "sixty" }, /seconds must be an integer/], ["quote_rental", { gpu: "h100", seconds: 0 }, /seconds is out of range/], ["find_gpu", { prefer: "prettiest" }, /prefer must be one of cheapest, fastest, secure/], ["find_gpu", { budget: 3 }, /budget is not a parameter of this tool/], ["quote_nvda_credits", { amount: 1.5 }, /amount must be a string/], ["quote_nvda_credits", { amount: "lots" }, /amount is not in the expected form/], ["market", { verbose: true }, /verbose is not a parameter/], ]) { const r = await modern(w, "tools/call", { name, arguments: args }); assert.equal(r.status, 200, name); assert.deepEqual([r.body.result.isError, r.body.result.structuredContent.error], [true, "invalid"], name); assert.match(r.body.result.content[0].text, say); } // What the route itself refuses comes back the same way, with the route's own code. const far = await tool(w, "find_gpu", { minVram: 4000 }); assert.deepEqual([far.isError, far.structuredContent.error, far.structuredContent.constraints.minVram], [true, "no-offer", 4000]); assert.deepEqual(checkArguments(TOOLS[0].inputSchema, []), ["arguments must be an object"]); }); }); describe("the tools with the engine open (mock provider)", () => { async function keyed(w, usd = 10) { const user = await w.renter(usd); const key = (await w.call("POST", "/v1/api-keys", { token: user.token, body: { name: "agent", capUsdPerDay: 5 } })).body; return { user, key }; } test("without a key the account tools say how to connect; with a wrong one they are refused", async () => { const w = world(); const none = await tool(w, "get_balance"); assert.deepEqual([none.isError, none.structuredContent.error], [true, "unauthorized"]); assert.match(none.content[0].text, /Authorization: Bearer idk_/); const wrong = await tool(w, "get_balance", {}, { token: "idk_" + "b".repeat(43) }); assert.deepEqual([wrong.isError, wrong.structuredContent.error], [true, "unauthorized"]); assert.equal((await tool(w, "rental_status")).structuredContent.mode, "test"); }); test("an agent with a key reads its balance, rents, watches and ends, through the same engine as the API", async () => { const w = world(); const { user, key } = await keyed(w); const o = { token: key.secret }; const balance = await tool(w, "get_balance", {}, o); assert.equal(balance.isError, false); assert.deepEqual( { address: balance.structuredContent.address, creditsUsd: balance.structuredContent.creditsUsd, via: balance.structuredContent.via, cap: balance.structuredContent.apiKey.capUsdPerDay, spent: balance.structuredContent.apiKey.spentTodayUsd, sshKeys: balance.structuredContent.sshKeys, live: balance.structuredContent.liveInstances }, { address: user.address, creditsUsd: 10, via: "api-key", cap: 5, spent: 0, sshKeys: 1, live: 0 }, ); assert.equal(JSON.stringify(balance).includes(key.secret), false); const rented = await tool(w, "rent_gpu", { gpu: "rtx-4090" }, o); assert.equal(rented.isError, false, JSON.stringify(rented.structuredContent)); const id = rented.structuredContent.id; assert.deepEqual([rented.structuredContent.status, rented.structuredContent.gpu, rented.structuredContent.ratePerHourUsd, rented.structuredContent.apiKeyId], ["starting", "rtx-4090", 0.72, key.id]); assert.equal(w.livePods().length, 1); w.advance(30); let list = await tool(w, "list_instances", {}, o); assert.deepEqual(list.structuredContent.instances.map((i) => [i.id, i.status]), [[id, "running"]]); assert.match(list.structuredContent.instances[0].sshCommand, /^ssh root@127\.0\.0\.1 -p \d+$/); w.advance(100); list = await tool(w, "list_instances", {}, o); assert.deepEqual([list.structuredContent.instances[0].secondsBilled, list.structuredContent.instances[0].costUsd], [100, 0.02]); assert.equal((await tool(w, "get_balance", {}, o)).structuredContent.liveInstances, 1); const ended = await tool(w, "end_instance", { id }, o); assert.deepEqual([ended.isError, ended.structuredContent.type, ended.structuredContent.secondsBilled, ended.structuredContent.usd, ended.structuredContent.alreadyEnded], [false, "charge", 100, 0.02, false]); assert.deepEqual(w.livePods(), []); assert.equal((await tool(w, "end_instance", { id }, o)).structuredContent.alreadyEnded, true); // The wallet sees the same account through the API. const me = await w.me(user); assert.deepEqual([me.creditsUsd, me.instances[0].status, me.apiKeys[0].spentTodayUsd], [9.98, "ended", 0.02]); }); test("the engine's refusals reach the model as tool errors with their code", async () => { const w = world(); const { user, key } = await keyed(w, 0.05); const o = { token: key.secret }; const poor = await tool(w, "rent_gpu", { gpu: "rtx-4090" }, o); assert.deepEqual([poor.isError, poor.structuredContent.error, poor.structuredContent.neededUsd], [true, "insufficient-credits", 0.12]); assert.equal((await tool(w, "end_instance", { id: "i9999" }, o)).structuredContent.error, "not-found"); assert.equal((await tool(w, "rent_gpu", { gpu: "rtx-4090", sshKeyIds: [] }, o)).structuredContent.error, "invalid"); assert.equal(w.provider.calls.create, 0); // A stopped key is shut out of every account tool. await w.call("POST", `/v1/api-keys/${key.id}/stop`, { token: user.token }); assert.deepEqual([(await tool(w, "get_balance", {}, o)).structuredContent.error, (await tool(w, "rent_gpu", { gpu: "rtx-4090" }, o)).structuredContent.error], ["key-stopped", "key-stopped"]); // The wallet's own session works too: it is the same bearer scheme as the API. assert.equal((await tool(w, "get_balance", {}, { token: user.token })).structuredContent.via, "session"); }); test("find_gpu says a pick can be rented through Idle only on a live deployment, for a pick its provider serves", async () => { const test_ = await tool(world(), "find_gpu", { gpu: "rtx-4090", prefer: "secure" }); assert.deepEqual([test_.structuredContent.pick.source, test_.structuredContent.rentableThroughIdle], ["runpod", false]); }); }); describe("what is announced matches what is served", () => { test("/v1/health lists the tools and which of them work now; llms.txt names every one of them", async () => { const closed = (await closedWorld().call("GET", "/v1/health")).body; assert.deepEqual(closed.mcp, { path: "/mcp", transport: "streamable-http", protocolVersions: MCP_VERSIONS, tools: [...PUBLIC_TOOLS, ...ACCOUNT_TOOLS], openTools: PUBLIC_TOOLS }); const open = (await world().call("GET", "/v1/health")).body; assert.deepEqual(open.mcp.openTools, [...PUBLIC_TOOLS, ...ACCOUNT_TOOLS]); assert.deepEqual(TOOLS.map((t) => t.name), closed.mcp.tools); assert.deepEqual(TOOLS.filter((t) => t.account).map((t) => t.name), ACCOUNT_TOOLS); const llms = readFileSync(new URL("../site/llms.txt", import.meta.url), "utf8"); for (const t of TOOLS) assert.ok(llms.includes(`- ${t.name}:`), "llms.txt does not name " + t.name); for (const v of MCP_VERSIONS) assert.ok(llms.includes(v), "llms.txt does not name " + v); assert.ok(llms.includes("https://idle-elysium.vercel.app/api/mcp")); assert.equal(/[^\x00-\x7F]/.test(llms), false, "plain ASCII text"); }); });