MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildTransport

Method buildTransport

src/mcp/client.ts:173–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171 }
172
173 private buildTransport(): Transport {
174 const cfg = this.config as any;
175 if (cfg.url) {
176 const opts = {
177 url: cfg.url,
178 headers: this.expandHeaders(cfg.headers ?? {}),
179 connectTimeoutMs: (this.config.startupTimeoutSeconds ?? 10) * 1000,
180 };
181 // Opt-in modern transport for streamable-HTTP servers (Tavily, Higgsfield, …)
182 // that hang on the older SSE endpoint-event handshake. Set `streamable: true`.
183 return cfg.streamable ? new StreamableHttpTransport(opts) : new HttpSseTransport(opts);
184 }
185 return new StdioTransport({
186 command: this.config.command!,
187 args: this.config.args ?? [],
188 env: this.expandEnv(this.config.env ?? {}),
189 });
190 }
191
192 private handleMessage(msg: any): void {
193 if (msg.jsonrpc !== '2.0') {

Callers 1

startMethod · 0.95

Calls 2

expandHeadersMethod · 0.95
expandEnvMethod · 0.95

Tested by

no test coverage detected