Skip to content

fix(mcp): hosted targetUrl note, Discord key checks, formatted skill bundle, mcp 2.4.2 - #727

Merged
kroqdotdev merged 5 commits into
mainfrom
fix/mcp-review-followups
Nov 15, 2026
Merged

kroqdotdev merged 5 commits into
mainfrom
fix/mcp-review-followups

Conversation

@kroqdotdev

@kroqdotdev kroqdotdev commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Follow-ups to #726.

Changes

  • Hosted targetUrl note (apps/web/lib/mcp/hosted.ts). The hosted schemas of render_email and test_webhook_flow no longer list targetUrl, so a client with an older tools/list that still passes it used to get a silent success. The SDK hands tool callbacks only parsed arguments, so the hosted adapter registers those two tools with a Standard Schema wrapper around the same Zod object (same JSON Schema in tools/list). The wrapper marks a call whose raw arguments carry targetUrl before the object schema drops it. The result then gets a note saying nothing was posted and that posting to your own URL needs the local server (npx -y @webhooks-cc/mcp). TARGET_URL_TOOLS is now exported from @webhooks-cc/mcp/tools, so the list exists once.
  • Discord public key checked on create_endpoint (packages/mcp/src/tools.ts). A key that is not 64 hex characters is refused before anything is created. Other update failures still return the endpoint with a warning.
  • Discord public key checked on PATCH /api/endpoints/{slug} (apps/web/app/api/endpoints/[slug]/route.ts, apps/web/lib/signing-config.ts). When the endpoint's provider is or becomes discord and a new credential is sent, the route refuses one that is not exactly 64 hex characters, with the same message as the MCP check. That covers update_endpoint, the dashboard, the CLI and every SDK, with no SDK release. The web check is signingCredentialProblem() beside the route's other signing validators. The MCP package keeps its own copy because it cannot import web code; each copy has a comment pointing at the other, and a web unit test checks that both answer alike.
  • Dashboard trims only a Discord key (apps/web/components/dashboard/endpoint-settings-panel.tsx, normalizeSigningCredential() in apps/web/lib/signing-config.ts). The panel trims a Discord public key before saving, as the receiver does, so a key pasted with a stray space is not refused. Every other credential is sent exactly as typed, because HMAC secrets are used byte for byte. The panel computes the value once and uses it for its dirty state, its missing-credential check and the update, so a whitespace-only Discord key gets the panel's own message without a round trip. The route stays strict.
  • Formatted skill bundle (packages/mcp/scripts/bundle-skill.mjs). The script resolves the workspace's Prettier, applies the repository config through prettier.resolveConfig, and formats src/skill-files.ts before writing it. A regenerated copy passes prettier --check with no manual step. The staleness test compares file contents, so it is unaffected.
  • Instructions test (apps/web/lib/mcp/hosted.test.ts). The test parses the group list after "beside core:" (parenthesised notes removed) and compares it with TOOL_GROUP_NAMES minus core, both ways. A missing, extra or renamed group fails. The toolSelection check stays.
  • MCP 2.4.2 (package.json, both server.json fields, MCP_VERSION, an MCP-track entry). Web changelog file mcp-target-url-note.json.

Tests

  • hosted-app.test.ts: render_email and test_webhook_flow still list the rest of their input schemas (render_email requires requestId and format), so a wrapper that lost the JSON Schema fails. A render_email call with targetUrl posts nothing there and carries the note. A test_webhook_flow call with targetUrl runs the whole flow against URL-routed mocks (create, capture, poll, clean up), reaches nothing at targetUrl and carries the note; with the hosted targetUrl filter turned off, this test fails. a call without it, or one the schema refuses (no requestId), has no note, and the refused one fetches nothing.
  • tools.test.ts: malformed Discord keys (too short, non-hex, 63 characters, leading space, trailing newline) are refused with neither create nor update called; a well-formed key is created and saved; the warning path is covered with a non-Discord provider.
  • route.test.ts: a malformed Discord key is refused with the shared message and nothing is saved, whether the provider is set in the same request or already Discord; a well-formed key is saved.
  • signing-config.test.ts: normalizeSigningCredential() trims a Discord key and keeps " s3cret " as is for generic-hmac (and Stripe). The web check refuses malformed keys (65 characters and a trailing newline included), leaves other providers alone, and answers the same as the MCP copy on every case.
  • Integration: tests/integration/signature-verification.test.ts passes (33/33, with the local Supabase stack and the receiver). Its PATCH cases call updateEndpointBySlugForUser directly rather than the HTTP route, so the new route check is covered by the route unit tests, not a new integration case.
  • Checked by hand: renaming a group in INSTRUCTIONS fails the new test; the raw output of the old bundle script fails prettier --check, the new one passes.
  • pnpm typecheck, pnpm lint, pnpm test (SDK, MCP, web unit, Zapier, Make) all pass; Prettier is clean on changed files.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Discord signing keys are now checked when saved or used to create an endpoint. They must contain exactly 64 hexadecimal characters; invalid keys are rejected.
    • The hosted MCP server now explains when it ignores a supplied targetUrl and confirms that it did not post to that address. Posting to a user-owned URL requires the local server.
  • Documentation
    • Updated MCP guidance to clarify hosted-server behavior for targetUrl with email rendering and webhook-flow testing.

…ed skill bundle, mcp 2.4.2

- The hosted server marks a render_email or test_webhook_flow call whose
  raw arguments still carry targetUrl (a client with an older tools/list)
  before the object schema drops it, and adds a note to the result:
  nothing was posted, and posting to your own URL needs the local server.
- create_endpoint refuses a Discord public key that is not 64 hex
  characters before it creates anything; other update failures keep
  the warning path.
- bundle-skill.mjs formats skill-files.ts with the repository's Prettier
  and config, so a regenerated copy passes prettier --check.
- The hosted instructions test parses the groups listed after "beside
  core:" and compares them with TOOL_GROUP_NAMES both ways.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroqdotdev kroqdotdev added the release: patch Ships a fix or small feature: the next web release bumps the patch version label Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26303a29-e753-4f02-b90d-937367c76004

No actionable comments were generated in the recent review.

Walkthrough

The dashboard PATCH route and MCP create_endpoint validate Discord signing credentials. The hosted MCP adapter adds a notice to selected tool results when calls include targetUrl. The MCP release version and bundle-generation formatting are updated.

Changes: MCP and dashboard updates

Layer / File(s) Summary
Discord signing credential validation
apps/web/lib/signing-config.ts, packages/mcp/src/tools.ts, apps/web/app/api/endpoints/[slug]/route.ts, apps/web/lib/signing-config.test.ts, packages/mcp/src/__tests__/tools.test.ts, apps/web/app/api/endpoints/[slug]/route.test.ts
The web and MCP signing paths reject Discord credentials that are not exactly 64 hexadecimal characters. Tests cover valid and invalid credentials and verify that rejected values do not update or create endpoints.
Hosted MCP targetUrl notice
apps/web/lib/mcp/hosted.ts, apps/web/lib/mcp/hosted-app.test.ts, apps/web/lib/mcp/hosted.test.ts, packages/mcp/src/tools.ts
The hosted adapter detects targetUrl on selected tool calls, removes its internal marker before invoking the handler, and appends a notice to call-tool results. Tests check that calls with and without targetUrl produce the expected notice behavior.
MCP release and bundle generation
packages/mcp/package.json, packages/mcp/server.json, apps/web/lib/changelog.ts, apps/web/changelog/web/mcp-target-url-note.json, packages/mcp/scripts/bundle-skill.mjs
The MCP version changes to 2.4.2, and changelog entries describe the validation and hosted-server behavior. The bundle script formats generated source with the repository Prettier configuration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant toolServer
  participant registeredHandler
  MCPClient->>toolServer: Call selected tool with targetUrl
  toolServer->>toolServer: Validate arguments and mark targetUrl
  toolServer->>registeredHandler: Invoke handler without marker
  registeredHandler-->>toolServer: Return tool result
  toolServer-->>MCPClient: Return result with targetUrl notice
Loading
Merge Risk: Minimal · previous review 49e9a

This change adds Discord public-key validation and a clear note when hosted MCP calls include targetUrl. It also bumps the MCP package to 2.4.2 and formats the generated skill bundle. No concrete defect was established, and tests cover the new behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title lists four changes: a hosted targetUrl note, Discord key checks, a formatted skill bundle, and the mcp 2.4.2 version bump. The changeset contains all four, and the Discord key validation and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title lists four changes: a hosted targetUrl note, Discord key checks, a formatted skill bundle, and the mcp 2.4.2 version bump. The changeset contains all four, and the Discord key validation and targetUrl note are the main behavior changes. The title is long and lists several items, but it is related to the main changes and does not describe anything absent from the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8fdd2b2e-a775-419e-900a-fc64d782c844
Commits

Reviewing files that changed from the base of the PR and between 23f63f0 and 49e9a0b.

Files selected for processing: 14

  • apps/web/app/api/endpoints/[slug]/route.test.ts
  • apps/web/app/api/endpoints/[slug]/route.ts
  • apps/web/changelog/web/mcp-target-url-note.json
  • apps/web/lib/changelog.ts
  • apps/web/lib/mcp/hosted-app.test.ts
  • apps/web/lib/mcp/hosted.test.ts
  • apps/web/lib/mcp/hosted.ts
  • apps/web/lib/signing-config.test.ts
  • apps/web/lib/signing-config.ts
  • packages/mcp/package.json
  • packages/mcp/scripts/bundle-skill.mjs
  • packages/mcp/server.json
  • packages/mcp/src/__tests__/tools.test.ts
  • packages/mcp/src/tools.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…ts/{slug}

The endpoint route refuses a Discord signing credential that is not
exactly 64 hex characters, with the message the MCP server's
create_endpoint check gives, so update_endpoint, the dashboard, the CLI
and the SDKs all get it with no SDK release. The check is
signingCredentialProblem() in lib/signing-config.ts beside the route's
other signing validators; the MCP package keeps its own copy, since it
cannot import web code, and each points at the other. A web unit test
checks that both copies answer alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroqdotdev kroqdotdev changed the title fix(mcp): hosted targetUrl note, Discord key check on create, formatted skill bundle, mcp 2.4.2 fix(mcp): hosted targetUrl note, Discord key checks, formatted skill bundle, mcp 2.4.2 Nov 15, 2026
@kroqdotdev

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

kroqdotdev and others added 3 commits November 15, 2026 23:12
…d tests

- The endpoint settings panel trims the signing secret it saves, so a
  Discord key pasted with a stray space or newline is not refused; the
  route stays strict.
- hosted-app.test.ts checks that render_email and test_webhook_flow still
  list the rest of their input schemas, adds a test_webhook_flow call
  with targetUrl (note, nothing posted there), and a render_email call
  the schema refuses (an error, no note, nothing fetched).
- The web and MCP Discord key tests refuse a key with a trailing
  newline, and the web test compares both copies of the check on every
  case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… end in its test

- normalizeSigningCredential() in lib/signing-config.ts trims a Discord
  public key (the receiver trims it too) and returns every other
  credential exactly as typed, since HMAC secrets are used byte for
  byte. The settings panel computes it once and uses it for dirty, the
  missing-credential check and the update, so a whitespace-only Discord
  key gets the panel's own message instead of a round trip.
- The hosted test_webhook_flow test routes its mocks by URL so the flow
  runs to the end (create, capture, poll, clean up), which makes the
  assertion that nothing reached targetUrl able to fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Discord trim comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroqdotdev
kroqdotdev merged commit 463ab97 into main Nov 15, 2026
37 checks passed
@kroqdotdev
kroqdotdev deleted the fix/mcp-review-followups branch November 15, 2026 22:36
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release: patch Ships a fix or small feature: the next web release bumps the patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant