Commit graph

19 commits

Author SHA1 Message Date
Dale Seo
d1cabb458f
feat: deprecate roots/sampling/logging types (#923) 2026-06-25 21:11:59 -04:00
Dale Seo
77932141e3
feat!: align model types with MCP 2025-11-25 spec (#927)
* feat!: align model types with MCP 2025-11-25 spec

* fix: complete 2025-11-25 model spec conformance
2026-06-24 20:41:13 -04:00
Dale Seo
6a3b32d3ab
chore: add #[non_exhaustive] to remaining public structs (#768)
* chore: add #[non_exhaustive] to remaining public structs

* chore: add #[non_exhaustive] to remaining public types

* chore: enable exhaustive_structs/enums clippy lints

* test: add untagged ServerResult deserialization regression tests
2026-03-26 10:23:58 -04:00
Jack Amadeo
f63718d202
chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715)
* chore: add #[non_exhaustive] to reduce backwards-incompatible changes going forward

* fix: remove ProtocolVersion import

* fix: add a few more with_ mutator methods

---------

Co-authored-by: Alex Hancock <alexhancock@block.xyz>
2026-03-03 10:38:01 -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
Pavel Bezglasny
81411fc12d
feat(meta): add _meta field to prompts, resources and paginated result (#558) 2025-12-04 09:38:47 +08:00
Alex Hancock
b57aa47693
feat(SEP-973): add support for icons and websiteUrl across relevant types (#432) 2025-09-11 11:49:03 -04:00
4t145
1b70f5b032
feat: add title field for data types (#410)
* feat(model): add title field to various structs

* fix(test): fix test json schema

* fix(model): allow boxed type  in `ts_union` macro
2025-09-08 09:15:22 +08:00
Andrew Harvard
4eb413b6c6
Spec conformance: meta support and spec updates (#415)
* feat: add _meta to content blocks and embedded resources; update schemas

* feat: set default protocol version; add _meta to content blocks/resources; update schemas

* chore: format content.rs via rustfmt

* chore(protocol): keep LATEST at 2025-03-26 per review until full 2025-06-18 compliance

* feat(prompt): add constructors with optional meta for image and resource

- Keep text helper; meta is currently ignored for text until schema supports it.

* refactor(prompt): simplify constructors so meta is optional; remove duplicate non-meta variants

* fix: modify code comment about version

* refactor(prompt): rename meta parameters in new_resource function for clarity
2025-09-04 14:23:36 -04:00
Andrew Harvard
7d46b39b49
feat(rmcp): add optional _meta to CallToolResult, EmbeddedResource, and ResourceContents (#386)
* feat(rmcp): support optional _meta on EmbeddedResource and ResourceContents

- Add optional _meta to RawEmbeddedResource and ResourceContents (text/blob)
- Update constructors/usages to set meta: None by default
- Add tests to lock behavior (embedded text/blob + CallToolResult)
- Update JSON Schemas to include optional _meta fields

* style(rmcp): rustfmt after _meta changes and tests
2025-09-02 13:47:09 -04:00
Andrew Harvard
98b77fd94a
feat: add resource_link support to tools and prompts (#381)
* feat: add resource_link support to tools and prompts

* chore: remove unused serde_json import from test_resource_link_integration.rs

* chore: remove unused serde_json import from test_resource_link.rs
2025-08-29 18:13:38 +08:00
Andrew Harvard
7ba1ac4959
fix: use mimeType instead of mime_type for MCP specification compliance (#339)
- Fix ResourceContents enum to properly serialize with camelCase field names
- Add comprehensive tests to verify JSON serialization compliance
- Ensure all resource-related structs use mimeType as per MCP spec
- Add tests for RawResource, ResourceContents, RawImageContent, RawAudioContent
- Add test for prompt message image content serialization
- Update message schema files to reflect mimeType changes
- Fix import ordering to match project formatting standards

This change ensures the Rust SDK is fully compliant with the MCP specification
which requires mimeType (camelCase) for all resource content types.
2025-07-29 12:42:56 -04:00
4t145
e615300fea
feat: unified error type (#308)
* feat: unified error type

* fix: use type id to compare transport type
2025-07-09 11:23:39 +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
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
4t145
68375460df
feat: revision-2025-03-26 without streamable http (#84)
1. Suppot revision 2025-03-26 data types
2. Support meta, progress tokne, and extensions in request/notification,
3. Remove `Message`, use `JsonRpcMessage` directly
2025-04-07 09:47:39 +08:00
jokemanfire
0a2f13a1f4
style: fmt the project (#54)
add rustfmt.toml

Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
2025-03-28 23:50:46 +08:00
4t145
0be6067326
Move whole rmcp crate to offcial rust sdk (#44)
* get rid of async-trait

* move rmcp to official-rust-sdk

* replace master with main

* update readme, change license

* fix typo

* Update README.md

Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>

* fix typos

---------

Co-authored-by: = <=>
Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>
2025-03-27 17:33:41 -04:00