modelcontextprotocol / modelcontextprotocol/python-sdk

Implement consistent structuredContent handling per specification clarification

Aperta
#1,332 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug enhancement needs decision P3 pending SEP approval
Lingua principale
Python
Stelle
24.3k
Fork
4k
Merge medio
1g 1h
PR unite (30g)
31

Descrizione

Summary

Following the specification issue modelcontextprotocol/specification#1411, the Python SDK needs to ensure consistent handling of structuredContent vs content fields in tool responses.

Problem

Currently there's inconsistency across MCP implementations:

  • Some clients use structuredContent when available (e.g., Cursor)
  • Others ignore it entirely
  • This leads to different behavior with the same servers

Current SDK Behavior

The Python SDK needs to be reviewed to ensure it properly handles the relationship between structuredContent and content fields.

Required Changes

Once modelcontextprotocol/specification#1411 is resolved, update the SDK to:

  1. Implement the specified client behavior for structuredContent
  2. Ensure proper fallback to content when needed
  3. Validate that servers populate both fields consistently
  4. Add tests to verify the correct behavior
  5. Ensure consistency with the TypeScript SDK implementation

References

cc: @dsp-ant

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Leggi prima l’issue della specifica modelcontextprotocol/specification#1411 e l’issue collegata del TypeScript SDK; definiscono il comportamento a cui questo Python SDK deve conformarsi. Poi individua la gestione delle risposte del client e del server Python e aggiungi test per il comportamento chiarito di structuredContent. Il lavoro è completato quando è stato implementato il fallback specificato, sono stati convalidati i campi coerenti del server e il risultato corrisponde al TypeScript SDK.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, typescript
Ambito
api, backend-api-design
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.