import { MCPClientManager } from "@mcpjam/sdk";const manager = new MCPClientManager({ everything: { command: "npx", args: ["-y", "@modelcontextprotocol/server-everything"], },});await manager.connectToServer("everything");// List available toolsconst tools = await manager.listTools("everything");console.log("Tools:", tools.tools.map((t) => t.name));
@modelcontextprotocol/server-everything is a reference MCP server with sample tools like add, echo, and longRunningOperation.
If you’re connecting to an OAuth-protected HTTP server and already have a refresh token, pass refreshToken and clientId instead of a static access token:
const result = await agent.run("What is 15 plus 27?");console.log("Response:", result.getText());console.log("Tools called:", result.toolsCalled());console.log("Arguments:", result.getToolArguments("add"));console.log("Latency:", result.e2eLatencyMs(), "ms");
You can also generate eval code directly from the MCPJam Inspector:
Connect your MCP server in the Inspector
Click the ⋮ menu on the server card
Select Copy markdown for evals
Paste the copied markdown into an LLM (Claude, ChatGPT, etc.)
The LLM will generate eval test code using @mcpjam/sdk
The copied markdown is a ready-to-use prompt that includes your server’s capabilities and the full @mcpjam/sdk API reference, so the LLM has everything it needs to write your eval tests.
To save results to the MCPJam Evals dashboard, set MCPJAM_API_KEY to an MCPJam API key (sk_…) from Settings → API keys and add a mcpjam: { suiteName: "…" } block to run(). The retired project API keys (mcpjam_…) no longer work — see Saving Results.