Skip to content

[Schema] SEP-2106: Allow non-object outputSchema and structuredContent (arrays/primitives) #357

@chr-hertel

Description

@chr-hertel

Implements the non-object output portion of SEP-2106 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec summary

outputSchema fully drops the object-only restriction and accepts arrays/primitives/compositions. structuredContent widens from {[key:string]: unknown} to unknown, validated by outputSchema.

PHP SDK changes

  • The outputSchema path (today the formatters in src/Capability/Formatter/) must accept array/scalar return types without object wrapping.
  • Ensure structuredContent serialization handles non-object roots.
  • Continue emitting the back-compat TextContent mirror when output is array/primitive (verify against spec).
  • Client-side: Mcp\Client tool-listing types currently assume object-shaped structured content — relax type narrowing.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28All issues and PRs related to the spec release 2026-07-28P1Significant bug affecting many users, highly requested featureSchemaIssues & PRs related to the Schema componentenhancementRequest for a new feature that's not currently supportedimproves spec complianceImproves consistency with other SDKs such as TyepScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions