Skip to content

Commit 58f2e0d

Browse files
committed
feat: Show initialize request/response in History panel (#269)
- Add logging for initialize request and response in useConnection.connect - Include server capabilities, version, and instructions in history
1 parent 3032a67 commit 58f2e0d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

client/src/lib/hooks/useConnection.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,19 @@ export function useConnection({
314314
);
315315
}
316316

317+
let capabilities;
317318
try {
318319
await client.connect(clientTransport);
320+
321+
capabilities = client.getServerCapabilities();
322+
const initializeRequest = {
323+
method: "initialize",
324+
};
325+
pushHistory(initializeRequest, {
326+
capabilities,
327+
serverInfo: client.getServerVersion(),
328+
instructions: client.getInstructions(),
329+
});
319330
} catch (error) {
320331
console.error(
321332
`Failed to connect to MCP Server via the MCP Inspector Proxy: ${mcpProxyServerUrl}:`,
@@ -332,8 +343,6 @@ export function useConnection({
332343
}
333344
throw error;
334345
}
335-
336-
const capabilities = client.getServerCapabilities();
337346
setServerCapabilities(capabilities ?? null);
338347
setCompletionsSupported(true); // Reset completions support on new connection
339348

0 commit comments

Comments
 (0)