Commit graph

502 commits

Author SHA1 Message Date
Pavel Bezglasny
187597bf7e
feat(elicitation): add support URL elicitation. SEP-1036 (#605) 2026-02-07 21:39:30 -05:00
Dale Seo
edd5b1d7e9
feat: enforce SEP-1577 MUST requirements for sampling with tools (#646) 2026-02-07 20:57:00 -05:00
Dale Seo
8bd3fcb890
Implement SEP-1577: Sampling With Tools (#628)
* feat: implement SEP-1577 sampling with tools support

* feat: add TryFrom<Content> for backward-compatible migration
2026-02-06 12:51:26 +01:00
Jiho Park
be23334f9d
fix(tasks): avoid dropping completed task results during collection (#639)
* fix(tasks): avoid dropping completed task results during collection

* chore(tasks): make `task_result_receiver` required

* refactor(tasks): make `collect_completed_results` private
2026-02-05 09:00:09 +01:00
Guy Lichtman
f6ebc7af13
fix(auth): oauth metadata discovery (#641)
* fix(auth): oauth metadata discovery

* fix: format auth.rs
2026-02-04 17:57:52 +01:00
Rodolfo Olivieri
bfd9cc08d8
feat: add native-tls as an optional TLS backend (#631)
Add reqwest-native-tls feature flag to allow users to choose between
rustls (default) and native-tls for HTTP transports.

native-tls uses platform-native TLS implementations:
- OpenSSL on Linux
- Secure Transport on macOS
- SChannel on Windows

This is particularly useful for Linux distribution packagers who need
to link against system TLS libraries (e.g., OpenSSL) rather than
bundling a separate TLS implementation. Linking against system libs
ensures security updates are applied system-wide and satisfies
distribution packaging policies.

Updated documentation to explain the available TLS backend options.
2026-02-03 19:27:37 -05:00
Evgenii
53b64a9f87
fix: compilation with --no-default-features (#593) 2026-02-03 19:21:06 -05:00
Luca Chang
df6c3f0665
fix(tasks): expose execution.taskSupport on tools (#635)
* fix(tasks): expose execution.taskSupport on tools

* feat: implement taskSupport validation on server
2026-02-03 19:17:36 -05:00
Andrew Harvard
1794fe1548
feat(capabilities): add extensions field for SEP-1724 (#643)
Add support for MCP extension capabilities in both ClientCapabilities
and ServerCapabilities structs, as specified in SEP-1724.

Changes:
- Add ExtensionCapabilities type alias (BTreeMap<String, JsonObject>)
- Add 'extensions' field to ClientCapabilities struct
- Add 'extensions' field to ServerCapabilities struct
- Update builder macros and impl blocks for both structs
- Add comprehensive tests for extension capabilities
- Update JSON schema test fixtures

This enables clients to advertise extension support during initialize,
such as:

  {
    "capabilities": {
      "extensions": {
        "io.modelcontextprotocol/ui": {
          "mimeTypes": ["text/html;profile=mcp-app"]
        }
      }
    }
  }

Closes #530
2026-02-03 19:14:22 -05:00
apexlnc
32a68aa239
fix(tasks): correct enum variant ordering for deserialization (#634)
Move CustomRequest and CustomResult to end of their respective untagged
enums to ensure specific task variants match before catch-all custom types.
Add deny_unknown_fields to GetTaskInfoResult to prevent matching arbitrary
JSON objects.

Fixes issue where tasks/get, tasks/list, tasks/result, and tasks/cancel
incorrectly deserialized as CustomRequest instead of their typed variants.
2026-01-30 09:30:53 +08:00
dependabot[bot]
d84573a617
chore(deps): update rig-core requirement from 0.28.0 to 0.29.0 (#630)
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.28.0...rig-core-v0.29.0)

---
updated-dependencies:
- dependency-name: rig-core
  dependency-version: 0.29.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>
2026-01-30 09:27:36 +08:00
github-actions[bot]
8d09f8813d
chore: release v0.14.0 (#623)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-23 13:09:02 -05:00
Alex Hancock
613eafbda8
fix(tasks): #626 model task capabilities correctly (#627) 2026-01-23 13:03:31 -05:00
Jonathan Hefner
e623f2acab
docs: show README content on docs.rs (#583)
Use `#![doc = include_str!("../README.md")]` to display README as crate
documentation on docs.rs for both `rmcp` and `rmcp-macros`.

Changes to support this:
- Fix code examples to compile as doc tests (`rust,no_run`)
- Fix broken rustdoc links with explicit `crate::` paths
- Add "Structured Output" section and examples link to rmcp README
- Simplify rmcp-macros README to a summary table with doc links
- Fix grammar throughout
- Add CSS to hide GitHub badges when rendered as rustdoc

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 12:56:16 -05:00
Joseph Wortmann
acc1f8b525
docs: added hyper-mcp to the list of built with rmcp (#621) 2026-01-21 12:14:10 -05:00
Alex Hancock
2e08001f32
fix: don't treat non-success HTTP codes as transport errors (#618) 2026-01-19 09:42:12 +08:00
Dale Seo
9e881a645b
Implement SEP-1319: Decouple Request Payload from RPC Methods (#617)
* feat: implement SEP-1319 Decouple Request Payload from RPC Methods

* test: update tests

* fix: update handler trait methods to use new types

* fix: update examples

* fix: correct deprecation version

* fix: update wrapper macros to use new *Params type names
2026-01-16 12:16:52 -05:00
Alex Hancock
48e989b711
chore: release v0.13.0 (#620)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-15 13:24:30 -05:00
DJ Chen
2d1456e5b8
fix(docs): add -p parameter to the cargo run commands in documentation (#592)
* fix(docs): Add -p mcp-client-examples to cargo run commands in clients/README.md

* fix(docs): Add -p mcp-server-examples to cargo run commands in examples/servers/README.md

* fix(docs): Add -p parameter to cargo run commands in other documentation
2026-01-14 20:54:57 -05:00
Pavel Bezglasny
e49aef65d1
chore(elicitation): improve enum schema builder, small changes of elicitation builder (#608) 2026-01-14 16:15:03 -05:00
Alex Hancock
9b629c609f
chore: add pre-commit hook for conventional commit verification (#619) 2026-01-14 16:01:28 -05:00
Xing
95d3e3f940
fix: use the json rpc error from the initialize response and bubble it up to the client (#569) 2026-01-14 11:28:54 -05:00
Taylor Ninesling
81f858836d
feat: provide blanket implementations for ClientHandler and ServerHandler traits (#609)
* feat!: implement ServerHandler for Box<H> and Arc<H> where H is a ServerHandler

* feat!: implement ClientHandler for Box<H> and Arc<H> where H is a ClientHandler

* test: test Box and Arc have blanket implementations for handler traits

* refactor: deduplicate blanket implementations with macros
2026-01-14 10:53:05 -05:00
Pavel Bezglasny
acb06ea819
fix(build): fix build of the project when no features are selected (#606) 2026-01-14 10:47:50 -05:00
Jack Amadeo
46e149ee8b
chore: clean up optional dependencies (#546) 2026-01-13 21:29:35 -05:00
Tyler Mailman
cc96f379ba
feat(service): add close() method for graceful connection shutdown (#588)
This PR primarily fixes #572 by enabling graceful shutdown without consuming self. While implementing this, I noticed delete_session() is spawned as a background task, which means close() may return before HTTP session cleanup completes. Since this is part of the same shutdown lifecycle and can cause resource leaks/races, I'm including a small, localized fix to ensure cleanup is completed before close() returns. If maintainers prefer, I can split the cleanup timing change into a follow-up PR.

Changes:
- Add close(&mut self) for graceful shutdown without consuming
- Add close_with_timeout() for bounded shutdown operations
- Add is_closed() to check connection state
- Move HTTP delete_session from background spawn to inline cleanup
- Add 5-second timeout on session cleanup to prevent indefinite hangs
- Add Drop impl with debug log if dropped without explicit close

Fixes #572
2026-01-13 16:25:06 -05:00
Maksim Madžar
c4a68295e0
fix: use Semaphore instead of Notify in OneshotTransport to prevent race condition (#611) 2026-01-13 16:15:19 -05:00
dependabot[bot]
69dbd5a3ce
chore(deps): update rig-core requirement from 0.15.1 to 0.28.0 (#616)
* chore(deps): update rig-core requirement from 0.15.1 to 0.28.0

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.15.1...rig-core-v0.28.0)

---
updated-dependencies:
- dependency-name: rig-core
  dependency-version: 0.28.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): manual fixes required

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Hancock <alexhancock@block.xyz>
2026-01-13 15:52:00 -05:00
centdix
ce559f28e0
feat(auth): add StateStore trait for pluggable OAuth state storage (#614)
* feat(auth): add StateStore trait for pluggable OAuth state storage

* fix(examples): use CLI server_url for transport connection
2026-01-13 15:33:25 -05:00
adam jones
ad592020a5
chore: update licensing to Apache 2.0 for new contributions (#615) 2026-01-13 15:28:03 -05:00
Dale Seo
2286564f65
refactor: re-export ServerSseMessage from session module (#612) 2026-01-12 14:22:29 -05:00
Dale Seo
971c64c31f
Implement SEP-1699: Support SSE Polling via Server-Side Disconnect (#604)
* feat: implement SEP-1699 SSE polling via server-side disconnect

* test: add tests for priming behavior on stream start and close
2026-01-09 13:22:57 -05:00
Tanish Desai
61f7b7b99e
fix: add OpenID Connect discovery support per spec-2025-11-25 4.3 (#598)
* fix: add OpenID Connect discovery support per spec-2025-11-25 4.3

Previously only tried OAuth 2.0 endpoints. Now tries OAuth first, then
OpenID Connect Discovery 1.0 in the spec-mandated priority order.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* fix: format auth.rs test assertions

Reformat assert_eq! statements to satisfy rustfmt checks in CI.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

---------

Signed-off-by: tanish111 <tanishdesai37@gmail.com>
2026-01-09 12:20:32 -05:00
David Stern
63d89b1a4e
fix: only try to refresh access tokens if we have a refresh token or an expiry time (#594) 2026-01-06 09:34:42 +08:00
dependabot[bot]
de62b1b087
chore(deps): update askama requirement from 0.14 to 0.15 (#600)
Updates the requirements on [askama](https://github.com/askama-rs/askama) to permit the latest version.
- [Release notes](https://github.com/askama-rs/askama/releases)
- [Commits](https://github.com/askama-rs/askama/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: askama
  dependency-version: 0.15.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>
2026-01-06 09:29:33 +08:00
Nicolas Pellegrin
e04c4a1397
docs: update README external links (#603) 2026-01-06 09:25:17 +08:00
Alex
a7acdd8892
docs: clarity and formatting (#602) 2026-01-06 09:20:52 +08:00
Pavel Bezglasny
e9029ccc99
feat(elicitation): implement SEP-1330 Elicitation Enum Schema Improvements (#539) 2025-12-24 13:54:20 -05:00
Frankie Colson
6fd55f02fc
fix(docs): add spreadsheet-mcp to Built with rmcp (#582)
* docs: add spreadsheet-read-mcp to Built with rmcp

* Update description with repo rename, new features
2025-12-24 09:30:37 +08:00
jokemanfire
621c9f619e
feat(task): add task support (SEP-1686) (#536)
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-12-22 09:01:00 -05:00
Dale Seo
eeacd1375f
Add optional icons field to RawResourceTemplate (#589)
* feat: add optional icons field to RawResourceTemplate

* chore: update JSON schema for ResourceTemplate icons
2025-12-18 16:56:55 -05:00
github-actions[bot]
0d65822c38
chore: release v0.12.0 (#577)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-18 16:07:25 -05:00
Michael Bolin
e0faf1ed51
feat: add support for custom requests (#590)
#580 and #556 introduced support for custom notifications,
so this PR takes the next logical step and adds support for custom requests:

- Introduces `CustomRequest` and `CustomResult` model types, wires them into the client/server
  request and result unions, and allows `ClientRequest::method()` to return the dynamic method
  name.
- Implements serde and meta handling for `CustomRequest` so `_meta` is carried through
  extensions; adds default `on_custom_request` handlers that return `METHOD_NOT_FOUND` unless
  overridden.
- Updates JSON schema fixtures to include the new request/result shapes and `EmptyObject`
  strictness.
- Adds tests for custom request roundtrips and end-to-end client↔server handling.
- Focused integration test in `crates/rmcp/tests/test_custom_request.rs`.

For additional testing, I used this locally to update Codex to use a custom
request instead of a custom notification so that it gets an "ack" from the MCP
server to ensure it has processed the update before sending more messages:
https://github.com/openai/codex/pull/8142.
2025-12-18 12:41:06 -05:00
Michael Bolin
2e3cc4a973
feat: add support for custom server notifications (#580)
https://github.com/modelcontextprotocol/rust-sdk/pull/556 introduced support for
custom client notifications, so this PR makes the complementary change, adding
support for custom server notifications.

MCP clients, particularly ones that offer "experimental" capabilities,
may wish to handle custom server notifications that are not part of the
standard MCP specification. This change introduces a new
`CustomServerNotification` type that allows a client to process
such custom notifications.

- introduces `CustomServerNotification` to carry arbitrary methods/params while
  still preserving meta/extensions; wires it into the `ServerNotification` union
  and `serde` so `params` can be decoded with `params_as`
- allows client handlers to receive custom notifications via a new
  `on_custom_notification` hook
- adds integration coverage that sends a custom server notification end-to-end
  and asserts the client sees the method and payload

Test:

```shell
cargo test -p rmcp --features client test_custom_server_notification_reaches_client
```
2025-12-16 12:48:03 -05:00
Tanish Desai
31d242b1e4
fix: correct redirect URI in client-metadata.json (#585)
Update redirect_uris entry to the intended callback URL
2025-12-15 13:17:39 -05:00
Dale Seo
d7a05aa43f
fix: update process-wrap to v9.0 (#586) 2025-12-15 15:05:06 +08:00
Tanish Desai
f20ed202af
Add SEP-991 (CIMD) support for URL-based client IDs (#570)
* feat(auth): add cimd support for SEP-991

add cimd support for url-based client ids

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* test(auth): add unit tests for is_https_url helper

Add test coverage for is_https_url helper to validate HTTPS scheme, non-root paths,
and reject http, javascript, data schemes, and invalid inputs per SEP-991 requirements.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* feat(example): add CIMD OAuth server for SEP-991 testing

Implements a new server example (servers_cimd_auth_streamhttp) that
demonstrates CIMD (Client ID Metadata Document) support for URL-based
client IDs. The server validates client_id URLs, fetches and validates
client metadata documents, and provides OAuth 2.0 authorization endpoints
with MCP integration for end-to-end testing.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* fix(oauth): add CORS headers to token endpoint

Add CORS headers to token endpoint to allow cross-origin requests from browsers
during OAuth authorization code exchange flow.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* refactor: improve is_https_url function and consolidate tests

- Improve is_https_url function formatting and readability
- Merge all test cases into single test_is_https_url_scenarios function
- Add missing test case for "https://" URL

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* refactor: use map_err instead of match for error handling in auth.rs

Replace the verbose match statement with
map_err for more idiomatic

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* feat: add client-metadata.json

Add client metadata file for SEP-991 CIMD
authentication support

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

---------

Signed-off-by: tanish111 <tanishdesai37@gmail.com>
2025-12-10 08:55:38 -05:00
Thiago Martins
e3fd384a45
fix(docs): update CONTRIBUTE.MD (#579) 2025-12-10 09:33:22 +08:00
Dale Seo
8d33b155b6
refactor: merge cached_schema_for_type into schema_for_type (#581) 2025-12-09 20:04:52 -05:00
jokemanfire
bce0555068
fix(oauth): rfc8414 should judement the response_types (#485)
response_types_supported should be judement while try to do 'Authorization Code Flow'

Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-12-09 11:18:18 -05:00