tamperlens-mcp
A tamperlens-mcp server that checks documents — before an agent reads them — for fraud, tampering, redaction failures, and prompt-injection payloads, via the Tamperlens REST API.
inspect_document— full inspection of a PDF, Office file or image (localpathor http/httpsurl) for post-save revisions, self-contradicting metadata, editor fingerprints, signature gaps, text readable under a redaction box, tracked changes, hidden text/sheets, macros and AI-image traces; also flags text addressed to a language model (cue categories and field location only, never the payload). Optionalissuerbaseline (PDF only) andpolicythresholds for a computed accept/review/reject verdict.triage_document— cheap structural pre-flight for routing: risk band, visible medium/high signals, and measured cost (bytes read, bytes expanded, expansion ratio) without the per-page content walk.check_redaction— verifies a PDF's redactions actually removed content, catching drawn rectangles that leave text extractable and unapplied redaction marks.compare_documents— checks a candidate against a trusted original: byte identity, revision ancestry, or field-by-field structural diff.Local or remote input — fetch URLs from your own machine (SSRF-guarded: http/https only, redirect re-checks, DNS-rebinding pinning, non-routable/metadata IP refusal, 30s timeout, 10 MB cap) or read local absolute paths (confine with
TAMPERLENS_ALLOWED_DIRS).Bring your own deployment and limits —
TAMPERLENS_BASE_URL, optionalTAMPERLENS_API_KEY(anonymous 10 docs/hour without one), andTAMPERLENS_FETCH_ALLOW_IPSfor allow-listed internal hosts.Reports signals, not verdicts — evidence-backed risk signals only; document bytes never enter the model context, and recovered injection text is always elided.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tamperlens-mcp Check this PDF for tampering and hidden text before my agent reads it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tamperlens-mcp
MCP server for Tamperlens — ask whether a document was edited, whether its redactions held, and whether it is safe for a model to read, before it reaches your agent's context.
// Claude Desktop / Claude Code — claude_desktop_config.json or .mcp.json
{
"mcpServers": {
"tamperlens": {
"command": "npx",
"args": ["-y", "tamperlens-mcp"],
"env": { "TAMPERLENS_API_KEY": "tl_..." }
}
}
}No key is required to try it — without one you get the anonymous allowance of 10 documents an hour. A free key at tamperlens.com/account raises that to 50 a month with no card.
Tools
Tool | Answers |
| Was this edited after it was written? Revisions appended after the original save, metadata that disagrees with itself, editor fingerprints, signature coverage and integrity, hidden text, macros, AI-generator traces in images — and whether the file carries text addressed to a language model rather than to a reader. |
| Is this worth ingesting, and what does it cost to open? The cheap pre-flight: structure, metadata, signatures and presence flags only — no per-page content walk — at a fraction of the I/O. Returns the risk band, the measured cost (bytes read, bytes expanded, expansion ratio) and a |
| Did the redaction actually remove anything? Covering text with a black box hides it from a person and removes nothing from the file. |
| Is this the same file as the original I already hold, unchanged? |
| Do these documents of one case (three months of statements, a payslip and its statement) disagree with each other? One report per document, plus what they share that independent documents should not: the same file twice, one base file's |
Accepts PDF; Word, Excel and PowerPoint (.docx, .xlsx, .pptx and the
macro-enabled twins); and JPEG, PNG, WebP, HEIC/HEIF and AVIF.
A local path or a URL
inspect_document, check_redaction and compare_documents (as
originalUrl/candidateUrl) take either a local path or an http/https
url — not both. inspect_case takes lists of both (paths, urls). A url is fetched by this server, on your own machine, over
your own network, and only the bytes are sent on to Tamperlens. That is why the
option lives here and not on the REST API: a server-side fetch of a
caller-supplied URL is an SSRF risk on the API host, whereas fetching from your
machine reaches only what you can already reach. It is still guarded: http/https
only (re-checked at every redirect), a redirect cap, a 30s timeout
(TAMPERLENS_FETCH_TIMEOUT_MS to tune), and the same 10 MB cap, enforced on the
bytes received rather than a Content-Length that can lie.
It also checks the destination IP, not just the scheme: a url that points
at — or redirects to, or resolves by DNS to — a loopback, link-local/metadata
(169.254.169.254), private or otherwise non-routable address is refused, and
the address it connects to is pinned to the one it validated, so DNS rebinding
cannot slip an internal address past the check. The check re-runs at every
redirect hop. If you genuinely need to fetch from an internal host, allow-list
specific addresses with TAMPERLENS_FETCH_ALLOW_IPS (comma-separated; empty by
default, and the default reaches nothing internal).
The
pathargument reads any local file and sends its bytes to the API.inspect_document,triage_document,check_redaction,compare_documentsandinspect_caseread whatever local path they are given — there is no directory sandbox by default and no extension filter, because reading a document off disk is the whole job and an intake path is not knowable in advance. SetTAMPERLENS_ALLOWED_DIRS(env table below) to confine reads to an intake directory; a symlink pointing out of a root is resolved and refused. The bytes of that file are then transmitted to the configured Tamperlens deployment. A model an attacker is steering could therefore name a private file (~/.ssh/id_rsa,~/.aws/credentials) and cause its bytes to leave the machine. Run this server only with agents and inputs you trust, the same rule you would apply to any tool that can read the local filesystem. For a hard boundary, front the intake with a directory you control and pass only paths inside it.
Related MCP server: classifinder-mcp
Why you would put this in front of an agent
A document is read by two audiences and only one of them sees the page. An extraction pipeline reads the title, the keywords, the XMP packet, the comments, the names of attachments — fields that exist to be read by software. Text placed there can be written to be obeyed rather than read.
inspect_document reports that before your agent ingests the file, and the
recovered payload is elided unconditionally in this server. That is not a
convenience: the most likely next reader of a Tamperlens report is the same
model that was about to read the document, so an MCP server that echoed the
attacker's sentence back into the context would be completing the attack it
just detected. You get the field, the location and the cue categories. You do
not get the sentence.
What it does not do
No local analysis. Every tool is a thin wrapper over the Tamperlens REST API on a running deployment. There is no second engine here to drift from the first.
No verdicts. Tamperlens reports risk signals with the evidence behind them, never "this document is fraudulent". Combine them with your own decision logic.
The document never enters the model's context. Tools take a path on the caller's filesystem (or a URL fetched here) and read the bytes on this side. Base64 in a tool call would put megabytes of document into the context window to reach a service that needs the bytes, not the model.
Retention follows the account behind the key. Files are parsed in memory by the API. Without
TAMPERLENS_API_KEY(the anonymous allowance) nothing is kept. With a key that belongs to an account whose history is on (the default for accounts created since retention launched), the API keeps a short derived record of each call (hashes, signal ids and the score; never the file, its name or its text), and keeps the file itself only if the account opted in. The tool result then carries the API'sretentionandtenantMatchesblocks. To keep nothing, set that key toretention: nonewithPATCH /api/v1/retentionfrom a signed-in dashboard session (the dashboard has no per-key switch); this server does not send the per-callX-Tamperlens-Retentionheader. Every field is listed at tamperlens.com/privacy#retention.
Configuration
Variable | Default | Meaning |
| none | Optional. Without it the anonymous allowance applies (10 documents/hour). |
|
| Point at your own deployment. |
|
| Total budget for a |
| none | Comma-separated exact IPs a |
| none | Colon- or comma-separated absolute directories to confine local file reads to. Unset means any absolute path the process can read. Set it to an intake directory so a |
Links
Field guide to every signal · Is this file safe for your model to read? · API reference · Security and privacy posture
MIT licensed. Issues and source: github.com/haruodev/tamperlens-mcp.
Available Tools
4 toolscheck_redactionA
Check whether a PDF's redactions actually removed anything. Covering text with a black box hides it from a reader and removes nothing from the file, so the words stay extractable. This reads paint order to catch a plain drawn rectangle — which carries no redaction annotation at all and is the failure behind most published redaction leaks — and separately catches redaction marks that were never applied. Use this before a document is filed or released.
Inputs: url, path.
compare_documentsA
Compare a candidate document against the original you already hold, and answer the question a single-file check cannot: is this the same file, unchanged? Reports byte identity (the only proof), revision ancestry when the candidate contains the original as a byte prefix, or a field-by-field structural diff when both were rewritten whole. Renders nothing and compares no pixels.
Inputs: originalUrl, candidateUrl, originalPath, candidatePath.
inspect_documentA
Inspect a document or image for fraud and tamper signals: revisions appended after the original save, metadata that disagrees with itself, editor fingerprints, signature coverage gaps, text still readable under a redaction box, unaccepted tracked changes whose deleted text is still recoverable, hidden text, hidden spreadsheet sheets, macros, and AI-generator or editor traces in images. Returns risk signals with the raw evidence behind each one — never a verdict on authenticity. Accepts PDF; Word, Excel and PowerPoint documents (.docx, .xlsx, .pptx and macro-enabled twins); and JPEG, PNG, WebP, HEIC/HEIF and AVIF images.
ALSO ANSWERS: is this file safe for a model to read? Document properties, XMP, annotations, attachment names, docProps, comments and hidden Word runs are checked for text written to be read by a language model rather than by a person — the prompt-injection carriers an extraction pipeline surfaces and a human reader never sees. Call this BEFORE the document reaches your own context. The recovered text itself is never returned through this tool: you get the cue categories, the counts and which kind of field carried it, because reading the payload is the attack.
Inputs: url, path, issuer, policy.
triage_documentA
CHEAP PRE-FLIGHT for document intake: is this file worth ingesting, and what does it cost to open? Reads structure, metadata, signatures and presence flags (revisions appended after the original, editor fingerprints, macros, JavaScript, embedded files, signature coverage) WITHOUT the expensive per-page content walk — a fraction of the I/O of inspect_document. Returns the risk band, the medium-or-high signals it CAN see, and the measured cost: bytes read, bytes expanded (decompressed) and the expansion ratio, so an agent can reject a decompression-heavy or high-risk file before committing to a full parse.
NOT A CLEAN BILL OF HEALTH. A quiet triage means only that the cheap structural tells were absent. Hidden text, redaction failure, altered arithmetic, glyph tampering, embedded-image anomalies and broken certifications are NOT checked in this mode — they need the page-content walk inspect_document runs. Use triage to ROUTE (reject now, or escalate to inspect_document), never as the verdict. PDFs get the cheap scope; Office documents and images have no separate expensive walk, so they return their full report.
Inputs: path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clear action-object purpose: deep inspection, cheap pre-flight triage, PDF redaction verification, and original-vs-candidate comparison. The only real overlap is that check_redaction is a specialized slice of what inspect_document also covers, and triage_document vs inspect_document are two depths of the same scanning workflow, but the descriptions explain the intended routing well.
All tools follow a consistent lowercase snake_case verb_target pattern: inspect_document, triage_document, check_redaction, compare_documents. The only minor variation is pluralization on compare_documents, which is semantically natural and does not hurt predictability.
Four tools is well-scoped for a document-forensics server: one cheap intake preflight, one comprehensive deep inspection, one targeted redaction gate, and one comparison operation. Each tool has a distinct place in the workflow, and none feels redundant.
The surface covers the full relevant progression: triage to route, inspect to get detailed signals, check_redact before release, and compare to validate against an original. It also covers both document files and in images; the main gap is that check_redaction is PDF-only and there is no explicit batch/attation/report operation, but these are obstacles behind the core workflow.
Maintenance
Related MCP Connectors
Check a document for hidden text before your agent reads it. PDF, Office, RTF, HTML.
The WAF for agents. Pattern-based + heuristic firewall scans prompts, RAG documents, tool argume...
Scan text, documents, websites, and MCP metadata for prompt injection and sensitive-data risks.
Check text before your agent reads it: hidden instructions, invisible text and links that leak data.
Related MCP Servers
FlicenseAqualityCmaintenanceEnables AI agents to upload, verify, and chat about documents for compliance (e.g., SOC2, GDPR) with PII redacted server-side.810 npm-
classifinder-mcpofficial
AlicenseAqualityBmaintenanceEnables AI agents to scan text for leaked secrets and prompt injection markers, and redact them before reaching an LLM.21MIT
DeckProbe MCP Serverofficial
AlicenseAqualityDmaintenanceEnables agents to inspect PDF, Microsoft Office, and Apple iWork documents without rendering them, providing page/slide counts, metadata, security signals, structure, and integrity as deterministic JSON via typed tools and batch operations.446 npmMIT- AlicenseNot gradedqualityBmaintenanceEnables an agent to check a document file or a retrieved piece of text for text a person cannot see and for instruction-style payloads before the agent reads or acts on it, returning findings with location, reason and severity plus a blocked flag when the content should not be trusted. The hidden text itself is withheld from tool results by default so the payload is not delivered to the requesting agent.13 npmApache 2.0