Skip to content

fix: mcp.json server-path gate selects the ${PLUGIN_ROOT} arg instead of joining args - #25

Open
devin-ai-integration[bot] wants to merge 1 commit into
Mainfrom
devin/1786099569-mcp-args-gate
Open

fix: mcp.json server-path gate selects the ${PLUGIN_ROOT} arg instead of joining args#25
devin-ai-integration[bot] wants to merge 1 commit into
Mainfrom
devin/1786099569-mcp-args-gate

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #24, from a Devin Review finding on the conformance gate. The gate that proves mcp.json points at a real server file derived its path by joining all args, which fails in both directions:

// before
const target = (ingest.args || []).join(' ').replace('${PLUGIN_ROOT}/', '')
// args: []        -> target ''  -> path.join(root, '') === root -> exists -> OK (gate blind)
// args: ['--enable-source-maps', '${PLUGIN_ROOT}/mcp/.../server.js']
//                 -> target '--enable-source-maps mcp/.../server.js' -> spurious FAIL

Now it picks the one ${PLUGIN_ROOT}-relative arg and fails loudly when there isn't one:

const rootArg = (ingest.args || []).find(a => String(a).startsWith('${PLUGIN_ROOT}/'))

Verified by mutating mcp.json and running node bin/check.js each time:

args before after
[] OK (blind) FAIL: must pass a ${PLUGIN_ROOT}-relative server path
['--enable-source-maps', '${PLUGIN_ROOT}/…/server.js'] FAIL (spurious) OK
['${PLUGIN_ROOT}/mcp/nope.js'] FAIL FAIL: points at missing mcp/nope.js

npm run check: 74/74 tests pass. Gate-only change; no runtime behavior touched.

Link to Devin session: https://app.devin.ai/sessions/f135381c4682413bae73dff38eb6d1a3
Requested by: @suboss87


Open in Devin Review

… joining args

Joining every arg made an empty args list resolve to the repo root (gate
passed on a manifest naming no server file) and made a legitimate
multi-arg invocation resolve to a bogus path.
@suboss87 suboss87 self-assigned this Aug 7, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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