Skip to content

Validate MCP commands with the HTTP API constraints - #2655

Open
erichare wants to merge 2 commits into
fix/mcp-tool-behavior-hintsfrom
fix/mcp-command-validation
Open

erichare wants to merge 2 commits into
fix/mcp-tool-behavior-hintsfrom
fix/mcp-command-validation

Conversation

@erichare

@erichare erichare commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Applies the existing command validation before MCP schema lookup or execution. Empty and oversized insert batches and invalid find options return the same error code and reason as HTTP. Both transports use one error mapper.

Adds an MCP guide covering the endpoint, results, and command validation. This builds on #2649.

Which issue(s) this PR fixes:

Fixes #2632.

Verification

45 focused tests passed with 0 failures, 0 errors, and 0 skips on commit 0d6443e4b, and formatting checks passed. That is one fewer than before because the serialization-failure logging test left with #2652. The MCP integration suite passed 66 of 66 at fc715181f, which has the same code as the current stack apart from the results guide fix.

JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw -B -ntp test '-Dtest=McpCommandValidationTest,McpResourceTest,McpSetupErrorsTest' -DskipITs -Dxml-format.skip=true -Dquarkus.http.test-port=19080
JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw -B -ntp verify -DskipUnitTests '-Dit.test=CollectionCommandToolsMcpIntegrationTest,GeneralCommandToolsMcpIntegrationTest,KeyspaceCommandToolsMcpIntegrationTest,McpFeatureDisabledIntegrationTest,McpLoggingIntegrationTest,McpSchemaIntegrationTest,McpSetupErrorsIntegrationTest,TableCommandToolsMcpIntegrationTest' -Dxml-format.skip=true

Manual client checks were not run.

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@erichare
erichare requested a review from a team as a code owner October 22, 2026 19:50
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 55.07%
This PR 56.27%
Delta 🟢 +1.20%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 56.27% -0.01% 🍏
Files changed 65.85% 🍏

File Coverage
McpResource.java 88.48% -3.04% ❌
FrameworkExceptionMapper.java 31.7% 🍏

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 73.04%
This PR 73.13%
Delta 🟢 +0.09%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 73.13% -0.01% 🍏
Files changed 65.85% 🍏

File Coverage
FrameworkExceptionMapper.java 88.72% 🍏
McpResource.java 82.29% -3.02% ❌

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.35%
This PR 74.43%
Delta 🟢 +0.08%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.43% -0.01% 🍏
Files changed 65.85% 🍏

File Coverage
FrameworkExceptionMapper.java 88.72% 🍏
McpResource.java 82.29% -3.02% ❌

Rebased onto fix/mcp-tool-behavior-hints without the readable-results change. Tool results keep empty text content, so McpCommandValidationTest checks structuredContent for errors and _meta status against the HTTP response.
@erichare
erichare force-pushed the fix/mcp-command-validation branch from 3f3c436 to 1a9abb5 Compare October 27, 2026 23:54
Tool results keep empty text content now that the readable-results change is dropped. Data and errors are in structuredContent, and status stays in _meta.status.

This branch has not been deployed

No deployments
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.

MCP: Check command validation against the HTTP API

1 participant