Commit graph

550 commits

Author SHA1 Message Date
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
Dale Seo
a62c6d1db8
docs: fix broken links in example readme (#273) 2025-06-20 09:42:48 +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
Alex Hancock
d45136c3ed
fix(github): add required permission to create labels (#267) 2025-06-18 09:00:14 +08:00
dependabot[bot]
d1884fe598
chore(deps): update tokio-tungstenite requirement from 0.26.2 to 0.27.0 (#263)
Updates the requirements on [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) to permit the latest version.
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.26.2...v0.27.0)

---
updated-dependencies:
- dependency-name: tokio-tungstenite
  dependency-version: 0.27.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>
Co-authored-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-06-17 09:51:05 +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
jokemanfire
c4f252a21d
ci: add labels (#260) 2025-06-16 01:11:51 +08:00
jokemanfire
80cdf85e1a
chore(deps): update rig-core requirement from 0.12.0 to 0.13.0 (#259) 2025-06-16 01:09:53 +08:00
Dale Seo
abf7c7af08
doc: fix typos in examples readme (#256) 2025-06-13 09:05:44 +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]
915bc3fb37
chore(deps): update rig-core requirement from 0.10.0 to 0.12.0 (#231)
Updates the requirements on [rig-core](https://github.com/0xPlaygrounds/rig) to permit the latest version.
- [Release notes](https://github.com/0xPlaygrounds/rig/releases)
- [Commits](https://github.com/0xPlaygrounds/rig/compare/rig-core-v0.10.0...rig-core-v0.12.0)

---
updated-dependencies:
- dependency-name: rig-core
  dependency-version: 0.12.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:44:47 +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
jokemanfire
d5a72e43c1
fix(examples): add servers in examples's readme (#229)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-26 21:00:49 +08:00
jokemanfire
0ce14186ba
chore(deps): update rand requirement from 0.8 to 0.9 (#226)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-26 18:58:33 +08:00
Lucas Nogueira
633d42425a
feat: add cancellation_token method to RunningService (#218) 2025-05-26 18:57:48 +08:00
jokemanfire
0d52b7d24f
fix(examples): add clients in examples's readme (#225)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-26 18:32:29 +08:00
Pete Hayman
4e8686ff47
fix: generic ServerHandler (#223) 2025-05-26 14:13:34 +08:00
Yang Yexuan
23e8200a58
fix(examples): Make mcp_oauth_server example worked in MCP inspector OAuth (#219) 2025-05-26 09:12:12 +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
z9rtm
5bbfcccfba
ci: add example-test workflow for testing and building examples (#211)
This workflow sets up a new CI job to handle testing and building of example projects in the repository. It includes setting up Node.js, Rust, Python, and necessary caching to ensure proper environment preparation. Example directories are iterated to run tests and builds for each valid Cargo project.

Co-authored-by: GCOV Github Badge <build@github.com>
2025-05-22 11:35:29 +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
dependabot[bot]
4e5685cb1c
chore(deps): update thiserror requirement from 1.0 to 2.0 (#208)
---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.12
  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:16 +08:00
A-afflatus
8222e18e40
fix: resolve the server 406 error in API calls (#203) 2025-05-21 11:16:48 +08:00
dependabot[bot]
5b52641c02
chore(deps): bump actions/checkout from 3 to 4 (#207)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 11:16:06 +08:00
dependabot[bot]
9482566748
chore(deps): bump actions/setup-node from 3 to 4 (#206)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 11:15:44 +08:00
dependabot[bot]
bb9dfd8dc9
chore(deps): bump astral-sh/setup-uv from 5 to 6 (#205)
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 6.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 11:15:28 +08:00
jokemanfire
d24d80a094
chore: add dependbot for check dep (#204)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-21 11:09:01 +08:00
z9rtm
08c933a095
ci: revert badge (#202)
Co-authored-by: GCOV Github Badge <build@github.com>
2025-05-21 09:19:25 +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
jokemanfire
752b4388a3
ci: update node version (#194)
fix node version

Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-05-19 11:11:51 +08:00
4t145
817e62d895
feat: throw initialize error detail (#192) 2025-05-19 09:41:56 +08:00
z9rtm
4dc0cad499
Ci/coverage badge (#191)
* ci: coverage badge
2025-05-19 09:07:01 +08:00