# 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. Last verified against MCP specification 2026-07-28: Tools on 2026-11-18.

## 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](https://modelcontextprotocol.io/specification/2026-07-28/server/tools#x-mcp-header)

## 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

```ts
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"
```

## 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.

## Related checks

- [x-mcp-header values follow the rules](https://isokron.ai/mcp-check/checks/spec-x-mcp-header)
- [No credential, payment card or government ID inputs](https://isokron.ai/mcp-check/checks/openai-restricted-input)
- [Metadata does not seek secrets or local files](https://isokron.ai/mcp-check/checks/sec-secret-seeking)
- [MCP specification 2026-07-28: tools/list rules](https://isokron.ai/mcp-check/checks/protocol)

Counts toward: MCP specification 2026-07-28, Poisoning and hidden text.

Rubric: https://isokron.ai/mcp-check/rubric

Check your tool list: https://isokron.ai/mcp-check
