Skip to content

[SEP-2356] File input support for tools and elicitation#1633

Draft
ochafik wants to merge 1 commit intomainfrom
claude/file-upload-sep-sdks-8Rub5
Draft

[SEP-2356] File input support for tools and elicitation#1633
ochafik wants to merge 1 commit intomainfrom
claude/file-upload-sep-sdks-8Rub5

Conversation

@ochafik
Copy link
Contributor

@ochafik ochafik commented Mar 5, 2026

Summary

Prototype implementation of the file input SEP for the TypeScript SDK. Adds types and runtime schemas for declarative file inputs on tools and elicitation forms, gated by a new fileInputs client capability.

SEP: modelcontextprotocol/modelcontextprotocol#2356

Note

This is a draft prototype tracking the spec proposal. It will be updated as the SEP evolves and should not be merged until the spec PR lands.

Changes

  • spec.types.ts — mirrors the spec additions:
    • ClientCapabilities.fileInputs?: object
    • Tool.inputFiles?: { [argName: string]: FileInputDescriptor }
    • ElicitRequestFormParams.requestedFiles?: { [fieldName: string]: FileInputDescriptor }
    • FileInputDescriptor interface (accept?: string[], maxSize?: number)
    • StringArraySchema added to PrimitiveSchemaDefinition union
  • types.ts — corresponding Zod runtime schemas (FileInputDescriptorSchema, StringArraySchemaSchema, field additions on ToolSchema, ElicitRequestFormParamsSchema, ClientCapabilitiesSchema)
  • Tests for schema parsing and spec-type mutual assignability

Implements declarative file input metadata so servers can tell clients which
tool arguments / elicitation form fields should receive a native file picker.

types.ts (Zod schemas):
- FileInputDescriptorSchema: { accept?: string[], maxSize?: number (int) }
- ToolSchema.inputFiles: z.record(string, FileInputDescriptor)
- ClientCapabilitiesSchema.fileInputs: capability gate
- StringArraySchemaSchema: new PrimitiveSchemaDefinition union member
- ElicitRequestFormParamsSchema.requestedFiles: symmetric for elicitation

spec.types.ts: matching TypeScript interfaces (surgical edits, pinned-commit conventions)
spec.types.test.ts: mutual-assignability checks + bumped type count 145→147
types.test.ts: 10 new validation tests for SEP types

Files are transmitted as RFC 2397 data URIs: data:<mediatype>;name=<filename>;base64,<data>

https://claude.ai/code/session_01JxhHWiXrXgE4JWC27dznRN
@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

⚠️ No Changeset found

Latest commit: bd662d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1633

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1633

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1633

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1633

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1633

commit: 4b70f80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants