Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/rmcp/src/transport/common/client_side_sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ impl<R: SseStreamReconnect> SseAutoReconnectStream<R> {
}

impl<E: std::error::Error + Send> SseAutoReconnectStream<NeverReconnect<E>> {
pub fn never_reconnect(stream: BoxedSseResponse, error_when_reconnect: E) -> Self {
#[allow(dead_code)]
pub(crate) fn never_reconnect(stream: BoxedSseResponse, error_when_reconnect: E) -> Self {
Self {
retry_policy: Arc::new(NeverRetry),
last_event_id: None,
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp/src/transport/common/server_side_http.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::{convert::Infallible, fmt::Display, sync::Arc, time::Duration};

use bytes::{Buf, Bytes};
Expand Down
12 changes: 8 additions & 4 deletions crates/rmcp/tests/test_with_python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async fn init() -> anyhow::Result<()> {
.with(tracing_subscriber::fmt::layer())
.try_init();
tokio::process::Command::new("uv")
.args(["pip", "install", "-r", "pyproject.toml"])
.args(["sync"])
.current_dir("tests/test_with_python")
.spawn()?
.wait()
Expand All @@ -38,8 +38,9 @@ async fn test_with_python_client() -> anyhow::Result<()> {

let status = tokio::process::Command::new("uv")
.arg("run")
.arg("tests/test_with_python/client.py")
.arg("client.py")
.arg(format!("http://{BIND_ADDRESS}/sse"))
.current_dir("tests/test_with_python")
.spawn()?
.wait()
.await?;
Expand Down Expand Up @@ -88,8 +89,9 @@ async fn test_nested_with_python_client() -> anyhow::Result<()> {
tokio::time::Duration::from_secs(5),
tokio::process::Command::new("uv")
.arg("run")
.arg("tests/test_with_python/client.py")
.arg("client.py")
.arg(format!("http://{BIND_ADDRESS}/nested/sse"))
.current_dir("tests/test_with_python")
.spawn()?
.wait(),
)
Expand All @@ -104,7 +106,9 @@ async fn test_with_python_server() -> anyhow::Result<()> {
init().await?;

let transport = TokioChildProcess::new(tokio::process::Command::new("uv").configure(|cmd| {
cmd.arg("run").arg("tests/test_with_python/server.py");
cmd.arg("run")
.arg("server.py")
.current_dir("tests/test_with_python");
}))?;

let client = ().serve(transport).await?;
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp/tests/test_with_python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.lock
4 changes: 2 additions & 2 deletions crates/rmcp/tests/test_with_python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ name = "test_with_python"
version = "0.1.0"
description = "Test Python client for RMCP"
dependencies = [
"mcp",
"fastmcp",
]

[tool.setuptools]
py-modules = ["client", "server"]
py-modules = ["client", "server"]
2 changes: 1 addition & 1 deletion crates/rmcp/tests/test_with_python/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mcp.server.fastmcp import FastMCP
from fastmcp import FastMCP

mcp = FastMCP("Demo")

Expand Down
22 changes: 21 additions & 1 deletion docs/CONTRIBUTE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,24 @@ just fix
# How Can I Rewrite My Commit Message?
You can `git reset --soft upstream/main` and `git commit --forge`, this will merge your changes into one commit.

Or you also can use git rebase. But we will still merge them into one commit when it is merged.
Or you also can use git rebase. But we will still merge them into one commit when it is merged.

# Check Code Coverage
If you are developing on vscode, you can use vscode plugin [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters)

And also need to install llvm-cov
```sh
cargo install cargo-llvm-cov

rustup component add llvm-tools-preview
```

If you are using goverage gutters plugin, add these config to let it know lcov output.
```json
{
"coverage-gutters.coverageFileNames": [
"coverage.lcov",
],
"coverage-gutters.coverageBaseDir": "target/llvm-cov-target",
}
```
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ fix: fmt
cargo clippy --fix --all-targets --all-features --allow-staged

test:
cargo test --all-features
cargo test --all-features

cov:
cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov
Loading