MCPcopy Create free account
hub / github.com/vercel/examples / main

Function main

starter/mcp-api-wrapper/scripts/test-streamable-http-client.mjs:6–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4const origin = process.argv[2] || "https://mcp-on-vercel.vercel.app";
5
6async function main() {
7 const transport = new StreamableHTTPClientTransport(new URL(`${origin}/mcp`));
8
9 const client = new Client(
10 {
11 name: "example-client",
12 version: "1.0.0",
13 },
14 {
15 capabilities: {
16 prompts: {},
17 resources: {},
18 tools: {},
19 },
20 }
21 );
22
23 await client.connect(transport);
24
25 console.log("Connected", client.getServerCapabilities());
26
27 const result = await client.listTools();
28 console.log(result);
29}
30
31main();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected