From f582576517cdf433a07f8e424808e65c92d8f9ae Mon Sep 17 00:00:00 2001 From: Feon Sua Date: Fri, 5 Sep 2025 23:35:56 -0700 Subject: [PATCH] Exposes additional server information --- README.md | 10 ++++++++++ src/react/README.md | 3 +++ src/react/index.ts | 4 ++++ src/react/types.ts | 6 ++++++ src/react/useMcp.ts | 46 +++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b247654..d9f7076 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,9 @@ function MyAIComponent() { tools, // Available tools from MCP server resources, // Available resources from MCP server prompts, // Available prompts from MCP server + serverInfo, // Server name and version from initialize response + serverCapabilities, // Server capabilities from initialize response + protocolVersion,// Negotiated MCP protocol version error, // Error message if connection failed callTool, // Function to call tools on the MCP server readResource, // Function to read resource contents @@ -108,6 +111,10 @@ function MyAIComponent() { return (
+ {/* Show server information */} + {serverInfo && ( +

Connected to: {serverInfo.name} v{serverInfo.version}

+ )}

Available Tools: {tools.length}