-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes