fix: use SDK Transport type to satisfy client.connect() signature

This commit is contained in:
dhananjai1729
2026-03-19 17:50:33 +05:30
committed by Peter Steinberger
parent bf8303370e
commit 6fda8b4e9a

View File

@@ -2,6 +2,7 @@ import type { AgentToolResult } from "@mariozechner/pi-agent-core";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import type { OpenClawConfig } from "../config/config.js";
import { logDebug, logWarn } from "../logger.js";
@@ -18,15 +19,10 @@ type BundleMcpToolRuntime = {
dispose: () => Promise<void>;
};
/** Minimal interface shared by StdioClientTransport and SSEClientTransport. */
type McpTransport = {
close: () => Promise<void>;
};
type BundleMcpSession = {
serverName: string;
client: Client;
transport: McpTransport;
transport: Transport;
detachStderr?: () => void;
};
@@ -131,7 +127,7 @@ function resolveTransport(
serverName: string,
rawServer: unknown,
): {
transport: McpTransport;
transport: Transport;
description: string;
detachStderr?: () => void;
} | null {