You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an MCP server in `rust-mcp-sdk` allows multiple clients to connect simultaneously with no additional setup.
167
-
The setup is nearly identical to the stdio example shown above. You only need to create a Hyper server via `hyper_server::create_server()`and pass in the same handler and `HyperServerOptions`.
167
+
The setup is nearly identical to the stdio example shown above. You only need to install the `rust-mcp-axum` crate and use `create_axum_server()`with `AxumServerOptions`.
168
168
169
-
💡 If backward compatibility is required, you can enable **SSE** transport by setting `sse_support` to true in `HyperServerOptions`.
169
+
💡 If backward compatibility is required, you can enable **SSE** transport by setting `sse_support` to true in `AxumServerOptions`.
@@ -442,20 +443,20 @@ MCP server can verify tokens issued by other systems, integrate with external id
442
443
443
444
444
445
445
-
## HyperServerOptions
446
+
## AxumServerOptions
446
447
447
-
HyperServer is a lightweight Axum-based server that streamlines MCP servers by supporting **Streamable HTTP** and **SSE** transports. It supports simultaneous client connections, internal session management, and includes built-in security features like DNS rebinding protection and more.
448
+
AxumServer is a lightweight Axum-based server provided by the `rust-mcp-axum` crate that streamlines MCP servers by supporting **Streamable HTTP** and **SSE** transports. It supports simultaneous client connections, internal session management, and includes built-in security features like DNS rebinding protection and more.
448
449
449
-
HyperServer is highly customizable through HyperServerOptions provided during initialization.
450
+
AxumServer is highly customizable through AxumServerOptions provided during initialization.
450
451
451
-
A typical example of creating a HyperServer that exposes the MCP server via Streamable HTTP and SSE transports at:
452
+
A typical example of creating an AxumServer that exposes the MCP server via Streamable HTTP and SSE transports at:
@@ -468,7 +469,7 @@ let server = hyper_server::create_server(
468
469
server.start().await?;
469
470
```
470
471
471
-
📝 Refer to [HyperServerOptions](https://github.com/rust-mcp-stack/rust-mcp-sdk/blob/main/crates/rust-mcp-sdk/src/hyper_servers/server.rs#L43) for a complete overview of HyperServerOptions attributes and options.
472
+
📝 Refer to [AxumServerOptions](https://github.com/rust-mcp-stack/rust-mcp-sdk/blob/main/crates/rust-mcp-axum/src/server.rs#L43) for a complete overview of AxumServerOptions attributes and options.
472
473
473
474
474
475
### Security Considerations
@@ -488,8 +489,6 @@ The `rust-mcp-sdk` crate provides several features that can be enabled or disabl
488
489
489
490
-`server`: Activates MCP server capabilities in `rust-mcp-sdk`, providing modules and APIs for building and managing MCP servers.
490
491
-`client`: Activates MCP client capabilities, offering modules and APIs for client development and communicating with MCP servers.
491
-
-`hyper-server`: This feature is necessary to enable `Streamable HTTP` or `Server-Sent Events (SSE)` transports for MCP servers. It must be used alongside the server feature to support the required server functionalities.
492
-
-`ssl`: This feature enables TLS/SSL support for the `Streamable HTTP` or `Server-Sent Events (SSE)` transport when used with the `hyper-server`.
493
492
-`macros`: Provides procedural macros for simplifying the creation and manipulation of MCP Tool structures.
494
493
-`sse`: Enables support for the `Server-Sent Events (SSE)` transport.
495
494
-`streamable-http`: Enables support for the `Streamable HTTP` transport.
@@ -520,7 +519,7 @@ If you only need the MCP Server functionality, you can disable the default featu
520
519
[dependencies]
521
520
rust-mcp-sdk = { version = "0.2.0", default-features = false, features = ["server","macros","stdio"] }
522
521
```
523
-
Optionally add `hyper-server` and `streamable-http` for **Streamable HTTP** transport, and `ssl` feature for tls/ssl support of the `hyper-server`
522
+
Optionally add [`rust-mcp-axum`](https://crates.io/crates/rust-mcp-axum) and the `streamable-http`feature for **Streamable HTTP** transport, and use `rust-mcp-axum`'s `ssl` feature for TLS/SSL support.
524
523
525
524
<!-- x-release-please-end -->
526
525
@@ -557,11 +556,11 @@ Learn when to use the `mcp_*_handler` traits versus the lower-level `mcp_*_hand
557
556
558
557
- For `ServerHandler`:
559
558
- Use `server_runtime::create_server()` for servers with stdio transport
560
-
- Use `hyper_server::create_server()` for servers with sse transport
559
+
- Use `rust_mcp_axum::create_axum_server()` for servers with Streamable HTTP/SSE transport
561
560
562
561
- For `ServerHandlerCore`:
563
562
- Use `server_runtime_core::create_server()` for servers with stdio transport
564
-
- Use `hyper_server_core::create_server()` for servers with sse transport
563
+
- Use `rust_mcp_axum::create_axum_server()` for servers with Streamable HTTP/SSE transport
565
564
566
565
---
567
566
@@ -609,13 +608,13 @@ While not part of the official MCP spec, `rust-mcp-sdk` provides an optional HTT
The health check endpoint is disabled by default. You can enable it and optionally provide your own custom handler (to return specific metrics or metadata) via `HyperServerOptions`:
611
+
The health check endpoint is disabled by default. You can enable it and optionally provide your own custom handler (to return specific metrics or metadata) via `AxumServerOptions`:
613
612
614
613
```rs
615
-
letserver=hyper_server::create_server(
614
+
letserver=create_axum_server(
616
615
server_details,
617
616
handler.to_mcp_server_handler(),
618
-
HyperServerOptions {
617
+
AxumServerOptions {
619
618
host:"127.0.0.1".into(),
620
619
health_endpoint:Some("/health".into()), // enables the endpoint
621
620
health_handler:Some(Arc::new(CustomHealth {})), // optional: overrides default 200 OK
0 commit comments