MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / connect

Method connect

src/server/mcp.ts:111–113  ·  view source on GitHub ↗

* Attaches to the given transport, starts it, and starts listening for messages. * * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.

(transport: Transport)

Source from the content-addressed store, hash-verified

109 * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
110 */
111 async connect(transport: Transport): Promise<void> {
112 return await this.server.connect(transport);
113 }
114
115 /**
116 * Closes the connection.

Callers 5

createTestServerFunction · 0.95
createTestAuthServerFunction · 0.95
createStatelessHandlerFunction · 0.95
createTestServerWithSseFunction · 0.95

Calls

no outgoing calls

Tested by 5

createTestServerFunction · 0.76
createTestAuthServerFunction · 0.76
createStatelessHandlerFunction · 0.76
createTestServerWithSseFunction · 0.76