Commit graph

97 commits

Author SHA1 Message Date
github-actions[bot]
ee80903091
chore: release v0.2.1 (#302)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-02 21:55:28 -04:00
Alex Hancock
c6dcbd72e4
chore(docs): Minor README updates (#301)
* chore(docs): minor readme updates

* fix: correct typos in changelog
2025-07-02 21:50:32 -04:00
github-actions[bot]
c0f372001f
chore: release v0.2.0 (#300)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-02 14:50:51 -04:00
4t145
9ca20c69b2
feat: mark boxed http body as sync (#291) 2025-07-01 11:27:15 +08:00
jokemanfire
1b3db8959c
example: add simpling example and test (#289)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-06-30 18:18:23 +08:00
jokemanfire
e6effb3278
chore: add update for test_message_schema (#286) 2025-06-25 21:43:58 +08:00
jokemanfire
09caeb3afb
docs: add notion clear in model.rs (#284)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-06-25 20:29:38 +08:00
4t145
55215b6170
chore: cov settings, and fix serveral building warnings (#281)
* chore: cov settings, update Python test dependencies and adjust command arguments

* fix: remove .vscode dir
2025-06-25 14:30:45 +08:00
4t145
8e1490bcd8
feat: add progress notification handling and related structures (#282)
* feat: add progress notification handling and related structures

also fix some lifetime bugs of tool macro

* fix: fmt
2025-06-25 14:30:22 +08:00
4t145
893969ac77
fix: let users decide what to wrap in child process command (#279) 2025-06-24 15:26:43 +08:00
4t145
57db771a81
fix: cancellable initialization process (#280) 2025-06-24 15:26:03 +08:00
4t145
1f7f4d3055
refactor: refactor tool macros and router implementation (#261)
* refactor: refactor tool macros and router implementation

- Updated the `#[tool(tool_box)]` macro to `#[tool_router]` across various modules for consistency.
- Enhanced the `Calculator`, `Counter`, and `GenericService` structs to utilize `ToolRouter` for handling tool calls.
- Introduced `Parameters` struct for better parameter handling in tool functions.
- Added new methods for listing tools and calling tools in server handlers.
- Improved test cases to reflect changes in tool routing and parameter handling.
- Updated documentation and examples to align with the new router structure.

* fix: fix fmt and build error

* fix: fix test failure

* docs: documents for macros, fix ci

* fix: fix ci

* fix: fix wrongly replaced documents

* fix: remove useless file

* fix: change the parameter format for tool_router

* fix: update extract_doc_line to handle existing documentation and clean up unused code in server handler

* doc: update document for macro and examples

* doc: update readme and add contribute guide

* fix: fix type
2025-06-24 04:01:22 +08:00
4t145
6d3190504c
fix: inject part into extension when handing init req (#275) 2025-06-24 00:52:38 +08:00
John Howard
13e72ec6c4
sse: fix regression in URL joining (#265)
* sse: fix regression in URL joining

This was broken by
https://github.com/modelcontextprotocol/rust-sdk/pull/197.

The URL join behaves like this:

```
$ let baseUrl = "https://example.com/sse";
$ new URL("?sessionId=x", baseUrl).href
'https://example.com/sse?sessionId=x'
$ new URL("/?sessionId=x", baseUrl).href
'https://example.com/?sessionId=x'
```

The PR #197 did not take into account the relative URL

Fixes https://github.com/modelcontextprotocol/rust-sdk/issues/252

* Address review comments
2025-06-19 11:57:17 +08:00
4t145
8a577659f0
fix: streamable http server close request channel on response(#266) (#270)
* fix: improve resource unregistration logic in LocalSessionWorker

* fix: fix typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-19 01:09:36 +08:00
4t145
4c34b64b7f
fix: streamable http client close on response (#268) 2025-06-18 13:48:42 +08:00
wenhaozhao
b9bba0be15
Fix: remove erroneous definitions_path (#264)
* fix bug,
1 remove erroneous definitions_path setting,"#/components/schemas/" is used for openapi3
2 show meta_schema

* Update crates/rmcp/src/handler/server/tool.rs

Remove the commented-out settings.inline_subschemas line to avoid confusion and clean up dead code.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: wenhaozhao <wenhaozhao@sohu-inc.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-18 09:07:28 +08:00
John Howard
73188eff6f
feat: allow failable service creation in streamable HTTP tower service (#244)
* feat: allow failable service creation in streamable HTTP tower service

In our setup we need to lookup some info that may fail before we serve
the request.

* Fix examples build
2025-06-16 01:13:35 +08:00
bl-ue
a55bbddcf1
fix: expose TokioChildWrapper::id() in TokioChildProcess and TokioChildProcessOut (#254) 2025-06-12 14:31:00 +08:00
Lucas Nogueira
db03f63e76
allow using a TokioCommandWrap for TokioChildProcess::new closes #243 (#245)
* allow using a TokioCommandWrap for TokioChildProcess::new closes #243

TokioCommandWrap implements From<tokio::process::Command> so this is not a breaking change, but also downstream users have more control over flags such as KillOnDrop and CreationFlags

see https://docs.rs/process-wrap/latest/process_wrap/#killondrop-and-creationflags
2025-06-07 22:59:15 +08:00
Loocor
37b4ddb35d
fix: add compatibility handling for non-standard notifications in async_rw (#247)
- Introduced `is_standard_notification` function to check for standard MCP notifications.
- Added `try_parse_with_compatibility` function to handle parsing messages with compatibility for non-standard notifications.
- Updated the decoder implementation to utilize the new compatibility handling.
- Added unit tests for standard notification checks and compatibility function to ensure correct behavior.
2025-06-07 10:53:58 +08:00
Sylvain Wallez
47518b3906
fix: allow SSE server router to be nested (#240)
* fix: allow SSE server router to be nested
2025-06-07 10:40:26 +08:00
Luc van Kampen
97bb4796dd
doc: Fix typo (#249) 2025-06-07 10:39:48 +08:00
4t145
a66f66ae34
fix: error for status in post method of streamable http client (#238) 2025-05-29 14:51:24 +08:00
4t145
969fad26cc
feat: provide more context information (#236)
* feat: provide more context information

1. provide context for notification
2. allow extract more info from tool call
3. inject http request part for streamable http server

* docs: add document for getting peer from context
2025-05-29 11:52:54 +08:00
okoyfoeciov
9fc6af091d
fix: disable wasmbind in chrono for wasm32-unknown-unknown (#234) 2025-05-29 00:10:36 +08:00
4t145
ff71a52615
feat: stateless mode of streamable http client (#233) 2025-05-28 19:37:18 +08:00
4t145
209be7bdb8
refactor: provide http server as tower service (#228)
* refactor: streamable http server as tower service
2025-05-28 19:21:40 +08:00
dependabot[bot]
83c7aae49d
chore(deps): update sse-stream requirement from 0.1.4 to 0.2.0 (#230)
Updates the requirements on [sse-stream](https://github.com/4t145/sse-stream) to permit the latest version.
- [Release notes](https://github.com/4t145/sse-stream/releases)
- [Commits](https://github.com/4t145/sse-stream/compare/release-0.1.4...release-0.2.0)

---
updated-dependencies:
- dependency-name: sse-stream
  dependency-version: 0.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 08:43:53 +08:00
Lucas Nogueira
633d42425a
feat: add cancellation_token method to RunningService (#218) 2025-05-26 18:57:48 +08:00
Pete Hayman
4e8686ff47
fix: generic ServerHandler (#223) 2025-05-26 14:13:34 +08:00
Longhua Zhang
22134eb33e
fix: comment error (#215)
Co-authored-by: plutoyzhang <plutoyzhang@tencent.com>
2025-05-23 15:14:52 +08:00
emi0x7d1
d0bbb22850
Server info is only retrieved once during initialization (#214) 2025-05-23 03:51:26 +08:00
dependabot[bot]
c8ea0f6051
chore(deps): update base64 requirement from 0.21 to 0.22 (#209)
Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.21.0...v0.22.1)

---
updated-dependencies:
- dependency-name: base64
  dependency-version: 0.22.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 11:17:56 +08:00
A-afflatus
8222e18e40
fix: resolve the server 406 error in API calls (#203) 2025-05-21 11:16:48 +08:00
4t145
076dc2c2cd
feat: better http server support (#199)
* feat: better http server support

1. allow user get extensions in tool call.
2. allow user serve sse service without initialization.

* fix: fix document test
2025-05-19 18:49:18 +08:00
jokemanfire
c1c4c9a0c9
doc: use hierarchical readme for publishing (#198) 2025-05-19 13:15:49 +08:00
4t145
a3b42c4a83
fix: sse endpoint build follow js's new URL(url, base) (#197)
* fix: sse endpoint build follow js's `new URL(url, base)`

* fix: fix feature denpencies
2025-05-19 13:09:00 +08:00
4t145
817e62d895
feat: throw initialize error detail (#192) 2025-05-19 09:41:56 +08:00
4t145
35282ee34c
feat: sse client optionally skip the endpoint event (#187) 2025-05-18 18:55:02 +08:00
4t145
c1e282e50d
fix: more friendly interface to get service error (#190) 2025-05-18 18:54:44 +08:00
Humberto Yusta Gómez
64995cc40c
fix: cleanup zombie processes for child process client (#156)
* feat(client): cleanup of zombie processes in child process client

Using process wrap library, Process Group for Unix and Job Object for Windows

* fix: install extra dep based on feature, update examples take owned command

Install process-wrap if transport-child-process feature is enabled. Update examples to take ownership
of the command instead of mutable reference

* fix: update other examples, comments and readme to take ownership of command

Updated more examples, comments and readme to take command instead of mutable ref.
Also small fix in cargo toml of example to use local path.

* refactor: add configure command ext

Added configure command ext to tokio process command so that
you can use .configure() to use inline commands for mcp stdio client.
Added warning if start kill process fails
2025-05-18 18:38:47 +08:00
Abhay Agarwal
68ddea3ad5
feat(server): add annotation to tool macro (#184)
skip serializing the tool annotations if none, fixes mcp inspector
2025-05-18 16:04:58 +08:00
4t145
5e4e77efa5
refactor: fix error introduced by merge, and reorganize feature (#185) 2025-05-18 14:15:41 +08:00
4t145
9a771fb157
refactor: Transport trait and worker transport, and streamable http client with those new features. (#167)
* refactor: a transport trait and streamable http client

* test: test with js streamable http server

* refactor: separate sse stream connection

* fix(test): streamable http client test with js

* fix(test): wait longer time for js server startup
2025-05-17 23:53:38 +08:00
jokemanfire
01eedb7770
fix(schemar): use self-defined settings (#180)
Ignores fields that are not defined in the spec file.

Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-16 14:40:28 +08:00
Stanley Horwood
e9a5ae9901
feat(model): add json schema generation support for all model types (#176)
* feat(model): add json schema generation support for all model types

This commit adds JSON Schema support for all model types by implementing
`schemars::JsonSchema` trait. The feature is gated behind the new
`schemars` feature flag. This enables automatic schema generation for
API documentation and validation purposes. Added tests to verify schema
generation for client and server JSON-RPC messages.

* fix(model): add manual json schema implementation for `NumberOrString`

This commit adds a manual implementation of `JsonSchema` trait for the
`NumberOrString` enum to properly represent its union type nature in
JSON Schema. The schema now correctly specifies that the type can be
either a number or a string using the `oneOf` validation keyword.

* fix(model): skip extensions field in json schema generation

The `Extensions` type was incorrectly included in JSON schema
generation, which could lead to confusing API documentation. This commit
adds `#[schemars(skip)]` attribute to all `extensions` fields in request
and notification structs, and removes the manual `JsonSchema`
implementation for the `Extensions` type since it's an internal
implementation detail that shouldn't be exposed in the schema.
2025-05-15 23:56:31 +08:00
Jonathan Hendler
5d92061ece
feat(openapi): add OpenAPI v3 compatibility and test for nullable field schema workaround (#135) (#137) 2025-05-14 14:06:59 +08:00
Aaron
030b6f0858
fix(transport-sse-server): cleanup on connection drop (#165) 2025-05-12 14:15:34 +08:00
4t145
787cc015b7
feat(extension): extract http request part into rmcp extension (#163)
* feat(extension): extract http request part into rmcp extension

* perf(extension): insert extension from one entrypoint
2025-05-09 10:36:52 +08:00