Skip to content

Commit 0a6d333

Browse files
committed
Merge branch 'main' into set-oauth-creds
2 parents 43939ec + 52c0651 commit 0a6d333

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

crates/rmcp/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ base64 = { version = "0.21", optional = true }
3737
reqwest = { version = "0.12", default-features = false, features = [
3838
"json",
3939
"stream",
40-
"rustls-tls",
4140
], optional = true }
4241
sse-stream = { version = "0.1.3", optional = true }
4342
url = { version = "2.4", optional = true }
@@ -62,7 +61,9 @@ default = ["base64", "macros", "server"]
6261
client = []
6362
server = ["transport-async-rw", "dep:schemars"]
6463
macros = ["dep:rmcp-macros", "dep:paste"]
65-
transport-sse = ["dep:reqwest", "dep:sse-stream", "dep:url"]
64+
__transport-sse = ["dep:reqwest", "dep:sse-stream", "dep:url"]
65+
transport-sse = ["__transport-sse", "reqwest?/rustls-tls"]
66+
transport-sse-tls-no-provider = ["__transport-sse", "reqwest?/rustls-tls-no-provider"]
6667
transport-async-rw = ["tokio/io-util", "tokio-util/codec"]
6768
transport-io = ["transport-async-rw", "tokio/io-std"]
6869
transport-child-process = ["transport-async-rw", "tokio/process"]
@@ -74,7 +75,9 @@ transport-sse-server = [
7475
]
7576
# transport-ws = ["transport-io", "dep:tokio-tungstenite"]
7677
tower = ["dep:tower-service"]
77-
auth = ["dep:oauth2", "dep:reqwest", "dep:url"]
78+
__auth = ["dep:oauth2", "dep:reqwest", "dep:url"]
79+
auth = ["__auth", "reqwest?/rustls-tls"]
80+
auth-tls-no-provider = ["auth", "reqwest?/rustls-tls-no-provider"]
7881

7982
[dev-dependencies]
8083
tokio = { version = "1", features = ["full"] }

crates/rmcp/src/model/tool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub struct Tool {
1818
pub description: Option<Cow<'static, str>>,
1919
/// A JSON Schema object defining the expected parameters for the tool
2020
pub input_schema: Arc<JsonObject>,
21+
#[serde(skip_serializing_if = "Option::is_none")]
2122
/// Optional additional tool information.
2223
pub annotations: Option<ToolAnnotations>,
2324
}

crates/rmcp/src/transport.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ pub mod io;
5151
#[cfg(feature = "transport-io")]
5252
pub use io::stdio;
5353

54-
#[cfg(feature = "transport-sse")]
54+
#[cfg(feature = "__transport-sse")]
5555
pub mod sse;
56-
#[cfg(feature = "transport-sse")]
56+
#[cfg(feature = "__transport-sse")]
5757
pub use sse::SseTransport;
5858

59-
#[cfg(all(feature = "transport-sse", feature = "auth"))]
59+
#[cfg(all(feature = "__transport-sse", feature = "__auth"))]
6060
pub mod sse_auth;
61-
#[cfg(all(feature = "transport-sse", feature = "auth"))]
61+
#[cfg(all(feature = "__transport-sse", feature = "__auth"))]
6262
pub use sse_auth::{AuthorizedSseClient, create_authorized_transport};
6363

6464
// #[cfg(feature = "tower")]
@@ -69,9 +69,9 @@ pub mod sse_server;
6969
#[cfg(feature = "transport-sse-server")]
7070
pub use sse_server::SseServer;
7171

72-
#[cfg(feature = "auth")]
72+
#[cfg(feature = "__auth")]
7373
pub mod auth;
74-
#[cfg(feature = "auth")]
74+
#[cfg(feature = "__auth")]
7575
pub use auth::{AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient};
7676

7777
// #[cfg(feature = "transport-ws")]

crates/rmcp/tests/test_with_js/client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
22
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
33

4-
const transport = new SSEClientTransport( new URL(`http://127.0.0.1:8000/sse`));
4+
const transport = new SSEClientTransport(new URL(`http://127.0.0.1:8000/sse`));
55

66
const client = new Client(
77
{
@@ -26,3 +26,4 @@ console.log(templates);
2626
const prompts = await client.listPrompts();
2727
console.log(prompts);
2828
await client.close();
29+
await transport.close();

crates/rmcp/tests/test_with_js/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ server.tool(
3232
);
3333

3434
const transport = new StdioServerTransport();
35-
await server.connect(transport);
35+
await server.connect(transport);

0 commit comments

Comments
 (0)