← All rules
mcp-scan rule
High-entropy value
high-entropy-valuemediumWhat mcp-scan saw
For every env value, url, and argument that did not match an env reference and did not match any of the 50-plus secret patterns, the scanner computed Shannon entropy per character over values 20 characters or longer, and flagged anything above 4.5 bits per character. UUID-shaped values are exempted.
Why it fires
It is the catch-all behind the named patterns: a credential from a provider with no recognizable prefix still looks random, and randomness is measurable. Because Shannon entropy over a string of length n caps at log2(n), a 20-character value can never exceed 4.32 bits and therefore never fires. In practice this needs 23 or more characters with almost no repeated characters.
When this is a false positive
- Pure hexadecimal can never trip this. Hex has at most 4 bits per character, so a 64-character hex token scores below the threshold and is missed, while a shorter mixed-case base64 id is flagged. The rule grades alphabet, not secrecy.
- Public, non-secret identifiers in base64-ish alphabets: a Google Drive file id, a Notion page slug, a build hash with mixed case. All are long, near-unique per character, and safe to publish.
- A long file path with mixed case and few repeated characters, for example a project path with several distinct directory names.
- The UUID exemption is anchored to the canonical 8-4-4-4-12 form, so a UUID without hyphens or with a prefix is not exempted.
How to fix it
- Read the finding: it reports the measured bits per character and the source (environment variable, argument, or server url) plus the key name.
- Identify the value. If it is a public identifier, it is safe to dismiss, and the entropy number is not evidence either way.
- If it is a credential, move it into an env reference: set the env value to ${KEY} and export the real value in your shell or secret manager.
- Rotate anything that was sitting in the config as a literal, since the file has been synced and backed up as plaintext.
- To suppress, add 'high-entropy-value' to suppressRules in .mcp-scan.json. Prefer fixing the named-pattern findings first, since this rule only sees what those missed.