From bc75b27e536d98ba217ceccb0cb75f664e76e1b1 Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Sun, 29 Dec 2024 00:25:24 +0100 Subject: [PATCH] docs(mcp) add class diagram --- mcp/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mcp/README.md b/mcp/README.md index 7851f21..a2745d2 100644 --- a/mcp/README.md +++ b/mcp/README.md @@ -42,6 +42,10 @@ The SDK follows a layered architecture with clear separation of concerns: - **Session Layer (McpSession)**: Manages communication patterns and state using DefaultMcpSession implementation. - **Client/Server Layer**: Both use McpSession for sync/async operations, with McpClient handling client-side protocol operations and McpServer managing server-side protocol operations. +Following class diagram illustrates the layered architecture of the MCP SDK, showing the relationships between core interfaces (McpTransport, McpSession), their implementations, and the client/server components. It highlights how the transport layer connects to sessions, which in turn support both synchronous and asynchronous client/server implementations. + + + ### Key Interactions - **Client/Server Initialization**: Transport setup, protocol compatibility check, capability negotiation, and implementation details exchange. @@ -50,6 +54,7 @@ The SDK follows a layered architecture with clear separation of concerns: - **Prompt System**: Discovery, parameter-based retrieval, change notifications, and content management. - **Tool Execution**: Discovery, parameter validation, timeout-aware execution, and result processing. + ## Client Usage Examples ### MCP Client (Sync API)