Skip to content

fix(rmcp-macros): use re-exported serde_json path in task_handler#735

Merged
alexhancock merged 2 commits intomodelcontextprotocol:mainfrom
kakarot-dev:fix/serde-json-reexport-487
Mar 9, 2026
Merged

fix(rmcp-macros): use re-exported serde_json path in task_handler#735
alexhancock merged 2 commits intomodelcontextprotocol:mainfrom
kakarot-dev:fix/serde-json-reexport-487

Conversation

@kakarot-dev
Copy link
Contributor

Summary

The task_handler macro generates code referencing ::serde_json:: directly. This causes compilation errors in crates that depend on rmcp but don't have serde_json as a direct dependency.

Changed ::serde_json:: to ::rmcp::serde_json:: in crates/rmcp-macros/src/task_handler.rs to use the re-exported path, consistent with how other generated code in the macro crate references rmcp dependencies.

Fixes #487

Replace bare `::serde_json::` with `::rmcp::serde_json::` in
task_handler.rs to prevent compilation errors in crates that don't
directly depend on serde_json.

Fixes modelcontextprotocol#487
@kakarot-dev kakarot-dev requested a review from a team as a code owner March 9, 2026 10:19
@github-actions github-actions bot added the T-macros Macro changes label Mar 9, 2026
DaleSeo
DaleSeo previously approved these changes Mar 9, 2026
Copy link
Member

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix, @kakarot-dev!

@alexhancock alexhancock self-requested a review March 9, 2026 20:24
@alexhancock alexhancock merged commit be24898 into modelcontextprotocol:main Mar 9, 2026
15 of 16 checks passed
@kakarot-dev kakarot-dev deleted the fix/serde-json-reexport-487 branch March 9, 2026 20:31
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-macros Macro changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool macro expands to serde_json without re-export

3 participants