modelcontextprotocol / modelcontextprotocol/java-sdk
Support parameter deserialisation to Java Objects using the MCPJsonMapper
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 3.7k
- Forks
- 1.1k
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Transporte nachzuverfolgen, die McpSchema.deserializeJsonRpcMessage(jsonMapper, string) aufrufen, und untersuche, wie MCPJsonMapper bereitgestellt wird. Ermittle, wie Transporte Java-Eingabetypen und Schemas akzeptieren können, und verifiziere anschließend, dass Anfrageeingaben in Java-Objekte deserialisiert werden und komplexe Ausgaben ohne zusätzliche Map-basierte Konvertierung serialisiert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100