Skip to content

Commit 071503d

Browse files
committed
improve diagrams
1 parent 9678258 commit 071503d

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

exercises/01.ping/README.mdx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,52 @@ connection by spawning a new process and then use STDIO to communicate with it.
2525
keep things simple and not much changes in this workshop by using `stdio`.
2626
</callout-info>
2727

28+
## MCP Initialization
29+
30+
Here's what happens when the client initializes the session with the server:
31+
32+
```mermaid
33+
sequenceDiagram
34+
participant Host
35+
participant Client
36+
participant Server
37+
38+
Host->>+Client: Initialize client
39+
Client->>+Server: Initialize session with capabilities
40+
Server-->>Client: Respond with supported capabilities
41+
42+
Note over Host,Server: Active Session with Negotiated Features
43+
44+
loop Client Requests
45+
Host->>Client: User- or model-initiated action
46+
Client->>Server: Request (tools/resources)
47+
Server-->>Client: Response
48+
Client-->>Host: Update UI or respond to model
49+
end
50+
51+
loop Server Requests
52+
Server->>Client: Request (sampling)
53+
Client->>Host: Forward to AI
54+
Host-->>Client: AI response
55+
Client-->>Server: Response
56+
end
57+
58+
loop Notifications
59+
Server--)Client: Resource updates
60+
Client--)Server: Status changes
61+
end
62+
63+
Host->>Client: Terminate
64+
Client->>-Server: End session
65+
deactivate Server
66+
```
67+
68+
<callout-success>
69+
This is all handled by the MCP SDK automatically. Once you set up your server
70+
and connect it to a transport, the SDK will handle the initialization and
71+
negotiation of capabilities.
72+
</callout-success>
73+
2874
## MCP `ping`
2975

3076
```mermaid
@@ -35,6 +81,11 @@ sequenceDiagram
3581
Server-->>Client: JSON-RPC Response {"result": {}}
3682
```
3783

84+
<callout-success>
85+
The MCP SDK handles the ping request for you. Just get the server set up with
86+
a transport and you're good to go.
87+
</callout-success>
88+
3889
A "ping" is a common concept in protocol design. It's a simple request to check
3990
if a connection is working. In this exercise, we'll implement a `ping` tool
4091
for our MCP server.

exercises/05.sampling/README.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ sequenceDiagram
3636
Client->>App: Request permission for sampling
3737
App->>User: Request permission for sampling
3838
alt User approves
39-
App->>Client: Permission granted
40-
Client->>LLM: Forward sampling request
41-
LLM-->>Client: Generation (completion)
39+
App->>LLM: Forward sampling request
40+
LLM-->>App: Generation (completion)
41+
App-->>Client: Sampling result
4242
Client-->>Server: Sampling result
4343
else User rejects
4444
App->>Client: Permission denied

0 commit comments

Comments
 (0)