MCP Shipyard
← Rules catalog

Hidden or encoded text in MCP tool names and descriptions: remove it

Zero-width characters, control characters, HTML comments and long base64 blobs in tool metadata are blockers for Claude and ChatGPT review.

blockerdesc.hidden-contentClaude, ChatGPT

Remove zero-width characters, control characters, HTML comments and base64 blobs from every tool name, title and description. The rule desc.hidden-content is a blocker for Claude and ChatGPT. Its fix text cites Claude policy 2.G and ChatGPT 3.3, which reject hidden or obfuscated instructions.

What you see

  • A scan reports desc.hidden-content per tool: "Hidden or encoded content found in tool metadata".
  • The finding does not print the character itself, because it may be invisible.

For the wider family of checks across every metadata field, see security.hidden-content. This rule covers a tool's name, title and description.

Why it happens

Typical sources are innocent:

  1. Text pasted from a word processor or chat window that carried a zero-width space or a byte order mark.
  2. An HTML comment (<!-- note -->) left in a docstring that a framework copies into the description.
  3. A long base64 string (100 or more characters with mixed case and digits) inlined as an example.
  4. A control character from a bad escape in generated JSON.

The rule tests for zero-width and bidirectional control characters, word joiners, a byte order mark, C0 control characters, the HTML comment opener, and long base64-like runs. URLs are blanked out before the blob test, so a long signed URL does not trip it.

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' > tools.json
grep -nP '[\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{FEFF}]|<!--' tools.json

Any match shows the line. To list code points in one description, pipe it through jq -r '.result.tools[0].description' | xxd | head.

Fix

Retype the text in a plain editor, or strip the characters in the source file and rebuild. Delete HTML comments from docstrings. Move example payloads out of descriptions; if you need a sample id, use a short literal such as ord_1001.

Verify

Re-run the grep with no output, then re-scan.

Which clients care

Claude and ChatGPT, per the rule.

Source

Anthropic Software Directory Policy: https://support.claude.com/en/articles/13145358-anthropic-software-directory-policy

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server