Skip to content

ResourceSchema missing size field from MCP spec #1573

@olaservo

Description

@olaservo

Description

The MCP specification defines an optional size?: number field on the Resource interface (added in spec revision 2025-06-18, also present in 2025-11-25 and draft):

size: The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. This can be used by Hosts to display file sizes and estimate context window usage.

The spec's JSON schema includes this field:

However, the TypeScript SDK's ResourceSchema Zod definition in v1.27.0 does not include size. The schema has uri, description, mimeType, annotations, _meta, icons, name, and title — but no size.

Expected behavior

ResourceSchema should include an optional size number field to match the MCP spec, allowing servers to declare resource sizes and enabling hosts to display file sizes / estimate context window usage.

Steps to reproduce

import { ResourceSchema } from "@modelcontextprotocol/sdk/types.js";

// The Resource type does not include a `size` field,
// even though the MCP spec defines one.

Environment

  • SDK version: 1.27.0 (also checked 1.26.0)
  • MCP spec revisions checked: 2025-06-18, 2025-11-25, draft

Note

This issue was written with the help of Claude Code (claude-opus-4-6).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions