-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
To Reproduce
Steps to reproduce the behavior:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { log } from "console";
const client = new Client(
{
name: "comate",
version: "1.0.0",
},
{
capabilities: {},
},
);
const transport = new StreamableHTTPClientTransport(
new URL("https://api.githubcopilot.com/mcp/"),
{
requestInit: {
headers: {
Authorization: "Bearer xxx",
},
},
},
);
client.onclose = () => {
log(`close`);
};
client.onerror = (e) => {
log(`error: ${e.message}`);
};
await client.connect(transport);
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
await client.close()
run this code, will occur these log below
close
error: The operation was aborted.
error: The operation was aborted.
Expected behavior
only call onerror for once
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working