modelcontextprotocol / modelcontextprotocol/python-sdk
Implement consistent structuredContent handling per specification clarification
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 24.3k
- Forks
- 4k
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 31
Beschreibung
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
structuredContentwhen 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:
- Implement the specified client behavior for
structuredContent - Ensure proper fallback to
contentwhen needed - Validate that servers populate both fields consistently
- Add tests to verify the correct behavior
- Ensure consistency with the TypeScript SDK implementation
References
- Specification issue: modelcontextprotocol/specification#1411
- TypeScript SDK issue: modelcontextprotocol/typescript-sdk#911
- Discord discussion: https://discord.com/channels/1358869848138059966/1411057080902746293
cc: @dsp-ant
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
Lesen Sie zuerst den Spezifikations-Issue modelcontextprotocol/specification#1411 und den verknüpften TypeScript-SDK-Issue; sie definieren das Verhalten, an das sich dieses Python SDK halten muss. Suchen Sie anschließend die Verarbeitung von Antworten des Python-Clients und -Servers und fügen Sie Tests für das präzisierte Verhalten von structuredContent hinzu. Als abgeschlossen gilt die Implementierung des angegebenen Fallbacks, die Validierung konsistenter Serverfelder und die Übereinstimmung mit dem TypeScript SDK.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, typescript
- Bereich
- api, backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100