rust-sdk/crates/rmcp/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Will Pfleger ee1c63c53f
feat(transport): add Unix domain socket client for streamable HTTP (#749)
* feat(transport): add Unix domain socket client for streamable HTTP

MCP hosts in Kubernetes environments with Envoy sidecars need to route
HTTP through Unix domain sockets because DNS-based URIs only resolve
via the proxy. Adds UnixSocketHttpClient implementing StreamableHttpClient
using hyper over tokio::net::UnixStream, gated behind the
transport-streamable-http-client-unix-socket feature.

Also extracts RESERVED_HEADERS, extract_scope_from_header, and
validate_custom_header into common/http_header.rs to share header
validation logic between the reqwest and unix socket implementations.

* fix(transport): address review feedback for unix socket transport

- Document one-connection-per-request behavior on UnixSocketHttpClient
- Reject empty socket paths and bare '@' in constructor with assert
- Add explicit dep:http to unix-socket feature for self-documenting deps
- Document MCP-Protocol-Version exception on RESERVED_HEADERS constant
- Fix test catch-all to echo request id instead of hardcoding 1
- Remove leftover sleep(100ms) in test_unix_socket_custom_headers
- Add blank line before macro comment in Cargo.toml

* fix(transport): fix CI failures for unix socket transport

- Use std::io::Error::other() instead of Error::new(ErrorKind::Other)
  to satisfy clippy::io_other_error on newer nightly
- Use #[tokio::test(flavor = "current_thread")] for unix socket tests
  since axum's serve(UnixListener) requires spawn_local
- Gate validate_custom_header behind client-side-sse feature since it
  references http::HeaderName which isn't available with default features

* fix(transport): fix CI failures for unix socket transport

axum::serve(UnixListener) uses spawn_local on Linux, which panics
outside a LocalSet. Replace with manual hyper HTTP/1.1 server that
accepts connections directly from the UnixListener, avoiding the
spawn_local requirement entirely.

* fix(transport): skip unix socket tests when local feature is enabled

The local feature causes ().serve(transport) to use spawn_local, which
requires a LocalSet. Gate the integration tests with not(feature = "local")
to match every other integration test in the repo.
2026-03-24 09:50:32 -04:00
..
common feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_deserialization fix(tasks): expose execution.taskSupport on tools (#635) 2026-02-03 19:17:36 -05:00
test_message_schema fix: default CallToolResult content to empty vec on missing field (#752) 2026-03-13 16:02:20 -04:00
test_with_js refactor: provide http server as tower service (#228) 2025-05-28 19:21:40 +08:00
test_with_python feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_client_credentials.rs feat: implement OAuth 2.0 Client Credentials flow (#707) 2026-03-03 20:53:51 -05:00
test_client_initialization.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_close_connection.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_completion.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_complex_schema.rs fix(schema): remove AddNullable from draft2020_12 settings (#664) 2026-02-19 11:19:45 -05:00
test_custom_headers.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_custom_request.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_deserialization.rs fix(test): fix tool deserialization error (#68) 2025-03-31 13:05:35 +08:00
test_elicitation.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_embedded_resource_meta.rs Spec conformance: meta support and spec updates (#415) 2025-09-04 14:23:36 -04:00
test_handler_wrappers.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_inflight_response_drain.rs fix: drain in-flight responses on stdin EOF (#759) 2026-03-18 11:38:15 -04:00
test_json_schema_detection.rs refactor: merge cached_schema_for_type into schema_for_type (#581) 2025-12-09 20:04:52 -05:00
test_logging.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_message_protocol.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_message_schema.rs chore(deps): update schemars requirement from 0.8 to 1.0 (#258) 2025-07-11 11:15:45 +08:00
test_notification.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_progress_subscriber.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_prompt_handler.rs Implement SEP-1319: Decouple Request Payload from RPC Methods (#617) 2026-01-16 12:16:52 -05:00
test_prompt_macro_annotations.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_prompt_macros.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_prompt_routers.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_resource_link.rs feat: add resource_link support to tools and prompts (#381) 2025-08-29 18:13:38 +08:00
test_resource_link_integration.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_sampling.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_server_initialization.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_sse_concurrent_streams.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_streamable_http_4xx_error_body.rs fix(rmcp): surface JSON-RPC error bodies on HTTP 4xx responses (#748) 2026-03-17 09:27:45 -04:00
test_streamable_http_json_response.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_streamable_http_priming.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_streamable_http_stale_session.rs feat: add configuration for transparent session re-init (#760) 2026-03-22 15:05:40 -04:00
test_structured_output.rs fix: default CallToolResult content to empty vec on missing field (#752) 2026-03-13 16:02:20 -04:00
test_task.rs fix(tasks): avoid dropping completed task results during collection (#639) 2026-02-05 09:00:09 +01:00
test_task_support_validation.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_tool_builder_methods.rs feat: Add support for Tool.outputSchema and CallToolResult.structuredContent (#316) 2025-07-31 16:32:24 +08:00
test_tool_handler.rs Move whole rmcp crate to offcial rust sdk (#44) 2025-03-27 17:33:41 -04:00
test_tool_macro_annotations.rs refactor: refactor tool macros and router implementation (#261) 2025-06-24 04:01:22 +08:00
test_tool_macros.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_tool_result_meta.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_tool_routers.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_unix_socket_transport.rs feat(transport): add Unix domain socket client for streamable HTTP (#749) 2026-03-24 09:50:32 -04:00
test_with_js.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_with_python.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00