Python 88.3%
TypeScript 7.6%
Shell 4.1%
1// MCP connector with the Node SDK beta namespace. STATUS: UNVERIFIED as a script (identical raw request LIVE_VERIFIED 2026-09-18, i1).2// Run: node --env-file=.env --experimental-strip-types examples/anthropic/mcp/mcp_connector.ts [https://your-public-host/mcp]3import Anthropic from "@anthropic-ai/sdk";4import { logRequest } from "../../shared/tool-loop/log.ts";5const client = new Anthropic();6const url = process.argv[2] ?? "https://mcp.deepwiki.com/mcp";7const resp: any = await client.beta.messages.create({8 model: "claude-haiku-4-5-20251001", max_tokens: 200, betas: ["mcp-client-2025-11-20"],9 mcp_servers: [{ type: "url", url, name: "srv" }],10 tools: [{ type: "mcp_toolset", mcp_server_name: "srv" }] as any,11 messages: [{ role: "user", content: url.includes("deepwiki") ? "Call read_wiki_structure for anthropics/anthropic-sdk-python and reply with only the first 3 topic names." : "Use the echo tool to echo PING." }],12});13logRequest("anthropic", "POST", "/v1/messages", 200, 0.003, "mcp_connector.ts");14console.log(resp.content.map((b: any) => ({ type: b.type, name: b.name, server_name: b.server_name, is_error: b.is_error, text: b.text?.slice(0, 200) })));15