MCP Server Security

MCP data exposure and logging risks

Seven risks cover where secrets and data end up: inherited environment variables, plaintext token files, exfiltration through legitimate calls, secrets requested by elicitation, missing tool-call records, secrets inside logs and protected data returned through resource templates. Each row has controls and a primary source, read on 16 Nov 2026.

Facts read on .

What this dimension covers

Where secrets and data end up: environment, token storage, exfiltration channels and logs. The register holds 7 rows here (R-36, R-37, R-38, R-39, R-40, R-41, R-42). Each row states what the risk is, its impact, concrete controls and at least one primary source.

Sources: Local Server Security, modelcontextprotocol.io; OWASP MCP Security Cheat Sheet; GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage.

Highest-severity rows

Rows that meet the high rule under the written rule are: R-36 Secrets inherited through the environment; R-38 Data exfiltration through legitimate tool calls.

Sources: Local Server Security, modelcontextprotocol.io; OWASP MCP Security Cheat Sheet; GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage; MCP Inspector security documentation.

First controls to apply

Start with the controls on the high rows, then work down. Controls name settings only where a primary source documents them; check each against the version your clients run.

Sources: Local Server Security, modelcontextprotocol.io; OWASP MCP Security Cheat Sheet; GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage; MCP Inspector security documentation.

Data exposure and logging: 7 items

R-36: Secrets inherited through the environment

A server started by the client inherits the environment of the host process, which often holds cloud keys and tokens.

Impact: A server that needs one key can read all of them.

Controls:

  • Start servers with a minimal environment and pass only the variables each one needs.
  • Use separate credentials per server with the least privilege.
  • Keep secrets in an OS credential store rather than in the shell profile.

Severity: high

Sources: Local Server Security, modelcontextprotocol.io (read ); OWASP MCP Security Cheat Sheet (read ).

R-37: Tokens stored in plaintext

A server or client saves OAuth tokens in a file with loose permissions or in plain text. mcp-atlassian advisories GHSA-g5xv-mhgm-v5f6 and GHSA-4596-2p6p-28cv describe this, and the Inspector's docs say its secrets fall back to a plaintext file when no OS keychain exists.

Impact: Any local process or user that can read the file gets the tokens.

Controls:

  • Use the OS credential store (macOS Keychain, Windows Credential Manager, Linux Secret Service).
  • Set file permissions to the owner only where files are unavoidable.
  • Never store tokens in MCP config files, which the OWASP cheat sheet also says.

Severity: medium

Sources: OWASP MCP Security Cheat Sheet (read ); GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage (read ); MCP Inspector security documentation (read ).

R-38: Data exfiltration through legitimate tool calls

Injected instructions encode sensitive data into ordinary-looking calls, such as search queries or email subjects.

Impact: Data leaves through channels that policy allows.

Controls:

  • Monitor for credentials or sensitive values from one server appearing in calls to another.
  • Restrict which tools can send data outside the organization and require approval for them.
  • Limit the data each server can read in the first place.

Severity: high

Sources: OWASP MCP Security Cheat Sheet (read ).

R-39: Sensitive data requested through form elicitation

A server uses form-mode elicitation to ask the user for a password, API key or token, which passes through the client.

Impact: Secrets pass through the client and its logs. The spec forbids it.

Controls:

  • Reject servers that request secrets in form mode and use URL mode for credential steps.
  • Show which server is asking and let the user decline.
  • Review elicitation requests during server vetting.

Severity: medium

Sources: MCP Elicitation, 2026-07-28 revision (read ).

R-40: No record of tool calls

Tool invocations are not logged with their parameters, user and time, so there is nothing to investigate after an incident.

Impact: A misuse or a poisoned call cannot be reconstructed, and anomalies go unseen.

Controls:

  • Log every tool invocation with full parameters, user context and timestamp.
  • Send the logs to a SIEM and alert on new tools, admin-level queries and unusual call rates.
  • Keep the logs long enough to cover an investigation window you set.

Severity: medium

Sources: OWASP MCP Security Cheat Sheet (read ); MCP Security Best Practices, 2026-07-28 revision (read ).

R-41: Secrets and personal data written into logs

Logging full parameters also records secrets and personal data that appear in arguments and results.

Impact: The log store becomes a second place to steal credentials from.

Controls:

  • Redact secrets and personal data before storing tool-call logs.
  • Restrict who can read the logs and set a retention period.
  • Test the redaction rules with sample credentials.

Severity: medium

Sources: OWASP MCP Security Cheat Sheet (read ).

R-42: Protected data returned through resources and templates

Resources and resource templates expose data by URI, and a template can retrieve a resource that a rule denied.

Impact: Data outside a caller's rights is returned. FastMCP's GHSA-7xgj fix makes a denied concrete resource shadow a matching template.

Controls:

  • Check authorization for the final resource that is returned, not the template.
  • Avoid overlapping proxy templates for protected resources.
  • Test reads for denied URIs through every route.

Severity: medium

Sources: GHSA-7xgj-8392-5q4r: FastMCP post-transform authorization (read ); MCP Tools, 2026-07-28 revision (read ).