claude-code - 💡(How to fix) Fix Claude Desktop MCP Log Masking - Allow Server Developers to Declare Sensitive Tool Parameters [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52843Fetched 2026-04-25 06:19:24
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2closed ×1unlabeled ×1

Code Example

json{
  "name": "verify_mfa",
  "parameters": {
    "code": {
      "type": "string",
      "description": "6-digit TOTP code",
      "sensitive": true
    }
  }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Claude Desktop currently logs all MCP JSON-RPC messages verbatim, including full tool call inputs and outputs. Server developers have no mechanism to declare which parameters are sensitive or to influence how the client handles them in logs.

When building MCP servers for regulated industries - financial services, healthcare, legal, tool parameters frequently contain sensitive runtime values:

MFA/TOTP codes Wallet IDs and blockchain addresses Transaction amounts and references Authentication tokens Patient or customer identifiers

All of these appear in plaintext in %APPDATA%\Claude\logs. The server developer cannot prevent this. This is not a protocol-level issue, MCP JSON-RPC is behaving correctly. The gap is in the Claude Desktop logging layer, which provides no filtering, masking, or redaction capability.

Claude Desktop already supports sensitivity at the configuration level "sensitive": true in manifest.json causes configuration values to be encrypted using OS secure storage (Keychain/Credential Manager). The concept exists. It needs to extend to runtime tool parameters.

This is more obvious when using a hardware MFA POP (Proof of Possession) key.

Proposed Solution

Allow MCP server developers to annotate tool parameters as sensitive during tool registration. Claude Desktop should mask these values in logs. Example registration annotation:

json{
  "name": "verify_mfa",
  "parameters": {
    "code": {
      "type": "string",
      "description": "6-digit TOTP code",
      "sensitive": true
    }
  }
}

When sensitive: true is present, Claude Desktop logs should replace the value with [REDACTED], the parameter name and structure remain visible for debugging, but the value is masked.

Why This Matters: Every mature logging framework like Serilog, log4j, cloud logging pipelines supports field-level redaction. Enterprise MCP deployments cannot meet basic compliance requirements (PCI-DSS, HIPAA, SOC 2) if client logs capture MFA codes and financial transaction data verbatim with no developer control.

Scope: This request applies to both stdio and HTTPS MCP transports. The logging layer sits above the transport in both cases and the same gap exists regardless of transport mechanism.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

MCP server integration

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

To address the logging of sensitive data, Claude Desktop should be modified to allow MCP server developers to annotate tool parameters as sensitive, and then mask these values in logs.

Guidance

  • The proposed solution suggests adding a "sensitive" annotation to tool parameters during registration, which would trigger Claude Desktop to mask the values in logs.
  • To implement this, the logging layer in Claude Desktop would need to be updated to recognize and respect the "sensitive" annotation.
  • The example registration annotation provided shows how the "sensitive" flag could be added to a parameter, e.g., "code": { "type": "string", "description": "6-digit TOTP code", "sensitive": true }.
  • The logging layer should replace the sensitive values with a placeholder like [REDACTED] to maintain the parameter structure for debugging while protecting sensitive information.

Example

{
  "name": "verify_mfa",
  "parameters": {
    "code": {
      "type": "string",
      "description": "6-digit TOTP code",
      "sensitive": true
    }
  }
}

This example illustrates how a tool parameter could be annotated as sensitive.

Notes

The implementation details of how Claude Desktop's logging layer will be modified to support this feature are not specified in the issue. The solution will require updates to the logging mechanism to recognize and handle the "sensitive" annotation appropriately.

Recommendation

Apply the proposed workaround by modifying Claude Desktop to support the "sensitive" annotation for tool parameters and mask these values in logs. This approach directly addresses the need to protect sensitive information in logs, as required for compliance with regulations like PCI-DSS, HIPAA, and SOC 2.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude Desktop MCP Log Masking - Allow Server Developers to Declare Sensitive Tool Parameters [1 participants]