fix: support Claude MCP protocol 2026-07-28 - #333
Conversation
Migrate the public MCP endpoint to the official v2 dual-era handler while preserving stateless 2025 protocol support.\n\nFixes MCP-SERVER-E Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
| preview_url="$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" \ | ||
| --paginate \ | ||
| --jq '[.[] | select(.user.login == "vercel[bot]" or .user.login == "vercel")][-1].body | capture("\\[Preview\\]\\((?<url>https://[^)]+\\.vercel\\.app)\\)").url')" |
There was a problem hiding this comment.
Preview URL lacks commit correlation
If a pull request has multiple Vercel deployments or its deployment comment changes during the workflow, this step selects the latest Vercel bot comment without matching it to PREVIEW_SHA, so the protocol checks can run against a stale or newer deployment and report the wrong result for the reviewed commit.
Knowledge Base Used: Repo Tooling and CI
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 206-208
Comment:
**Preview URL lacks commit correlation**
If a pull request has multiple Vercel deployments or its deployment comment changes during the workflow, this step selects the latest Vercel bot comment without matching it to `PREVIEW_SHA`, so the protocol checks can run against a stale or newer deployment and report the wrong result for the reviewed commit.
**Knowledge Base Used:** [Repo Tooling and CI](https://app.greptile.com/terminal49/-/custom-context/knowledge-base/terminal49/api/-/docs/repo-tooling-ci.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d517c18ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| mcp-preview-protocol: | ||
| name: MCP preview ${{ matrix.protocol-version }} | ||
| if: github.event_name == 'pull_request' |
There was a problem hiding this comment.
Skip preview checks for forked pull requests
For pull requests originating from forks, GitHub does not expose MCP_EVAL_TOKEN, but this condition runs the preview matrix for every pull request. Consequently, http-protocol-smoke.mjs throws because MCP_HTTP_TOKEN is empty, making both preview jobs fail for every external contribution. Gate this job to same-repository branches or skip it when the secret is unavailable.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
Reviewed — found 2 issues. This change migrates the MCP server to the v2 SDK packages, adds compatibility for protocol 2026-07-28 alongside existing protocol revisions, and introduces local and Vercel-preview protocol smoke checks. I reviewed the implementation with particular attention to compatibility behavior and the reliability of the new CI coverage.
Findings
.github/workflows/ci.yml
- The preview URL is selected independently of
PREVIEW_SHA, so a workflow can test a different commit's deployment. - The preview jobs always require
MCP_EVAL_TOKEN, which is unavailable to fork and Dependabot pull-request workflows.
Verdict
| GH_TOKEN: ${{ github.token }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| preview_url="$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" \ |
There was a problem hiding this comment.
Issue: This selects the latest Vercel bot comment independently of PREVIEW_SHA. If commit B is pushed while commit A's workflow is still running, A can wait for its own successful deployment and then execute the smoke test against B's preview URL, allowing A's check to pass without exercising A's gateway. Resolve the deployment URL from PREVIEW_SHA, or verify the selected deployment's source SHA before testing it.
| - name: POST handshake and tools/list to Vercel preview | ||
| env: | ||
| MCP_HTTP_ENDPOINT: ${{ steps.preview.outputs.endpoint }} | ||
| MCP_HTTP_TOKEN: ${{ secrets.MCP_EVAL_TOKEN }} |
There was a problem hiding this comment.
Issue: MCP_EVAL_TOKEN is not exposed to pull_request workflows from forks or Dependabot, while http-protocol-smoke.mjs throws when MCP_HTTP_TOKEN is empty. Because this job runs for every pull request, valid external contributions will fail both matrix jobs. Gate this smoke check when the credential is unavailable, or move trusted preview validation to a protected follow-up workflow that does not execute untrusted PR code with secrets.
Co-authored-by: Akshay Dodeja <dodeja@gmail.com>
Summary
2026-07-28while preserving every previously advertised revision:2025-11-25,2025-06-18,2025-03-26,2024-11-05, and2024-10-07Mcp-MethodandMcp-Namerequest headersProtocol compatibility CI
MCP_EVAL_TOKENis unavailableserver/discoverfor2026-07-28(the required modern equivalent; modern MCP has noinitializehandshake) andinitializefor2025-11-25tools/listand require exactly 10 public toolsRegression coverage
completion/completepath on2026-07-28:mreturnsMAEUandMSCU,mareturnsMAEUFixes MCP-SERVER-E
Claude store launch remains blocked until this change is deployed to production. This PR intentionally excludes the separate 5+3 reviewer tool suite.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Greptile Summary
This PR migrates the public MCP gateway and server to the official v2 packages, adding the 2026-07-28 protocol while preserving legacy revisions and the existing MCP surface.
Confidence Score: 4/5
The PR appears safe to merge, with a non-blocking CI reliability issue where preview checks can target a deployment unrelated to the workflow commit.
The production migration has broad protocol and surface coverage, while the accepted concern is limited to commit correlation in the newly added preview validation job.
Files Needing Attention: .github/workflows/ci.yml
Important Files Changed
Sequence Diagram
sequenceDiagram participant C as MCP Client participant G as Vercel MCP Gateway participant H as MCP v2 Handler participant S as Terminal49 MCP Server participant A as Terminal49 API C->>G: POST /mcp + protocol version G->>G: Validate host, origin, and authorization G->>H: Dispatch Node request H->>S: Create per-request server alt Modern 2026-07-28 C->>H: server/discover else Legacy revision C->>H: initialize end C->>H: tools/list or tool call H->>S: Invoke registered operation S->>A: Authenticated API request A-->>S: Result S-->>H: MCP result H-->>C: JSON responsePrompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: resolve Vercel preview URL with jq" | Re-trigger Greptile
Context used (3)
@terminal49/mcp)