Skip to content

Keep MCP payloads and credentials out of logs - #2648

Open
erichare wants to merge 1 commit into
fix/mcp-setup-errorsfrom
fix/mcp-safe-logging
Open

erichare wants to merge 1 commit into
fix/mcp-setup-errorsfrom
fix/mcp-safe-logging

Conversation

@erichare

@erichare erichare commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Keeps MCP payloads and credentials out of logs. Completion logs and diagnostic traces share one server-generated request ID. One endpoint path controls request logging and access-log exclusion. Context propagation carries the MCP marker through driver and cache callbacks, then restores the worker context. Diagnostic stack traces expire within 15 minutes.

This builds on #2653.

Which issue(s) this PR fixes:

Fixes #2635. Deployment logging checks remain in #2634.

Verification

84 focused tests passed with 0 failures, 0 errors, and 0 skips on commit 439a80f10, and formatting checks passed. The run used port 19080 because port 9080 was bound locally. The serialization-failure logging test was removed with #2652, since result mapping no longer serializes. The MCP integration suite passed 66 of 66 at the top of the stack (fc715181f), which includes this PR.

JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw -B -ntp test '-Dtest=McpCustomPathLoggingTest,McpDiagnosticLoggingTest,McpEndpointConfigSourceFactoryTest,McpLoggingFilterTest,McpLoggingTest,McpRequestContextProviderTest,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

@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.12%
Delta 🟢 +1.05%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 56.12% -0.23% 🍏
Files changed 73.66% 🍏

File Coverage
McpRequestLogging.java 100% 🍏
McpRequestContextProvider.java 100% 🍏
McpEndpointConfigSourceFactory.java 98.08% -1.92% 🍏
McpLoggingFilter.java 97.47% -2.53% 🍏
McpResource.java 90.93% -6.28% 🍏
DynamicTTLCache.java 84.12% 🍏
CqlSessionFactory.java 81.49% 🍏
RequestContext.java 56.9% 🍏
GeneralCommandTools.java 22.58% -55.91% ❌
KeyspaceCommandTools.java 0% -70.82% ❌

@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.10%
✅ 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.12% 🍏
Files changed 86.04% 🍏

File Coverage
KeyspaceCommandTools.java 100% 🍏
GeneralCommandTools.java 100% 🍏
McpRequestContextProvider.java 91.43% -8.57% 🍏
RequestContext.java 89.39% 🍏
McpRequestLogging.java 89.13% -10.87% 🍏
McpResource.java 84.3% -7.85% 🍏
McpLoggingFilter.java 80.3% -19.7% 🍏
McpEndpointConfigSourceFactory.java 78.85% -21.15% 🍏
CqlSessionFactory.java 72.49% -5.14% ❌
DynamicTTLCache.java 71.73% 🍏

@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.44%
Delta 🟢 +0.09%
✅ 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.44% -0.12% 🍏
Files changed 86.04% 🍏

File Coverage
KeyspaceCommandTools.java 100% 🍏
GeneralCommandTools.java 100% 🍏
McpRequestContextProvider.java 91.43% -8.57% 🍏
RequestContext.java 89.39% 🍏
McpRequestLogging.java 89.13% -10.87% 🍏
McpResource.java 84.3% -7.85% 🍏
McpLoggingFilter.java 80.3% -19.7% 🍏
McpEndpointConfigSourceFactory.java 78.85% -21.15% 🍏
CqlSessionFactory.java 72.49% -5.14% ❌
DynamicTTLCache.java 71.73% 🍏

@erichare
erichare added this pull request to stack #2660 October 23, 2026 22:14
@erichare
erichare removed this pull request from stack #2660 October 27, 2026 23:11
@erichare
erichare added this pull request to stack #2667 October 27, 2026 23:12
Rebased onto fix/mcp-setup-errors without the readable-results change. Tool results keep empty text content, so McpLoggingTest reads the trace status from _meta. The serialization-failure logging test is removed because result mapping no longer serializes.
@erichare
erichare force-pushed the fix/mcp-safe-logging branch from 4917f92 to 439a80f Compare October 27, 2026 23:54

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: Protect payloads and OAuth credentials in logs

1 participant