Skip to content
IsoKron

No x-mcp-header on secrets or personal data

Do not put x-mcp-header on passwords, API keys, tokens or personal data: header values are visible to, and often logged by, every network intermediary; mirror only routing values such as region or tenant.

Check spec-x-mcp-header-sensitive · MCP specification 2026-07-28 · default severity: attention · rubric 2.1.0

What fails

Header values are seen and often logged by load balancers, proxies and firewalls.

The rule

Server developers SHOULD NOT mark sensitive parameters (passwords, API keys, tokens, PII) with x-mcp-header, as header values are visible to network intermediaries.

Source: MCP specification 2026-07-28: Tools

How to fix it

Remove x-mcp-header from this property. Mirror only routing values such as a region or tenant.

  1. Remove x-mcp-header from any credential, token, email, name or address property.
  2. Keep it only for routing values: region, tenant, shard.
  3. Take credentials through the server’s authorization, never as tool arguments.

TypeScript SDK

TypeScript
import { McpServer } from '@modelcontextprotocol/server';
import * as z from 'zod';

const server = new McpServer({ name: 'issues', version: '1.0.0' });

server.registerTool(
  'list_buckets',
  {
    title: 'List buckets',
    description: 'List storage buckets in one region. Use when the user asks what storage exists.',
    inputSchema: z.strictObject({
      region: z.string().meta({'x-mcp-header':"Region"}).describe('Region code, for example eu-west-1'),
    }),
    annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
  },
  async ({ region }) => ({ content: [{ type: 'text', text: 'Done' }] }),
);

Python SDK

Python
from typing import Annotated

from pydantic import Field
from mcp.server.mcpserver import MCPServer
from mcp.types import ToolAnnotations

server = MCPServer("issues")

@server.tool(
    title="List buckets",
    annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, openWorldHint=False),
)
def list_buckets(
    region: Annotated[str, Field(description="Region code, for example eu-west-1", json_schema_extra={"x-mcp-header": "Region"})],
) -> str:
    """List storage buckets in one region. Use when the user asks what storage exists."""
    return "Done"

Run against @modelcontextprotocol/server 2.4.0, mcp 2.3.0 and fastmcp 4.2.2 on 2026-11-18; the checker confirms this check passes on the tool list each snippet produces.

Questions

Is TLS not enough?

TLS protects the hop, but proxies and load balancers that terminate it see and often log headers. A body field is logged far less often.

What counts as sensitive?

The specification names passwords, API keys, tokens and PII. The checker flags those by property name.

How this check is graded

It counts toward: MCP specification 2026-07-28, Poisoning and hidden text. See the rubric.

Last verified against MCP specification 2026-07-28: Tools on 2026-11-18. The rule above is quoted in the source’s own words. This page as Markdown.

Check your tool list: paste your tools/list, nothing is sent anywhere