Skip to content

Conversation

@mgoldsborough
Copy link

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:

  1. Parse the URL to guess the architecture (this is what we're doing now, but it's fragile with no standard format)
  2. Iterate through all packages and try each one (inefficient)

Solution

Add an optional architecture field 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

File Change
pkg/model/constants.go Add architecture constants (linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64, windows-arm64)
pkg/model/types.go Add optional Architecture field to Package struct
docs/reference/api/openapi.yaml Add architecture property to Package schema
docs/reference/server-json/server.schema.json Auto-regenerated

Example 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:

for _, pkg := range server.Packages {
    if pkg.Architecture == runtime.GOOS + "-" + runtime.GOARCH {
        return pkg // Found matching package
    }
}

Test plan

  • Verify make check passes
  • Review generated schema includes new field with examples

Add optional `architecture` field to Package for specifying target
OS and architecture (e.g., 'linux-amd64', 'darwin-arm64'). This allows
clients to select the appropriate package for their platform without
parsing identifiers.

Primarily useful for MCPB packages that provide platform-specific binaries.
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