Skip to content

fix(github-mcp): vendor bash-mcp-sdk v2.0.0 to enforce union types - #5

Merged
Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
chore/bash-mcp-sdk-v2
Sep 2, 2026
Merged

fix(github-mcp): vendor bash-mcp-sdk v2.0.0 to enforce union types#5
Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
chore/bash-mcp-sdk-v2

Conversation

@SpiGAndromeda

@SpiGAndromeda Martin Bens (SpiGAndromeda) commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Bumps the vendored protocol handler from shopwareLabs/bash-mcp-sdk v1.0.0 to v2.0.0 and corrects the two places in the docs that named the old pin.

Why

Every numeric identifier parameter across tools-read.json and tools-write.json declares "type": ["integer", "string"], because clients send an issue or PR number both ways. v1.0.0 of the SDK read a list-valued type as no constraint at all — the validator's type check selected on ($t | type) == "string" and skipped everything else — so those 37 parameters were unvalidated. A boolean or a float reached gh untouched.

v2.0.0 normalizes a declared type to a list and accepts a value that matches any member, on a property and on items.type alike. A list that is empty or holds a non-string member is treated as malformed and left unenforced rather than rejecting everything.

What changes for callers

Call Before After
issue_view {"number": 339} accepted accepted
issue_view {"number": "339"} accepted accepted
issue_view {"number": true} accepted, passed to gh isError: number expected integer or string, got boolean
issue_view {"number": 3.5} accepted, passed to gh isError: number expected integer or string, got number (non-integer)

The SDK calls this a major release for that reason. In this repository the rejected shapes are calls no client makes deliberately, and the stricter-validation entry it extends is still under [Unreleased], so no version bump accompanies it.

Contents

  • .mcp-sdk.lockv2.0.0, and plugins/github-mcp/shared/mcpserver_core.sh re-vendored by .github/scripts/vendor-mcp-sdk.sh. The file is byte-identical to lib/mcpserver_core.sh at that tag; the validator is the only thing that moved between the two releases.
  • plugins/github-mcp/CHANGELOG.md: the [Unreleased] entry named v1.0.0 and stated that the pinned SDK does not enforce array-valued types. Both are now false, so the entry says what v2.0.0 does instead.
  • plugin-tests/github-mcp/tool_schemas.bats: the "default satisfies the constraints declared beside it" check only looked at string-valued type, so a default on a union-typed property skipped it entirely. It now normalizes the declaration the same way the validator does. No shipped schema has such a default today — this keeps a future one from slipping past.
  • plugins/github-mcp/AGENTS.md: External References pointed at muthuishere/mcp-server-bash-sdk, which the vendoring superseded. It now names the SDK the file actually comes from and the lock that pins it.

No test was added for the union enforcement itself. That is the SDK's own behavior and it is covered by tests/mcp_argument_validation.bats upstream; this repository tests the seam, not its dependency.

Every numeric identifier parameter in tools-read.json and tools-write.json declares `"type": ["integer", "string"]` so clients can send an issue or PR number either way. The pinned SDK v1.0.0 read a list-valued `type` as no constraint at all, so those 37 parameters accepted any value — a boolean, a float — and passed it straight to gh. v2.0.0 checks the value against each alternative and rejects one that matches none, naming both: `number expected integer or string, got boolean`.

The tool schemas already ship the shape v2.0.0 wants, so nothing in mcp-server-gh changes. The schema suite's "default satisfies its own schema" check normalizes a list-valued `type` the same way, so a future union-typed default cannot slip past it, and the External References entry now points at the SDK this server actually vendors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@SpiGAndromeda
Martin Bens (SpiGAndromeda) merged commit 4b694a5 into main Sep 2, 2026
1 check passed
@SpiGAndromeda
Martin Bens (SpiGAndromeda) deleted the chore/bash-mcp-sdk-v2 branch September 2, 2026 23:16
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