Merge branch 'main' of https://github.com/modelcontextprotocol/inspector into meta_properies_in_tools
This commit is contained in:
commit
c0b3b952f5
1 changed files with 197 additions and 20 deletions
|
|
@ -59,6 +59,7 @@ import { getMCPServerRequestTimeout } from "@/utils/configUtils";
|
|||
import { InspectorConfig } from "../configurationTypes";
|
||||
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
||||
import { CustomHeaders } from "../types/customHeaders";
|
||||
import { resolveRefsInMessage } from "@/utils/schemaUtils";
|
||||
|
||||
interface UseConnectionOptions {
|
||||
transportType: "stdio" | "sse" | "streamable-http";
|
||||
|
|
@ -711,6 +712,14 @@ export function useConnection({
|
|||
|
||||
await client.connect(transport as Transport);
|
||||
|
||||
const protocolOnMessage = transport.onmessage;
|
||||
if (protocolOnMessage) {
|
||||
transport.onmessage = (message) => {
|
||||
const resolvedMessage = resolveRefsInMessage(message);
|
||||
protocolOnMessage(resolvedMessage);
|
||||
};
|
||||
}
|
||||
|
||||
setClientTransport(transport);
|
||||
|
||||
capabilities = client.getServerCapabilities();
|
||||
|
|
|
|||
Loading…
Reference in a new issue