Skip to content

fix: support Claude MCP protocol 2026-07-28 - #333

Merged
dodeja merged 8 commits into
mainfrom
cursor/claude-mcp-protocol-eac8
Aug 21, 2026
Merged

fix: support Claude MCP protocol 2026-07-28#333
dodeja merged 8 commits into
mainfrom
cursor/claude-mcp-protocol-eac8

Conversation

@dodeja

@dodeja dodeja commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • migrate the public Terminal49 MCP server from the v1 monolith to the official v2 server and Node packages
  • accept 2026-07-28 while preserving every previously advertised revision: 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05, and 2024-10-07
  • preserve all 10 tools, 3 prompts, 4 resource surfaces, OAuth/WorkOS behavior, conservative tool annotations, and prompt completion behavior
  • allow the modern Mcp-Method and Mcp-Name request headers

Protocol compatibility CI

  • runs a six-entry in-process matrix against the built server for every supported revision
  • waits for Vercel success on the PR head commit and correlates the Vercel comment to that commit's deployment inspector URL before selecting the preview endpoint
  • re-verifies the same deployment correlation after the smoke request so a concurrent deployment cannot produce a false green result
  • gates authenticated preview jobs to same-repository, non-Dependabot PRs and skips smoke steps with a notice when MCP_EVAL_TOKEN is unavailable
  • preview checks POST server/discover for 2026-07-28 (the required modern equivalent; modern MCP has no initialize handshake) and initialize for 2025-11-25
  • authenticated preview checks call tools/list and require exactly 10 public tools

Regression coverage

  • verifies carrier completion values through the public MCP completion/complete path on 2026-07-28: m returns MAEU and MSCU, ma returns MAEU
  • verifies completion API failures still degrade to an empty suggestion list
  • verifies every protocol revision receives the complete tools/prompts/resources lists and unchanged annotations

Fixes 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.

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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.

  • Replaces the v1 HTTP and stdio transports with v2 handlers.
  • Converts tool and prompt registrations to v2 Zod object schemas.
  • Adds protocol compatibility tests and preview-deployment smoke checks.
  • Updates observability integrations, dependencies, and CORS headers for the modern protocol.

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

Filename Overview
api/mcp.ts Migrates the authenticated Vercel gateway from the v1 transport to a per-request v2 MCP handler while retaining existing security and cleanup paths.
packages/mcp/src/server.ts Migrates server registrations and stdio serving to the v2 API while preserving the ten tools, three prompts, resources, and completion behavior.
.github/workflows/ci.yml Adds local and deployed protocol matrices, but the preview URL lookup is not tied to the commit whose deployment status was validated.
packages/mcp/src/protocol-compat.test.ts Exercises the complete MCP surface across the modern protocol and all five retained legacy revisions.
packages/mcp/package.json Replaces the v1 MCP SDK dependency with official v2 client, server, and Node packages and adds protocol smoke scripts.

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 response
Loading

Fix all with Greploop Fix All in Codex Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
.github/workflows/ci.yml:206-208
**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.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: resolve Vercel preview URL with jq" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (3)

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>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api Ready Ready Preview Aug 21, 2026 4:13am

Request Review

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>
@dodeja
dodeja marked this pull request as ready for review August 21, 2026 01:38
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +206 to +208
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')"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Codex Fix in Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/ci.yml Outdated

mcp-preview-protocol:
name: MCP preview ${{ matrix.protocol-version }}
if: github.event_name == 'pull_request'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@vorflux vorflux Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. The preview URL is selected independently of PREVIEW_SHA, so a workflow can test a different commit's deployment.
  2. The preview jobs always require MCP_EVAL_TOKEN, which is unavailable to fork and Dependabot pull-request workflows.

Verdict

⚠️ Changes requested. The preview checks can both report against the wrong deployment and fail valid external contributions because their required secret is unavailable.


Review with Vorflux

Comment thread .github/workflows/ci.yml
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
preview_url="$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml
- name: POST handshake and tools/list to Vercel preview
env:
MCP_HTTP_ENDPOINT: ${{ steps.preview.outputs.endpoint }}
MCP_HTTP_TOKEN: ${{ secrets.MCP_EVAL_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@dodeja
dodeja merged commit 1117f0a into main Aug 21, 2026
22 checks passed
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.

2 participants