Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Two rmcp tests fail on Windows: connection-refused text check and `npm` spawn in test_with_js

オープン
#1,364 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@bolinfest がすでに取り組んでいます。

2026年10月15日 から。

評価

この issue はまだ評価されていません。

説明

bug P2 ready for work T-test

Describe the bug
I ran rmcp's tests on Windows (CI only runs Linux). Two tests fail there. Both problems are in the tests; the SDK code behaves correctly.

  1. transport::auth::tests::default_http_client_preserves_connection_failure_cause (lib, --all-features) checks for the English text connection refused. Windows describes a refused connection differently, so the assertion fails although the error chain is correct:

    unexpected discovery error: Metadata error: OAuth metadata discovery failed for http://127.0.0.1:34350/mcp
      Caused by: error sending request for url (http://127.0.0.1:34350/mcp)
      Caused by: client error (Connect)
      Caused by: tcp connect error
      Caused by: No connection could be made because the target machine actively refused it. (os error 10061)
    
  2. All three test_with_js tests (no-local feature set) fail with Error: program not found. install_js_dependencies runs Command::new("npm"), but on Windows npm is the shim npm.cmd, and Command doesn't resolve a bare name to a .cmd file. (node is node.exe, so the other spawns work.)

To Reproduce
On Windows 11 with rustc 1.96 (the version rust-toolchain.toml pins), Node 24 and uv:

  1. cargo test -p rmcp --all-features --lib default_http_client_preserves_connection_failure_cause
  2. cargo test -p rmcp --features "<all rmcp features except local, as in CI>" --test test_with_js

Expected behavior
Both pass, as they do on Linux.

Proposed fix (test-only, 8 lines added, 3 removed)

  • auth test: before the request, connect to the same dropped address with std::net::TcpStream::connect(addr), and assert that the reason contains that error's to_string(). That way the test expects whatever text the OS uses, instead of a hard-coded English phrase.
  • test_with_js: let npm = if cfg!(windows) { "npm.cmd" } else { "npm" };. Another option is to dogfood rmcp::transport::which_command("npm"), but then which-command has to be added to the test's required-features.

Patch: https://github.com/modelcontextprotocol/rust-sdk/compare/main...RafalOfficial:rust-sdk:fix/windows-test-portability. With it, both tests pass on Windows. These all pass unchanged on Windows: the other 606 lib tests, test_with_python, test_stdio_response_concurrency, test_close_connection and test_async_rw_max_line_length. The patch is formatted with cargo +nightly fmt. If you're happy with this, I can open the PR. If you don't want Windows-only test fixes while CI is Linux-only, just close this.

Additional context
Main at 8d226f4. This report and the proposed patch were written with Claude Code (AI-assisted). I ran the commands above on a real Windows machine.

主要言語
Rust
スター
4k
フォーク
662
平均マージ
3日 20時間
マージ済み PR(30日)
30

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/rust-sdk のほかの issue

modelcontextprotocol/rust-sdk の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。