Add MCP sampling diagram

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov
2025-03-26 18:26:41 +01:00
parent b8fb18b5e7
commit 77b973ff14
3 changed files with 119 additions and 0 deletions

View File

@@ -66,6 +66,8 @@ The MCP Sampling workflow in these examples follows these steps:
- The server combines the responses from different LLMs
- It returns the combined result to the user
![MCP Sampling Sequence Diagram](./mvc-sampling-sq.svg)
## Server Implementation
The MCP Weather Server implements the server-side of MCP Sampling:

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,54 @@
@startuml
skinparam sequenceArrowThickness 2
skinparam roundcorner 10
skinparam sequenceParticipant {
BackgroundColor #222222
BorderColor #222222
FontColor white
}
skinparam sequenceLifeLineBorderColor #AAAAAA
skinparam sequenceGroupFontColor white
participant "MCP Server" as Server
participant "MCP Client" as Client
participant "LLM" as LLM
group Initialization
Client -> Server: Initialization Request
activate Client
activate Server
Server --> Client: Initialization Response
deactivate Server
Client -\ Server: Initializated
deactivate Client
end
group Inside an Existing Client Invocation
Client -> Server: Tool/Prompt/Resource Request
activate Client
activate Server
group Sampling
Server -> Client: sampling/createMessage
activate Client
group Model interaction
Client -> LLM: Forward sampling request
activate LLM
LLM --> Client: Return generation
deactivate LLM
end
Client --> Server: Return generation
deactivate Client
end
Server --> Client: Tool/Prompt/Resource Response
deactivate Server
deactivate Client
end
@enduml