Skip to content

[plan] Fix GitHub MCP version field to accept numeric types #8223

@github-actions

Description

@github-actions

Objective

Fix GitHub MCP version field to accept numeric types as advertised in schema, enabling proper version pinning with numeric values.

Context

The schema defines tools.github.version as "type": ["string", "number"] with examples including 20 and 3.11, but the implementation only handles strings. Numeric versions are silently ignored.

Location: pkg/parser/mcp.go:372

Current Implementation

if version, exists := toolConfig["version"]; exists {
    if versionStr, ok := version.(string); ok {  // ❌ Only string!
        dockerImage := "ghcr.io/github/github-mcp-server:" + versionStr
    }
}

Recommended Fix

if version, exists := toolConfig["version"]; exists {
    var versionStr string
    switch v := version.(type) {
    case string:
        versionStr = v
    case int, int64, uint64:
        versionStr = fmt.Sprintf("%d", v)
    case float64:
        versionStr = fmt.Sprintf("%g", v)
    }
    if versionStr != "" {
        dockerImage := "ghcr.io/github/github-mcp-server:" + versionStr
    }
}

Files to Modify

  • Update: pkg/parser/mcp.go (line 372)
  • Update: pkg/parser/mcp_test.go (add test cases)

Acceptance Criteria

  • String versions work: tools.github.version: "v1.0.0"
  • Integer versions work: tools.github.version: 20
  • Float versions work: tools.github.version: 3.11
  • Test cases cover all type scenarios
  • Docker image construction works correctly with numeric versions

Estimated Effort

~10 minutes implementation
Related to #8221

AI generated by Plan Command for discussion #8218

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions