Skip to content

fix(as2): match MCP config files of Claude Desktop, Claude Code, Cline and Roo Code - #881

Merged
rng1995 merged 2 commits into
NVIDIA:mainfrom
SergeevDmitry:fix/as2-mcp-client-config-files
Oct 28, 2026
Merged

rng1995 merged 2 commits into
NVIDIA:mainfrom
SergeevDmitry:fix/as2-mcp-client-config-files

Conversation

@SergeevDmitry

Copy link
Copy Markdown

Fixes #880.

AS2 matched only mcp.json and mcp_config.json. A skill that read the MCP server list, and the tokens in it, of Claude Desktop, Claude Code, Cline or Roo Code got no AS2 finding and was reported as score: 7, recommendation: SAFE. The same read of ~/.cursor/mcp.json gives AS2 HIGH and score: 36, recommendation: CAUTION.

Fix

The three direct-access AS2 patterns (open(...), Path(...), and cat/less/head/grep) now share one file-name pattern. In addition to mcp.json and mcp_config.json, it matches:

  • claude_desktop_config.json (Claude Desktop);
  • mcp_settings.json, which also covers Cline's cline_mcp_settings.json (Roo Code, Cline);
  • .claude.json (Claude Code user and local scopes).

The .claude/mcp.json path pattern and the file-name-then-token pattern are unchanged, so setup instructions that only name one of these files are not flagged. The AS2 explanation and remediation now give claude_desktop_config.json as a second example.

Tests

  • test_as2_other_mcp_client_configs_produce_finding covers the four clients through open, Path and cat. All four cases fail on main.
  • test_as2_setup_instructions_naming_a_client_config_are_not_access checks that a SKILL.md asking the user to add a server to claude_desktop_config.json gets no AS2.
  • On the reproduction skill from AS2 misses the MCP configs of Claude Desktop, Claude Code, Cline and Roo Code #880 and its three variants, skillspector scan --no-llm now reports AS2 HIGH and score: 36, recommendation: CAUTION for each.
  • The new file names add no AS2 match across 6,451 text files in NVIDIA/skills (420 skills), anthropics/skills, and this repository's skills/ and tests/fixtures/.
  • ruff check and ruff format --check pass. pytest -m "not integration and not provider" tests/: 14,327 passed, 6 failed. The 6 failures are test_native_claude_55_accepts_default_temperature_in_request_and_provenance in tests/unit/test_anthropic_provider.py (KeyError: 'temperature'), which fail the same way on main.

Not changed here: AS2 does not match a path passed through another call, such as open(os.path.expanduser("~/.cursor/mcp.json")), for any file name including mcp.json.

…e and Roo Code

AS2 matched only mcp.json and mcp_config.json, so a skill that read the server list of Claude Desktop (claude_desktop_config.json), Claude Code (~/.claude.json), Cline (cline_mcp_settings.json) or Roo Code (mcp_settings.json) got no AS2 finding. The direct-access patterns now share one file-name pattern that covers these files.

Signed-off-by: Dmitry Sergeev <sergeevdms@gmail.com>
@SergeevDmitry

Copy link
Copy Markdown
Author

The red test-unit job comes only from the six pdf/gif params of test_real_binary_structure_is_not_instruction_noise, the wall-clock bound tracked in #861. main fails the same six in run 39465377756, and #862 widens the bound. The other 14,337 tests pass on this branch.

…nfig-files

Signed-off-by: Dmitry Sergeev <sergeevdms@gmail.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[SkillSpector Review]

Value and readiness

Ready. The shared filename fragment adds the missing MCP client configuration names to the three direct-access patterns and keeps configuration-registration prose outside those patterns.

Material findings

No required changes found.

PIC tradeoffs

This remains a lexical direct-access detector. Paths constructed through another function retain the pre-existing limitation documented in the description. The broader filename families can report a direct open used for writing, consistent with the existing AS2 behavior.

Verification and gaps

Reviewed the complete diff, description, linked issue material, all previous reviews/comments/replies and pinned-head surrounding source at 3003ba2e44a6e573934a180e4071aa81bb34e9b1. Verified the Cline suffix match, literal .claude.json spelling, all four new client fixtures, setup-prose negative control and unchanged remaining AS2 patterns. GitHub reports changes: SUCCESS, lint: SUCCESS, test-unit: SUCCESS, OpenCode TypeScript Tests: SUCCESS, DCO Check: SUCCESS, docker-smoke: SUCCESS. No contributor code, tests, imports, build steps or scanner invocations were executed during this review.

@rng1995
rng1995 merged commit 3ae98af into NVIDIA:main Oct 28, 2026
6 checks passed
rng1995 pushed a commit that referenced this pull request Oct 30, 2026
…e and Roo Code (#881)

AS2 matched only mcp.json and mcp_config.json, so a skill that read the server list of Claude Desktop (claude_desktop_config.json), Claude Code (~/.claude.json), Cline (cline_mcp_settings.json) or Roo Code (mcp_settings.json) got no AS2 finding. The direct-access patterns now share one file-name pattern that covers these files.

Signed-off-by: Dmitry Sergeev <sergeevdms@gmail.com>
(cherry picked from commit 3ae98af)
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
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.

AS2 misses the MCP configs of Claude Desktop, Claude Code, Cline and Roo Code

2 participants