Skip to content

Commit f8a747e

Browse files
authored
chore(example): add example in progress (#271)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
1 parent 271cf0b commit f8a747e

File tree

8 files changed

+726
-2
lines changed

8 files changed

+726
-2
lines changed

examples/clients/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ url = "2.4"
2828
tower = "0.5"
2929
axum = "0.8"
3030
reqwest = "0.12"
31+
clap = { version = "4.0", features = ["derive"] }
3132

3233
[[example]]
3334
name = "clients_sse"
@@ -56,3 +57,8 @@ path = "src/auth/oauth_client.rs"
5657
[[example]]
5758
name = "clients_sampling_stdio"
5859
path = "src/sampling_stdio.rs"
60+
61+
62+
[[example]]
63+
name = "clients_progress_client"
64+
path = "src/progress_client.rs"

examples/clients/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This directory contains Model Context Protocol (MCP) client examples implemented
44

55
## Example List
66

7+
78
### SSE Client (`sse.rs`)
89

910
A client that communicates with an MCP server using Server-Sent Events (SSE) transport.
@@ -67,6 +68,16 @@ A client demonstrating how to use the sampling tool.
6768
- Retrieves server information and list of available tools
6869
- Calls the `ask_llm` tool
6970

71+
### Progress Test Client (`progress_test_client.rs`)
72+
73+
A client that communicates with an MCP server using progress notifications.
74+
75+
- Launches the `cargo run --example clients_progress_client -- --transport {stdio|sse|http|all}` to test the progress notifications
76+
- Connects to the server using different transport methods
77+
- Tests the progress notifications
78+
- The sse and http should run the server first
79+
80+
7081
## How to Run
7182

7283
Each example can be run using Cargo:

0 commit comments

Comments
 (0)