feat: add architecture field to Package #865
Open
+34
−0
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.
Problem
When publishing MCPB packages that support multiple architectures, authors must create separate Package entries for each OS/architecture combination. Currently, clients have no standardized way to determine which package is appropriate for their platform without parsing the identifier URL.
For example, a server with Linux AMD64 and ARM64 builds requires two packages:
{ "packages": [ { "registryType": "mcpb", "identifier": "https://github.com/NimbleBrainInc/mcp-echo/releases/download/v0.1.0/mcp-echo-v0.1.0-linux-amd64.mcpb", "version": "0.1.0", "fileSha256": "26ef091c...", "transport": { "type": "streamable-http", "url": "http://localhost:8000/mcp" }, "environmentVariables": [...] }, { "registryType": "mcpb", "identifier": "https://github.com/NimbleBrainInc/mcp-echo/releases/download/v0.1.0/mcp-echo-v0.1.0-linux-arm64.mcpb", "version": "0.1.0", "fileSha256": "c5941f02...", "transport": { "type": "streamable-http", "url": "http://localhost:8000/mcp" }, "environmentVariables": [...] } ] }Clients must currently either:
Solution
Add an optional
architecturefield to the Package type that explicitly declares the target OS and architecture using the{os}-{arch}format (e.g.,linux-amd64,darwin-arm64).This follows the convention used by Go (
GOOS-GOARCH), Docker, and other package ecosystems.Changes
pkg/model/constants.golinux-amd64,linux-arm64,darwin-amd64,darwin-arm64,windows-amd64,windows-arm64)pkg/model/types.goArchitecturefield toPackagestructdocs/reference/api/openapi.yamlarchitectureproperty to Package schemadocs/reference/server-json/server.schema.jsonExample Usage
{ "packages": [ { "registryType": "mcpb", "architecture": "linux-amd64", "identifier": "https://github.com/.../mcp-echo-v0.1.0-linux-amd64.mcpb", "version": "0.1.0", "fileSha256": "26ef091c...", "transport": { "type": "streamable-http", "url": "http://localhost:8000/mcp" } }, { "registryType": "mcpb", "architecture": "linux-arm64", "identifier": "https://github.com/.../mcp-echo-v0.1.0-linux-arm64.mcpb", "version": "0.1.0", "fileSha256": "c5941f02...", "transport": { "type": "streamable-http", "url": "http://localhost:8000/mcp" } } ] }Clients can now filter packages directly:
Test plan
make checkpasses