Skip to content

feat: support snake_case MCP schema variants#3

Merged
brandonwise merged 1 commit intomainfrom
auto/pm-presence-20260415
Apr 16, 2026
Merged

feat: support snake_case MCP schema variants#3
brandonwise merged 1 commit intomainfrom
auto/pm-presence-20260415

Conversation

@brandonwise
Copy link
Copy Markdown
Owner

@brandonwise brandonwise commented Apr 16, 2026

Summary

  • add snake_case schema support for MCP config discovery and server fields
  • parse top-level/nested mcp_servers + contextServers variants in parse_config
  • accept allowed_tools / tool_allowlist and allowed_directories aliases to prevent false positives for AW-007/AW-002
  • add integration fixture (testdata/snake-case-mcp.json) and tests proving snake_case allowlist fields are honored

Why this matters

Recent MCP ecosystem telemetry shows teams mixing config schemas across tools and wrappers. Without alias support, users can get false positives even when they configured least-privilege allowlists correctly.

Validation evidence

All commands run from repo root.

1) Repo-level/full suite

  • cargo test βœ… PASS (208 unit + 36 integration tests)

2) Targeted tests for changed modules

  • cargo test config::tests::test_parse_snake_case_mcp_servers_and_fields βœ… PASS
  • cargo test test_snake_case_allowlist_and_directories_are_respected βœ… PASS

3) Lint/type/build checks

  • cargo clippy --all-targets --all-features -- -D warnings βœ… PASS
  • cargo check βœ… PASS
  • cargo build --release βœ… PASS

4) Smoke/integration check for changed behavior

  • ./target/release/agentwise scan testdata/snake-case-mcp.json --format json | python3 -c 'import json,sys; d=json.load(sys.stdin); ids={f["rule_id"] for f in d.get("findings",[])}; banned={"AW-002","AW-007"}; bad=sorted(ids & banned); print("findings", len(d.get("findings",[])), "score", d.get("score")); print("banned_rules", bad if bad else "none"); sys.exit(1 if bad else 0)' βœ… PASS
    • output: findings 0 score 100, banned_rules none

Risk

Low. Backward-compatible parser aliases + tests only; no rule severity changes or output schema changes.

@brandonwise brandonwise merged commit 96bbdf9 into main Apr 16, 2026
8 checks passed
@brandonwise brandonwise deleted the auto/pm-presence-20260415 branch April 16, 2026 01:11
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