Repository navigation
MCP-714 Use SDK native filtering for HTTP tool discovery - #727
nquinquenel wants to merge 1 commit into
Conversation
Co-Authored-By: Fabrik <fabrik@sonar.ai>
Code Review ✅ Approved 🔴 High risk 1 closed / 1 findingsMoving OAuth- and request-restriction checks into SDK discovery filtering could expose restricted tool schemas if request context is misapplied; direct-call checks remain. Switches HTTP tool discovery to the MCP SDK native filter, using request transport context and the server-enabled tool registry while preserving request toolsets, read-only settings, OAuth scopes, and organization-specific schemas. The previously raised concern about tool-list loss once PR #681 lands was resolved by confirming the current head uses a consistent enabledTools list, with the rebase note to retain this filter when #681 merges. No open findings remain. ✅ 1 closed✅ Cross-PR: HTTP tool filter loses its tool list once #681 lands
Verification Rules 2/2 met Knowledge ✅ 2 PRs 2 inspectedFunctional validation No results Rules 2 passed 2 not applicable
Knowledge ✅ 2 expectations metBroader impact PRs 2 inspectedCross-PR 2 PRs inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



MCP-714 https://sonarsource.atlassian.net/browse/MCP-714
Human description
HTTP tool discovery now uses the MCP SDK native filter. Request toolsets, read-only settings, OAuth scopes and tool enablement continue to narrow server permissions. Direct calls retain their authorization checks and OAuth challenges. Organization-specific schemas remain supported.
Agent description
The SDK 2.1.0 dependency is already present. The filter uses request transport context and the server-enabled tool registry. The response wrapper adjusts organization schemas while preserving SDK cursors, metadata and errors. Unsupported-method handling and stdio behavior stay unchanged. No performance gain is assumed.
Acceptance coverage: regression tests use a real SDK delegate for discovery, cover concurrent request isolation and hidden-tool call rejection, and retain OAuth, schema and direct-call coverage.
Vortex: repository project SonarSource_sonarqube-mcp-server is bound and both entitlements are enabled. Java guidance covered authentication, concurrency, tests and API design. The implementation keeps request state local and call authorization independent of discovery. DEEP analysis fixed one record-pattern finding. One finding remains on an untouched line: src/main/java/org/sonarsource/sonarqube/mcp/SonarQubeMcpServer.java:220, java:S106, “Replace this use of System.out by a logger.” Changed-file secrets scan passed. Dependency analysis reported eight existing LOW risks; dependencies did not change.
Independent review: clean, round 1, gpt-6.1-sol, zero blocking findings.
Validation gaps: Docker integration tests could not run because the local Docker daemon is unavailable; CI must cover the HTTP, STDIO and proxy integration suites. The independent reviewer could not execute Gradle because its isolated environment lacked the cached distribution and cannot reach the download host. Host preparation was not validated because repository guidance supplies no preparation plan. Host unit tests and spotlessCheck passed.
Repository guidance: root AGENTS.md was read. There is no ADR directory; this bounded transport change needs no decision record. Attachments used: none. Rollback: revert the implementation commit. No migration is required.
Usage: 7634684 tokens; gpt-6.1-sol. Review usage: 698662 tokens, one session.
This PR is opened as a draft by autonomous Fabrik. It may become ready only after its mechanical gates pass. Human approval and merge are required.
🤖 Co-authored by Fabrik