modelcontextprotocol / modelcontextprotocol/java-sdk
Support parameter deserialisation to Java Objects using the MCPJsonMapper
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 3.7k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
Expected Behavior
Although all the transports provided with the SDK require a jsonMapper they only deserialize inputs as Java maps.
It should be possible to specifiy the Java input types along with the schema so that the transports can deserialize into real Java objects
Same applies for output serialisation. Complex Java types cannot be used directly as output.
Current Behavior
Currently transports use the static method McpSchema.deserializeJsonRpcMessage(jsonMapper, <string>); that cannot be extended and does jsonMapper.readValue(jsonText, MAP_TYPE_REF);
Context
This would greatly simplify applying each request to real java methods with matching parameters. Without that an additional jackson deserialisation is necessary, making the first deserialisation to Map redundant. It's unnecessary code that each implementor must produce.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi các transport gọi McpSchema.deserializeJsonRpcMessage(jsonMapper, string) và kiểm tra cách MCPJsonMapper được cung cấp. Xác định cách các transport có thể chấp nhận các kiểu đầu vào và schema Java, sau đó xác minh rằng các đầu vào của request được deserialize thành các đối tượng Java và các đầu ra phức tạp được serialize mà không cần chuyển đổi bổ sung dựa trên Map.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100