feat(core): SEP-2356 TransferModes field + Phase 3 upload-mode plan#398
Open
panyam wants to merge 1 commit into
Open
feat(core): SEP-2356 TransferModes field + Phase 3 upload-mode plan#398panyam wants to merge 1 commit into
panyam wants to merge 1 commit into
Conversation
… + 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core.FileInputTransferModetyped enum (constantsInline+Upload) and an optionalTransferModes []FileInputTransferModefield oncore.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 totransferModes: [\"upload\"]is well-formed but unsatisfiable by an mcpkit client today.TestExtractFileInputDescriptorTransferModesShapescovering the three input shapes ([]any,[]string,[]FileInputTransferMode). Phase 1 suite continues to pass.docs/SEP_2356_FILE_INPUTS_PLAN.mdwith 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.mdmcp-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.TransferModes: [\"inline\",\"upload\"]produces the expected JSON.{}.omitemptyontransferModesconfirmed via descriptor without the field.descriptorFromMapaccepts[]any(json.Unmarshal default),[]string, and[]FileInputTransferMode.Out of scope
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/getDownloadRPC methods, FileStore abstraction, HTTP upload endpoint, browser-side bridge upload. All deferred to Phase 3.pendingbranch stay as-is; upload scenarios get added when the wire shape stops moving.References