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.prompt("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 server 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.If you have a MCPJAM_API_KEY set up, the generated eval code will automatically save results to MCPJam — you can view them in the Evals tab of the Inspector. Go to Settings > Workspace API Key in the Inspector to get your key.