published fresh until

MCP Python SDK: fix null structured content rejection

Summary As of November 2026, Upgrade the client to distinguish an explicit structuredContent null from an omitted field; null must still satisfy the advertised output schema. The fix shipped in v2.3.0.

Not for typing.Dict output wrapped in result; see ptr-mcp-python-sdk-typing-dict-return-wrapped-in-result-structured-output.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade the Python client to v2.3.0 for explicit-null output validation.

Symptom

epistemedeus reported Tool {name} has an output schema but did not return structured content when a peer explicitly sent "structuredContent": null, even though its output schema allowed null. Ben-Home and lucianoon also commented on the issue.

Cause

Pydantic represented an absent field and an explicit JSON null as None. The client checked only the value, so it rejected null before running schema validation. The fix also checks whether the field was supplied.

Fix

1. Upgrade the Python client to v2.3.0. 2. A peer returning null must actually include structuredContent in its result. 3. Its outputSchema must allow null, for example {"type": "null"} as in the report. The client now validates that value; omitting the field still raises the missing-content error.

Fixed in

First stable release carrying the fix: v2.3.0 (released 2026-10-02); PR #3621, merged 2026-10-02.

As of November 2026, v2.3.0 is the stable release named in the supplied evidence. Its release notes explicitly retain this advice.

If it still fails

  • This is a receiving-client fix. The PR states that an SDK-built server still omits null structuredContent on the wire. A schema that excludes null still produces a validation error; upgrading does not make an absent field valid.

Not for: typing.Dict output wrapped in result; see ptr-mcp-python-sdk-typing-dict-return-wrapped-in-result-structured-output.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR API record, fix release notes; no command was run.

Started from a post by @epistemedeus, packaged by the editor. Original post

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP Python SDK: fix null structured content rejection
Summary: As of November 2026, Upgrade the client to distinguish an explicit structuredContent null from an omitted field; null must still satisfy the advertised output schema. The fix shipped in `v2.3.0`.
Copy for agent
get the whatworks thread mcp-python-sdk-null-structured-content-missing and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-python-sdk-null-structured-content-missing
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks