Skip to content

Commit c4f035d

Browse files
committed
chore: update readme
1 parent f5535e4 commit c4f035d

File tree

4 files changed

+49
-21
lines changed

4 files changed

+49
-21
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ MCP server can verify tokens issued by other systems, integrate with external id
408408
### OAuthProxy
409409
OAuthProxy enables authentication with OAuth providers that don’t support Dynamic Client Registration (DCR).It accepts any client registration request, handles the DCR on your server side and then uses your pre-registered app credentials upstream.The proxy also forwards callbacks, allowing dynamic redirect URIs to work with providers that require fixed ones.
410410

411-
> ⚠️ OAuthProxy support is still in developmentplease use RemoteAuthProvider for now.
411+
> ⚠️ OAuthProxy support is still in development, please use RemoteAuthProvider for now.
412412
413413

414414
## Macros
@@ -608,6 +608,9 @@ pub struct HyperServerOptions {
608608
/// Optional custom path for the MCP messages endpoint for sse (default: `/messages`)
609609
/// Applicable only if sse_support is true
610610
pub custom_messages_endpoint: Option<String>,
611+
612+
/// Optional authentication provider for protecting MCP server.
613+
pub auth: Option<Arc<dyn AuthProvider>>,
611614
}
612615

613616
```

crates/rust-mcp-sdk/README.md

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,35 @@ Leveraging the [rust-mcp-schema](https://github.com/rust-mcp-stack/rust-mcp-sche
2121
**rust-mcp-sdk** supports all three official versions of the MCP protocol.
2222
By default, it uses the **2025-06-18** version, but earlier versions can be enabled via Cargo features.
2323

24-
25-
26-
This project supports following transports:
27-
- **Stdio** (Standard Input/Output)
28-
- **Streamable HTTP**
29-
- **SSE** (Server-Sent Events)
30-
31-
3224
🚀 The **rust-mcp-sdk** includes a lightweight [Axum](https://github.com/tokio-rs/axum) based server that handles all core functionality seamlessly. Switching between `stdio` and `Streamable HTTP` is straightforward, requiring minimal code changes. The server is designed to efficiently handle multiple concurrent client connections and offers built-in support for SSL.
3325

3426

35-
**MCP Streamable HTTP Support**
36-
- ✅ Streamable HTTP Support for MCP Servers
27+
**Features**
28+
- ✅ Stdio, SSE and Streamable HTTP Support
29+
- ✅ Supports multiple MCP protocol versions
3730
- ✅ DNS Rebinding Protection
3831
- ✅ Batch Messages
3932
- ✅ Streaming & non-streaming JSON response
40-
- ✅ Streamable HTTP Support for MCP Clients
4133
- ✅ Resumability
42-
- ⬜ Oauth Authentication
34+
- ✅ OAuth Authentication for MCP Servers
35+
-[Remote Oauth Provider](crates/rust-mcp-sdk/src/auth/auth_provider/remote_auth_provider.rs) (for any provider with DCR support)
36+
-**Keycloak** Provider (via [rust-mcp-extra](crates/rust-mcp-extra/README.md#keycloak))
37+
-**WorkOS** Authkit Provider (via [rust-mcp-extra](crates/rust-mcp-extra/README.md#workos-authkit))
38+
-**Scalekit** Authkit Provider (via [rust-mcp-extra](crates/rust-mcp-extra/README.md#scalekit))
39+
- ⬜ OAuth Authentication for MCP Clients
4340

4441
**⚠️** Project is currently under development and should be used at your own risk.
4542

4643
## Table of Contents
44+
- [Getting Started](#getting-started)
4745
- [Usage Examples](#usage-examples)
4846
- [MCP Server (stdio)](#mcp-server-stdio)
4947
- [MCP Server (Streamable HTTP)](#mcp-server-streamable-http)
5048
- [MCP Client (stdio)](#mcp-client-stdio)
51-
- [MCP Client (Streamable HTTP)](#mcp-client_streamable-http))
49+
- [MCP Client (Streamable HTTP)](#mcp-client-streamable-http)
5250
- [MCP Client (sse)](#mcp-client-sse)
51+
- [Authentication](#authentication)
5352
- [Macros](#macros)
54-
- [Getting Started](#getting-started)
5553
- [HyperServerOptions](#hyperserveroptions)
5654
- [Security Considerations](#security-considerations)
5755
- [Cargo features](#cargo-features)
@@ -68,6 +66,12 @@ This project supports following transports:
6866
- [Development](#development)
6967
- [License](#license)
7068

69+
70+
## Getting Started
71+
72+
If you are looking for a step-by-step tutorial on how to get started with `rust-mcp-sdk` , please see : [Getting Started MCP Server](https://github.com/rust-mcp-stack/rust-mcp-sdk/tree/main/doc/getting-started-mcp-server.md)
73+
74+
7175
## Usage Examples
7276

7377
### MCP Server (stdio)
@@ -387,6 +391,26 @@ Creating an MCP client using the `rust-mcp-sdk` with the SSE transport is almost
387391
👉 see [examples/simple-mcp-client-sse](https://github.com/rust-mcp-stack/rust-mcp-sdk/tree/main/examples/simple-mcp-client-sse) for a complete working example.
388392

389393

394+
## Authentication
395+
MCP server can verify tokens issued by other systems, integrate with external identity providers, or manage the entire authentication process itself. Each option offers a different balance of simplicity, security, and control.
396+
397+
### RemoteAuthProvider
398+
[RemoteAuthProvider](src/mcp_http/auth/auth_provider/remote_auth_provider.rs) RemoteAuthProvider enables authentication with identity providers that support Dynamic Client Registration (DCR) such as KeyCloak and WorkOS AuthKit, letting MCP clients auto-register and obtain credentials without manual setup.
399+
400+
👉 See the [server-oauth-remote](examples/auth/server-oauth-remote) example for how to use RemoteAuthProvider with a DCR-capable remote provider.
401+
402+
👉 [rust-mcp-extra](https://crates.io/crates/rust-mcp-extra) also offers drop-in auth providers for common identity platforms, working seamlessly with rust-mcp-sdk:
403+
- [Keycloack auth example](crates/rust-mcp-extra/README.md#keycloak)
404+
- [WorkOS autn example](crates/rust-mcp-extra/README.md#workos-authkit)
405+
406+
407+
408+
### OAuthProxy
409+
OAuthProxy enables authentication with OAuth providers that don’t support Dynamic Client Registration (DCR).It accepts any client registration request, handles the DCR on your server side and then uses your pre-registered app credentials upstream.The proxy also forwards callbacks, allowing dynamic redirect URIs to work with providers that require fixed ones.
410+
411+
> ⚠️ OAuthProxy support is still in development, please use RemoteAuthProvider for now.
412+
413+
390414
## Macros
391415
[rust-mcp-sdk](https://github.com/rust-mcp-stack/rust-mcp-sdk) includes several helpful macros that simplify common tasks when building MCP servers and clients. For example, they can automatically generate tool specifications and tool schemas right from your structs, or assist with elicitation requests and responses making them completely type safe.
392416

@@ -495,10 +519,6 @@ let user_info = UserInfo::from_content_map(result.content)?;
495519
💻 For mre info please see :
496520
- https://github.com/rust-mcp-stack/rust-mcp-sdk/tree/main/crates/rust-mcp-macros
497521

498-
## Getting Started
499-
500-
If you are looking for a step-by-step tutorial on how to get started with `rust-mcp-sdk` , please see : [Getting Started MCP Server](https://github.com/rust-mcp-stack/rust-mcp-sdk/tree/main/doc/getting-started-mcp-server.md)
501-
502522
## HyperServerOptions
503523

504524
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.
@@ -588,6 +608,9 @@ pub struct HyperServerOptions {
588608
/// Optional custom path for the MCP messages endpoint for sse (default: `/messages`)
589609
/// Applicable only if sse_support is true
590610
pub custom_messages_endpoint: Option<String>,
611+
612+
/// Optional authentication provider for protecting MCP server.
613+
pub auth: Option<Arc<dyn AuthProvider>>,
591614
}
592615

593616
```

crates/rust-mcp-sdk/src/hyper_servers/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ pub struct HyperServerOptions {
102102
/// Optional custom path for the MCP messages endpoint for sse (default: `/messages`)
103103
/// Applicable only if sse_support is true
104104
pub custom_messages_endpoint: Option<String>,
105+
106+
/// Optional authentication provider for protecting MCP server.
105107
#[cfg(feature = "auth")]
106108
pub auth: Option<Arc<dyn AuthProvider>>,
107109
}

crates/rust-mcp-sdk/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ pub fn valid_initialize_method(json_str: &str) -> SdkResult<()> {
243243

244244
#[cfg(feature = "auth")]
245245
pub fn join_url(base: &Url, segment: &str) -> Result<Url, url::ParseError> {
246-
// Fast early check Url must be absolute
246+
// Fast early check - Url must be absolute
247247
if base.cannot_be_a_base() {
248248
return Err(url::ParseError::RelativeUrlWithoutBase);
249249
}
250250

251-
// We have to clone there is no way around this when taking &Url
251+
// We have to clone - there is no way around this when taking &Url
252252
let mut url = base.clone();
253253

254254
// This is the official, safe, and correct way

0 commit comments

Comments
 (0)