Describe the bug
The github-mcp-server is incompatible with OpenAI models (like gpt-4.1 and gpt-4o-mini) that use function/tool calling. The OpenAI API requires tool parameter schemas to explicitly include "additionalProperties": false at the top level. Most tools generated by github-mcp-server are missing this property in their schema, causing API requests to fail with a 400 Bad Request error. This prevents the server from being used effectively with OpenAI-based clients.
Affected version
GitHub MCP Server
Version: v0.2.1
Commit: 9fa582d8d63522d70ce8f3af58265effb9645323
Build Date: 2025-04-21T23:03:01Z
Steps to reproduce the behavior
- Run the
ghcr.io/github/github-mcp-server:v0.2.1 Docker image (or build from source commit 9fa582d) with a valid GITHUB_PERSONAL_ACCESS_TOKEN.
- Configure an MCP client to use this server with an OpenAI model that supports function/tool calling (e.g.,
gpt-4.1-nano).
- Attempt to invoke a tool like
add_issue_comment or get_pull_request through the client.
- Observe the error returned by the OpenAI API (either in server logs or client response).
Expected vs actual behavior
Expected: The tool call should be successfully sent to the OpenAI model, and the model should be able to invoke the tool using the provided schema.
Actual: The OpenAI API rejects the tool call with a 400 Bad Request error because the schema is invalid. The specific error indicates that additionalProperties is required and must be false in the tool's parameter schema.
Logs
Example OpenAI Error Log:
ERROR API status error from OpenAI API: Error code: 400 - {'error': {'message': "Invalid schema for function 'add_issue_comment': In context=(), 'additionalProperties' is required to be supplied and
to be false.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}}
WARNING Attempt 1/1 failed: Invalid schema for function 'add_issue_comment': In context=(), 'additionalProperties' is required to be supplied and to be false.
Additional Context:
The root cause appears to be the schema generation logic within the underlying mcp-go framework (github.com/mark3labs/mcp-go), which doesn't add the required additionalProperties: false property to the top-level parameter object for most tools defined via mcp.NewTool.
It's worth noting that while tools like PushFiles (repositories.go) and CreatePullRequestReview (pullrequests.go) correctly define additionalProperties: false for the schema of items within their specific array parameters (using mcp.Items), this specific fix doesn't apply to the top-level parameters object of those tools, nor does it apply to the simpler tools (like add_issue_comment) that lack such nested structures. The core issue remains the generation of the main tool parameter schema required by the OpenAI API.
A fix within the mcp-go framework seems necessary for broad compatibility.
Describe the bug
The
github-mcp-serveris incompatible with OpenAI models (likegpt-4.1andgpt-4o-mini) that use function/tool calling. The OpenAI API requires tool parameter schemas to explicitly include"additionalProperties": falseat the top level. Most tools generated bygithub-mcp-serverare missing this property in their schema, causing API requests to fail with a400 Bad Requesterror. This prevents the server from being used effectively with OpenAI-based clients.Affected version
Steps to reproduce the behavior
ghcr.io/github/github-mcp-server:v0.2.1Docker image (or build from source commit9fa582d) with a validGITHUB_PERSONAL_ACCESS_TOKEN.gpt-4.1-nano).add_issue_commentorget_pull_requestthrough the client.Expected vs actual behavior
Expected: The tool call should be successfully sent to the OpenAI model, and the model should be able to invoke the tool using the provided schema.
Actual: The OpenAI API rejects the tool call with a
400 Bad Requesterror because the schema is invalid. The specific error indicates thatadditionalPropertiesis required and must befalsein the tool's parameter schema.Logs
Example OpenAI Error Log:
Additional Context:
The root cause appears to be the schema generation logic within the underlying
mcp-goframework (github.com/mark3labs/mcp-go), which doesn't add the requiredadditionalProperties: falseproperty to the top-level parameter object for most tools defined viamcp.NewTool.It's worth noting that while tools like
PushFiles(repositories.go) andCreatePullRequestReview(pullrequests.go) correctly defineadditionalProperties: falsefor the schema of items within their specific array parameters (usingmcp.Items), this specific fix doesn't apply to the top-level parameters object of those tools, nor does it apply to the simpler tools (likeadd_issue_comment) that lack such nested structures. The core issue remains the generation of the main tool parameter schema required by the OpenAI API.A fix within the
mcp-goframework seems necessary for broad compatibility.