MCP servers
Testing a Model Context Protocol server is a request like any other, over Streamable HTTP or stdio.
### DeepWiki
MCP https://mcp.deepwiki.com/mcp
# or: MCP stdio: node build/index.js
> assert server.serverInfo.name == "DeepWiki"
> assert toolNames contains "read_wiki_structure"
> let topics = call("read_wiki_structure", { repoName: "modelcontextprotocol/modelcontextprotocol" })
> assert !topics.isError
> assert read("docs://readme").text != ""
> assert getPrompt("summarize", { topic: "tests" }).messages.length > 0
After the handshake the script has server, tools, toolNames, resources, resourceTemplates, prompts, promptNames and notifications, and the functions call, read, getPrompt, ping, request and notify. @sampling, @elicitation and @roots answer what the server asks the client, so a server that wants a model completion can be tested without a model.
In the app: an MCP request gets an inspector listing Tools, Resources, Prompts and every Message in both directions, with a form for calling a tool and a Save as Test button that writes the call into the file.
