Skip to content

Bug: list_commits and pull_request_read return top-level JSON array violating MCP schema specifications #3559

Open

Description

@srivera-ae

Describe the bug

When connecting to the official, hosted GitHub MCP server endpoint from a strict MCP client, calling the list_commits or pull_request_read (specifically for commit retrieval) tools results in an unhandled schema error.

The hosted server returns a raw, top-level JSON array [...]. However, per the Model Context Protocol (MCP) strict specifications, a tool's structuredContent payload must resolve to a valid JSON Object/Record (key-value map). Because the server returns a raw array instead of wrapping it (e.g., {"commits": [...]}), strict clients abort processing due to a validation schema mismatch.

Environment Context

  • MCP Server Endpoint: https://githubcopilot.com
  • Client Application: Claude Desktop for Mac
  • Client Version: Claude 3.6556.1 (8e298a) 2026-10-22T09:42:16.000Z

Steps to reproduce

  1. Configure Claude Desktop to connect to the hosted GitHub MCP gateway (https://githubcopilot.com).
  2. Request a tool invocation that fetches commit logs (e.g., list_commits).
  3. The client immediately throws a schema/validation error (expected record, received array) and refuses to parse the payload.

Raw Payload Sample (Truncated)

The actual response layout delivered by the tool bypasses object encapsulation:

[
  {
    "sha": "daacdcb5aecbea2b451b3412431f4b4bfaf2b21f",
    "html_url": "https://github.com",
    "commit": {
      "message": "Update technician/supervisor work order comments for CRS07 reviews..."
    }
  }
]

Expected behavior

The response array should be nested neatly inside a top-level parent object schema to remain compliant with standard MCP tool output rules:

{
  "commits": [
    {
      "sha": "daacdcb5aecbea2b451b3412431f4b4bfaf2b21f"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions