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
This commit is contained in:
Dale Seo 2026-01-16 12:16:52 -05:00 • committed by GitHub
commit 9e881a645b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,7 +85,7 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
fn create_message(
&self,
params: CreateMessageRequestParam,
params: CreateMessageRequestParams,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_ {
std::future::ready(Err(
@ -118,7 +118,7 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
/// Real clients should override this to provide user interaction.
fn create_elicitation(
&self,
request: CreateElicitationRequestParam,
request: CreateElicitationRequestParams,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<CreateElicitationResult, McpError>> + Send + '_ {
// Default implementation declines all requests - real clients should override this
@ -225,7 +225,7 @@ macro_rules! impl_client_handler_for_wrapper {
fn create_message(
&self,
params: CreateMessageRequestParam,
params: CreateMessageRequestParams,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_ {
(**self).create_message(params, context)
@ -240,7 +240,7 @@ macro_rules! impl_client_handler_for_wrapper {
fn create_elicitation(
&self,
request: CreateElicitationRequestParam,
request: CreateElicitationRequestParams,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<CreateElicitationResult, McpError>> + Send + '_ {
(**self).create_elicitation(request, context)