Skip to main content
Glama
tamperlens-mcp

tamperlens-mcp

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

inspect_document

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.

triage_document

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 triage block naming the page-content families it did not check. A quiet triage is not a clean document — use it to route, then inspect_document for the full check.

check_redaction

Did the redaction actually remove anything? Covering text with a black box hides it from a person and removes nothing from the file.

compare_documents

Is this the same file as the original I already hold, unchanged?

inspect_case

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 /ID or font subset tags, the same creation second. Inconsistencies to review, never verdicts. Needs a key; a case of N documents costs N. Takes paths and/or urls, 2 to 10 in all.

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 path argument reads any local file and sends its bytes to the API. inspect_document, triage_document, check_redaction, compare_documents and inspect_case read 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. Set TAMPERLENS_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's retention and tenantMatches blocks. To keep nothing, set that key to retention: none with PATCH /api/v1/retention from a signed-in dashboard session (the dashboard has no per-key switch); this server does not send the per-call X-Tamperlens-Retention header. Every field is listed at tamperlens.com/privacy#retention.

Configuration

Variable

Default

Meaning

TAMPERLENS_API_KEY

none

Optional. Without it the anonymous allowance applies (10 documents/hour).

TAMPERLENS_BASE_URL

https://tamperlens.com

Point at your own deployment.

TAMPERLENS_FETCH_TIMEOUT_MS

30000

Total budget for a url fetch, body and all redirects included.

TAMPERLENS_FETCH_ALLOW_IPS

none

Comma-separated exact IPs a url fetch may reach despite the non-routable-address guard. For a deliberate internal document store. Empty means nothing internal is reachable.

TAMPERLENS_ALLOWED_DIRS

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 path argument cannot reach secrets like ~/.ssh or a stray .env; a symlink pointing out of a root is resolved and refused.

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 tools
check_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

    A4.3/5.0

    Scored across 4 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      4
      46 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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 npm
      Apache 2.0