Fairquery

How do I give my AI agent trust and safety tools via MCP?

Fairquery · · 6 min read

Short answer: add one MCP server to your agent's config: @fairquery/agent-trust-mcp gives Claude Desktop, Cursor, VS Code or any MCP client 12 trust-and-safety tools: PII and secret redaction, email checks, sanctions screening (OFAC, EU, UK, UN) and OSV dependency-vulnerability lookups. 7 tools are free and need no account; they run on your machine (the two OSV lookups call the free OSV.dev API directly). The 5 deeper tools are optional and bill your own Apify account per result. It is listed in the official MCP Registry as io.github.fairquery/fairquery-agent-trust-mcp and on Glama.

Why an agent needs trust and safety tools

Agents increasingly read untrusted input (tickets, emails, scraped pages, uploaded files) and act on it (sign up users, onboard suppliers, add dependencies, send data to other models). Four checks come up again and again:

The 12 tools

ToolCostWhat it does
pii_list_detectorsFree (local)Catalog of detectors, redaction styles and pricing for every paid tool
pii_scan_textFree (local)Finds PII and secrets in text; findings are paged and show masked values only
pii_redact_textFree (local)Redacts with placeholder, mask or hash style; can return a placeholder map
pii_guard_documents$0.0015/doc + $0.0002/findingAdds NER names/addresses, URLs and PDFs, and restore mode
email_check_syntaxFree (local)Syntax, normalisation, typo suggestions, disposable/role/free-provider flags
email_validate_deliverability$0.00079/emailDNS/MX, null MX, SPF/DMARC, mail provider, verdict
sanctions_list_sourcesFree (local)Lists covered, issuing authorities, disclaimer
sanctions_screen_names$0.003/name + $0.007/callFuzzy screening against OFAC SDN/Consolidated, EU, UK and UN
osv_query_packagesFree (api.osv.dev)Vulnerable or not, plus advisory IDs, for up to 200 exact versions
osv_get_vulnerabilityFree (api.osv.dev)Full OSV advisory records
osv_audit_dependencies$0.0005/package + $0.0015/vulnManifest/lockfile audit with severity, fixes and recommended version
trust_screen_lead$0.00079/email + $0.003/name + $0.007/callEmail check and sanctions screening in parallel, merged into a pass/review/block decision per lead

Paid tools run the public Fairquery Apify Actors (llm-data-guard-pii-secrets, email-validator-mx-disposable, sanctions-watchlist-screener, osv-dependency-vulnerability-check) with your APIFY_TOKEN, so usage is billed to your Apify account at the prices above. Every tool description has WHAT / WHEN / WHEN NOT / COST / RETURNS / EXAMPLE sections so the model can pick the right one, outputs are paged (limit, offset, nextOffset, hasMore), and errors use named codes.

How to install it

Requires Node.js 20 or later. Leave out APIFY_TOKEN if you only want the free tools.

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "fairquery-trust": {
      "command": "npx",
      "args": ["-y", "@fairquery/agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "<optional-your-apify-token>" }
    }
  }
}

Cursor (~/.cursor/mcp.json or .cursor/mcp.json)

{
  "mcpServers": {
    "fairquery-trust": {
      "command": "npx",
      "args": ["-y", "@fairquery/agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "<optional-your-apify-token>" }
    }
  }
}

VS Code (.vscode/mcp.json)

{
  "inputs": [{ "type": "promptString", "id": "apify-token", "description": "Apify token (optional, paid tools only)", "password": true }],
  "servers": {
    "fairquery-trust": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@fairquery/agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "${input:apify-token}" }
    }
  }
}

Other ways to run it: npx -y github:fairquery/fairquery-agent-trust-mcp (straight from GitHub), node dist/index.js --http from a clone for Streamable HTTP on http://127.0.0.1:3000/mcp, or the Docker image built from the repo's Dockerfile.

Real outputs from the free tools

We connected to version 1.0.3 from npm with the MCP SDK client (no APIFY_TOKEN set) on October 17, 2026. tools/list returned the 12 tools above. Some calls:

pii_redact_text

Input: Ticket #4411 from Jane Doe <jane.doe@example.com>, phone +1 415-555-0132. Card 4111 1111 1111 1111 was declined. Debug log: AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE (test card number, AWS documentation example key). Returned in 5 ms:

{
  "meta": {
    "engine": "local",
    "redaction_style": "placeholder",
    "placeholder_map": {
      "[EMAIL_1]": "jane.doe@example.com",
      "[PHONE_1]": "+1 415-555-0132",
      "[CREDIT_CARD_1]": "4111 1111 1111 1111",
      "[AWS_ACCESS_KEY_1]": "AKIAIOSFODNN7EXAMPLE"
    }
  },
  "items": [
    {
      "type": "redacted_document",
      "finding_count": 4,
      "risk_level": "critical",
      "output_text": "Ticket #4411 from Jane Doe <[EMAIL_1]>, phone [PHONE_1]. Card [CREDIT_CARD_1] was declined. Debug log: AWS_ACCESS_KEY_ID=[AWS_ACCESS_KEY_1]"
    }
  ]
}

email_check_syntax

Input ["jane@acme.com", "bob@gmial.com", "info@mailinator.com"], abridged to the key fields. No DNS lookups are done by the free tool, hence DNS_NOT_CHECKED; use email_validate_deliverability for MX/SPF/DMARC.

[
  {
    "email": "jane@acme.com",
    "verdict": "unknown",
    "reasons": [
      "DNS_NOT_CHECKED"
    ],
    "did_you_mean": null,
    "is_disposable": false,
    "is_role_account": false
  },
  {
    "email": "bob@gmial.com",
    "verdict": "risky",
    "reasons": [
      "POSSIBLE_TYPO",
      "DNS_NOT_CHECKED"
    ],
    "did_you_mean": "bob@gmail.com",
    "is_disposable": false,
    "is_role_account": false
  },
  {
    "email": "info@mailinator.com",
    "verdict": "risky",
    "reasons": [
      "DISPOSABLE_DOMAIN",
      "ROLE_ACCOUNT",
      "DNS_NOT_CHECKED"
    ],
    "did_you_mean": null,
    "is_disposable": true,
    "is_role_account": true
  }
]

osv_query_packages

{
  "meta": {
    "vulnerable_count": 2,
    "source": "https://api.osv.dev/v1/querybatch"
  },
  "items": [
    {
      "ecosystem": "npm",
      "name": "lodash",
      "version": "4.17.20",
      "vulnerable": true,
      "vuln_count": 5,
      "vuln_ids": [
        "GHSA-29mw-wpgm-hmr9",
        "GHSA-35jh-r3h4-6jhm",
        "GHSA-f23m-r3pf-42rh",
        "GHSA-r5fr-rjxr-66jc",
        "GHSA-xxjr-mmjv-4gpg"
      ]
    },
    {
      "ecosystem": "PyPI",
      "name": "django",
      "version": "3.2.0",
      "vulnerable": true,
      "vuln_count": 66,
      "vuln_ids": [
        "GHSA-2gwj-7jmv-h26r",
        "GHSA-2hrw-hx67-34x6",
        "GHSA-3h9f-r86x-qvjx",
        "… 63 more"
      ]
    },
    {
      "ecosystem": "npm",
      "name": "express",
      "version": "4.21.2",
      "vulnerable": false,
      "vuln_count": 0,
      "vuln_ids": []
    }
  ]
}

A paid tool without a token

Calling sanctions_screen_names without APIFY_TOKEN does not fail silently or spend anything; it returns a named error:

{
  "error": "APIFY_TOKEN_MISSING",
  "message": "This is a paid tool. Set APIFY_TOKEN to YOUR OWN Apify API token (https://console.apify.com/settings/integrations); usage is billed to your Apify account. Free tools work without a token.",
  "retryable": false
}

With a token, the paid tools return the same rows as the underlying Actors; see the real runs in our guides on sanctions screening, PII redaction and OSV checks in CI.

Example prompts

Security and privacy

The free tools never contact Apify or Fairquery; PII tools make no network calls at all, and the OSV tools call only api.osv.dev. The code contains no secrets, and your token is read only from your own environment. The source is MIT-licensed on GitHub, with a CI workflow and a SECURITY.md.

How it compares with alternatives

OptionGood forTrade-offs
Apify MCP server (mcp.apify.com)Calling any Apify Actor, including all Fairquery Actors, from an agentGeneric remote Actor interface; Actor runs are billed per run and there are no offline PII or email tools
Single-purpose Fairquery MCP servers (in each Actor's GitHub repo)Exposing just one capabilitySeparate servers to configure for each job
Building your own toolsFull controlYou maintain detectors, list parsers, OSV handling and tool descriptions yourself
Fairquery Agent Trust MCPFour common safety checks in one server, free local tier, paid depth on demandPattern-based PII detection; sanctions screening is not a certified service; no SMTP mailbox probing

FAQ

What is the easiest way to add PII redaction and safety checks to Claude Desktop or Cursor?

Add @fairquery/agent-trust-mcp to your MCP config with command 'npx' and args ['-y', '@fairquery/agent-trust-mcp']. Its free tools work without an account; set APIFY_TOKEN only for the paid tools.

Which tools are free?

Seven: pii_list_detectors, pii_scan_text, pii_redact_text, email_check_syntax and sanctions_list_sources run locally; osv_query_packages and osv_get_vulnerability call the free OSV.dev API directly.

What do the paid tools cost?

pii_guard_documents $0.0015/document + $0.0002/finding; email_validate_deliverability $0.00079/email; sanctions_screen_names $0.003/name + $0.007/call; osv_audit_dependencies $0.0005/package + $0.0015/vulnerability; trust_screen_lead $0.00079 per lead with an email + $0.003 per lead with a name (+ $0.007 per call when any lead has a name). They are billed to your own Apify account.

Is it in the official MCP Registry?

Yes, as io.github.fairquery/fairquery-agent-trust-mcp (npm package @fairquery/agent-trust-mcp, stdio transport). It is also listed on Glama.

Does my data leave my machine?

Not with the free PII and email tools; they make no network calls. The free OSV tools call only api.osv.dev. Paid tools send their input to the corresponding Fairquery Apify Actor run in your Apify account.

What happens if the agent calls a paid tool without a token?

It gets a named APIFY_TOKEN_MISSING error and nothing is charged.

Disclaimer: sanctions results come from automated fuzzy matching and are not a certified screening service or a legal determination; review every potential match yourself. Email checks do not probe SMTP mailboxes. PII detection is pattern-based and can miss data.

Links: npm: @fairquery/agent-trust-mcp · GitHub · MCP Registry entry · Glama · Fairquery on Apify · all Fairquery tools