modelcontextprotocol / modelcontextprotocol/typescript-sdk

Implement consistent structuredContent handling per specification clarification

Open
#911 0 comments 1 reaction 1 assignee View on GitHub

@dsp-ant is already working on this.

Since Sep 1, 2025.

bug enhancement needs decision P3 pending SEP approval
Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
4

Description

Summary

Following the specification issue modelcontextprotocol/specification#1411, the TypeScript 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 TypeScript SDK has validation implemented: https://github.com/modelcontextprotocol/typescript-sdk/blob/3dd074f8a25b92994e0e8cc69d3ffe9112a1f32b/src/client/index.ts#L442-L475

However, the handling needs to align with the specification clarification.

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

References

cc: @dsp-ant

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.