rust-sdk/crates/rmcp/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michael Assaf 9349f5cb26
feat: Add prompt support (#351)
* feat: add prompt support with typed argument handling

- Implement #[prompt], #[prompt_router], and #[prompt_handler] macros
- Add automatic JSON schema generation from Rust types for arguments
- Support flexible async handler signatures with automatic adaptation
- Create PromptRouter for efficient prompt dispatch
- Include comprehensive tests and example implementation

This enables MCP servers to provide reusable prompt templates that
LLMs can discover and invoke with strongly-typed parameters, similar
to the existing tool system but optimized for prompt use cases.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: unify parameter handling between tools and prompts

- Replace Arguments<T> with Parameters<T> for consistent API
- Create shared common module for tool/prompt utilities
- Modernize async handling with futures::future::BoxFuture
- Move cached_schema_for_type to common module for reuse
- Update error types from rmcp::Error to rmcp::ErrorData
- Add comprehensive trait implementations for parameter extraction

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: extract Parameters wrapper to shared module and unify trait usage

- Move Parameters type from common.rs to dedicated wrapper/parameters.rs module
- Unify extractor traits by using FromContextPart for both tools and prompts
- Remove duplicate FromToolCallContextPart and FromPromptContextPart traits
- Add structured output support to Json wrapper with IntoCallToolResult impl
- Improve error messages with more descriptive panic for schema serialization
- Update all imports across codebase to use new module path
- Clean up trailing whitespace and formatting inconsistencies

This consolidates parameter extraction logic and reduces code duplication
between tool and prompt handlers while maintaining backward compatibility.

* chore: remove committed .egg-info directory and update gitignore

* docs: fix documentation formatting
2025-08-21 11:22:19 +08:00
..
common feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_deserialization fix(test): fix tool deserialization error (#68) 2025-03-31 13:05:35 +08:00
test_message_schema fix: match shape of the calltoolresult schema (#377) 2025-08-19 14:28:25 +08:00
test_with_js refactor: provide http server as tower service (#228) 2025-05-28 19:21:40 +08:00
test_with_python feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_complex_schema.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_deserialization.rs fix(test): fix tool deserialization error (#68) 2025-03-31 13:05:35 +08:00
test_elicitation.rs feat: Add MCP Elicitation support (#332) 2025-08-19 11:48:26 +08:00
test_json_schema_detection.rs feat: Add support for Tool.outputSchema and CallToolResult.structuredContent (#316) 2025-07-31 16:32:24 +08:00
test_logging.rs test(context): test context request handling and refactor for reusable client-server tests (#97) 2025-04-07 10:13:05 +08:00
test_message_protocol.rs feat: extensions to context (#102) 2025-04-08 10:01:17 +08:00
test_message_schema.rs chore(deps): update schemars requirement from 0.8 to 1.0 (#258) 2025-07-11 11:15:45 +08:00
test_notification.rs feat: unified error type (#308) 2025-07-09 11:23:39 +08:00
test_progress_subscriber.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_prompt_handler.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_prompt_macro_annotations.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_prompt_macros.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_prompt_routers.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_sampling.rs example: add simpling example and test (#289) 2025-06-30 18:18:23 +08:00
test_structured_output.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_tool_builder_methods.rs feat: Add support for Tool.outputSchema and CallToolResult.structuredContent (#316) 2025-07-31 16:32:24 +08:00
test_tool_handler.rs Move whole rmcp crate to offcial rust sdk (#44) 2025-03-27 17:33:41 -04:00
test_tool_macro_annotations.rs refactor: refactor tool macros and router implementation (#261) 2025-06-24 04:01:22 +08:00
test_tool_macros.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_tool_routers.rs feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_with_js.rs refactor: refactor tool macros and router implementation (#261) 2025-06-24 04:01:22 +08:00
test_with_python.rs feat(transport): add builder & expose child stderr (#305) 2025-07-05 09:14:43 +08:00