Skip to content

fix: reject unexpanded shell vars in MCP args - #628

Merged
kody-bot merged 1 commit into
mainfrom
cursor/sentry-e1-epicshop-mcp-args-cb23
Jul 24, 2026
Merged

fix: reject unexpanded shell vars in MCP args#628
kody-bot merged 1 commit into
mainfrom
cursor/sentry-e1-epicshop-mcp-args-cb23

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Sentry track E-1 (EPICSHOP-EF, EPICSHOP-B3, EPICSHOP-B1, EPICSHOP-FR): one user’s MCP client was passing literal unexpanded shell placeholders ($1, $2) into @epic-web/workshop-mcp, producing ~1,600 events (~40% of epicshop project volume). Those are caller/config mistakes, not workshop bugs.

This change:

  • Detects unexpanded shell placeholders early in workshopDirectory / exerciseNumber validation
  • Returns an ExpectedMcpError that tells the user their MCP config has a literal $1/$2 that was never substituted
  • Treats exercise-number validation failures as expected MCP errors (not Sentry issues)
  • Extends the MCP beforeSend filter for the new messages plus the historical must be an absolute path message (already fixed by Handle relative workshop directories in MCP #589 allowing relative paths)

Sibling issues covered and resolved in Sentry: EPICSHOP-EF, EPICSHOP-B3 (double-report via mcp-server integration), EPICSHOP-B1, EPICSHOP-FR.

Test plan

  • nx run @epic-web/workshop-mcp:test
  • nx run @epic-web/workshop-mcp:typecheck
  • nx run @epic-web/workshop-mcp:build
  • CI green on this PR

Release note

Patch release for @epic-web/workshop-mcp (fix: commit). Publishes clearer arg-validation errors and keeps those expected failures out of Sentry.

Open in Web Open in Cursor 

Detect literal $1/$2-style placeholders from misconfigured MCP clients,
return actionable ExpectedMcpError guidance, and keep those validation
failures out of Sentry (including historical absolute-path messages).

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot marked this pull request as ready for review July 24, 2026 19:57
@nx-cloud

nx-cloud Bot commented Jul 24, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e6244a4

Command Status Duration Result
nx run-many --target typecheck ✅ Succeeded 3s View ↗
nx run-many --target build ✅ Succeeded 1s View ↗
nx lint ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-24 19:59:13 UTC

@kody-bot
kody-bot merged commit 2a50c13 into main Jul 24, 2026
9 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.

3 participants