Skip to content

feat(core): SEP-2356 TransferModes field + Phase 3 upload-mode plan#398

Open
panyam wants to merge 1 commit into
mainfrom
feat/sep-2356-transfer-modes
Open

feat(core): SEP-2356 TransferModes field + Phase 3 upload-mode plan#398
panyam wants to merge 1 commit into
mainfrom
feat/sep-2356-transfer-modes

Conversation

@panyam

@panyam panyam commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Code: add core.FileInputTransferMode typed enum (constants Inline + Upload) and an optional TransferModes []FileInputTransferMode field on core.FileInputDescriptor, aligning the descriptor with SEP-2631's 2026-05-07 harmonize commit (modelcontextprotocol/specification PR 2631 commit 41517ea). Forward-compat plumbing only — the validator still only validates inline data URIs, and a descriptor restricting to transferModes: [\"upload\"] is well-formed but unsatisfiable by an mcpkit client today.
  • Tests: extend the marshal round-trip case + add TestExtractFileInputDescriptorTransferModesShapes covering the three input shapes ([]any, []string, []FileInputTransferMode). Phase 1 suite continues to pass.
  • Plan doc: add Phase 3 — upload-mode transfer to docs/SEP_2356_FILE_INPUTS_PLAN.md with the implementation layer breakdown and 10 open design questions for the WG (covering FileValue scope, transfer-mode selection, capability layering, file URI scheme, storage lifetime, upload auth, streaming, error reasons, cap gating).
  • Capabilities surface: CAPABILITIES.md mcp-file-inputs-experimental row updated to list the new field.

Why now

SEP-2631 is OPEN and still iterating. The descriptor-shape changes from the harmonize commit are stable enough to track today (the field name lock — transferModes, the enum values — inline / upload, and the omit-when-unset semantics). The protocol-side parts (files/prepareUpload, storage abstraction, HTTPS upload endpoint) are precisely what the SEP says least about and stays deferred — the Phase 3 section captures the layer breakdown so the work can pick up cleanly when 2631 lands.

The Phase 3 design-questions section is structured to seed WG-facing engagement: each question records mcpkit's recommendation grounded in the existing surface, so the conversation has concrete starting points rather than blank slates.

Test plan

  • go test ./core/ -count=1 — green.
  • Marshal round-trip with TransferModes: [\"inline\",\"upload\"] produces the expected JSON.
  • Empty descriptor still serializes to {}.
  • omitempty on transferModes confirmed via descriptor without the field.
  • descriptorFromMap accepts []any (json.Unmarshal default), []string, and []FileInputTransferMode.
  • All pre-existing Phase 1 tests (validator, schema-helper, capability gating, strip-keyword, JSON round-trip) still pass.

Out of scope

  • Validator enforcement of TransferModes (rejecting inline values when descriptor restricts to ["upload"], etc.). Lands as part of Phase 3 when upload mode is implemented end-to-end.
  • ClientCapabilities.Files.{Upload,Download} cap fields, files/prepareUpload / files/getDownload RPC methods, FileStore abstraction, HTTP upload endpoint, browser-side bridge upload. All deferred to Phase 3.
  • Updating mcpconformance with upload-mode scenarios. Inline scenarios on the pending branch stay as-is; upload scenarios get added when the wire shape stops moving.

References

  • modelcontextprotocol/specification PR 2356 (SEP-2356, in-review)
  • modelcontextprotocol/specification PR 2631 (SEP-2631, OPEN, in-flux)
  • mcpkit issue 313 (SEP-2356 umbrella)

… + Phase 3 plan

Brings core.FileInputDescriptor in line with the post-harmonize SEP-2356
+ SEP-2631 wire shape (PR 2631 commit 41517ea, 2026-05-07). Adds a typed
FileInputTransferMode enum (constants Inline + Upload) and an optional
TransferModes []FileInputTransferMode field on the descriptor, with an
omitempty JSON tag.

This is forward-compat plumbing only. The validator still only validates
inline data URIs; a descriptor restricting to transferModes ["upload"]
is well-formed but cannot be satisfied by an mcpkit client today. The
constant for upload mode exists so callers can name it; the
implementation lands when SEP-2631 stabilizes (see new Phase 3 section
in docs/SEP_2356_FILE_INPUTS_PLAN.md for the layer breakdown and the
WG-facing open design questions).

descriptorFromMap learns to pull "transferModes" from incoming JSON in
all three shapes the API surfaces in practice ([]any from
json.Unmarshal, []string from typed callers, []FileInputTransferMode
when descriptors are constructed in Go).

Tests: extend the marshal round-trip case in TestFileInputDescriptorJSON
with the new field and an omitempty assertion; add
TestExtractFileInputDescriptorTransferModesShapes to cover the three
input shapes; extend TestExtractFileInputDescriptorFromJSON. All Phase 1
tests continue to pass (core suite green).

CAPABILITIES.md surface listing for mcp-file-inputs-experimental updated
to mention the new field.
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.

1 participant