modelcontextprotocol / modelcontextprotocol/java-sdk
Support parameter deserialisation to Java Objects using the MCPJsonMapper
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 3.7k
- Fork
- 1.1k
- Merge medio
- 1g 15h
- PR unite (30g)
- 9
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando i trasporti che chiamano McpSchema.deserializeJsonRpcMessage(jsonMapper, string) e analizza come viene fornito MCPJsonMapper. Determina come i trasporti possano accettare tipi di input e schemi Java, quindi verifica che gli input delle richieste vengano deserializzati in oggetti Java e che gli output complessi vengano serializzati senza una conversione aggiuntiva basata su Map.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100