You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Description
The MCP specification defines an optional
size?: numberfield on theResourceinterface (added in spec revision 2025-06-18, also present in 2025-11-25 and draft):The spec's JSON schema includes this field:
Resourceinterface hassize?: numberHowever, the TypeScript SDK's
ResourceSchemaZod definition in v1.27.0 does not includesize. The schema hasuri,description,mimeType,annotations,_meta,icons,name, andtitle— but nosize.Expected behavior
ResourceSchemashould include an optionalsizenumber 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
Environment
Note
This issue was written with the help of Claude Code (claude-opus-4-6).