Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove usages of [JsonIgnore] in JSON DTOs #763

@halter73

Description

@halter73

Currently, most of the server capabilities DTOs have [JsonIgnore]'d handlers on them. I know @jozkee is looking into reorganizing McpServerOptions and moving the handlers out of the capabilities objects, so that might be taken care of soon.

There's also the RelatedTransport, ExecutionContext and ClaimsPrincipal that get [JsonIgnore]'d on JsonRpcMessage (via the JsonRpcMessageContext starting in #733). For this we'll probably want to change the ITransport interface to not return the JsonRpcMessage directly, but instead some wrapper type. We no have a similar issue with the IMcpServerPrimitives returned by various server side handlers as pointed out on #733 (comment). This will probably require changing the signature of the handlers to return a wrapper around the DTO that gets serialized to the wire.

Given the similarity of these issues, particularly the additional context needed by JsonRpcMessage and the TResults in McpRequestHandler<TParams, TResult>, I think we should address these together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions