Skip to main content
Glama
fairquery

fairquery-agent-trust-mcp

Official
README.md
# Fairquery Agent Trust & Data Safety (MCP server)

One MCP server for AI agents that handle untrusted data. It covers four jobs:

- **PII and secret redaction**: check text before it reaches an LLM.
- **Email checks**: syntax, typos, disposable and role addresses, plus MX/SPF/DMARC in the paid tool.
- **Sanctions screening**: OFAC, EU, UK and UN lists.
- **Dependency vulnerabilities**: lookups against OSV.dev.

**Free tools need no token or account and run on your machine.** Paid tools are optional. They call public Fairquery Apify Actors with *your own* `APIFY_TOKEN`, and runs are billed to your Apify account.

## Tools

| Tool | Cost | What it does |
|---|---|---|
| `pii_list_detectors` | Free (local) | Catalog of detectors, redaction styles, and pricing for every paid tool |
| `pii_scan_text` | Free (local) | Finds PII and secrets in text. Findings are paged and show masked values only |
| `pii_redact_text` | Free (local) | Redacts with placeholder, mask or hash style. Can return a placeholder map |
| `pii_guard_documents` | $0.003/doc + $0.0005/finding | Adds NER names/addresses, URLs and PDFs, and restore mode |
| `email_check_syntax` | Free (local) | Syntax, normalization, typo suggestions, disposable/role/free-provider flags |
| `email_validate_deliverability` | $0.002/email | DNS/MX, null MX, SPF/DMARC, mail provider, verdict |
| `sanctions_list_sources` | Free (local) | Lists covered, issuing authorities, disclaimer |
| `sanctions_screen_names` | $0.005/name | Fuzzy screening against OFAC SDN/Consolidated, EU, UK and UN |
| `osv_query_packages` | Free (api.osv.dev) | Vulnerable or not, plus advisory IDs, for up to 200 exact versions |
| `osv_get_vulnerability` | Free (api.osv.dev) | Full OSV advisory records |
| `osv_audit_dependencies` | $0.0009/package + $0.0028/vuln | Manifest/lockfile audit with severity, fixes and recommended version |
| `trust_screen_lead` | $0.002/email + $0.005/name | Email check and sanctions screening in parallel, merged into a pass/review/block decision per lead |

Every tool description has WHAT / WHEN / WHEN NOT / COST / RETURNS / EXAMPLE sections. Outputs are paged (`limit`, `offset`, `nextOffset`, `hasMore`). Errors use named codes: `APIFY_TOKEN_MISSING`, `APIFY_TOKEN_INVALID`, `APIFY_PAYMENT_REQUIRED`, `APIFY_ACTOR_RUN_FAILED`, `APIFY_TIMEOUT`, `INPUT_EMPTY`, `INPUT_TOO_LARGE`, `INVALID_ECOSYSTEM`, `OSV_FETCH_FAILED` and `VULN_NOT_FOUND`.

Paid tools use these Apify Actors: `fairquery/llm-data-guard-pii-secrets`, `fairquery/email-validator-mx-disposable`, `fairquery/sanctions-watchlist-screener` and `fairquery/osv-dependency-vulnerability-check`.

## Install

Requires Node.js 20 or later. `APIFY_TOKEN` is optional and only needed for paid tools. Get one at <https://console.apify.com/settings/integrations>.

### Claude Desktop (`claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "fairquery-trust": {
      "command": "npx",
      "args": ["-y", "github:fairquery/fairquery-agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "<optional-your-apify-token>" }
    }
  }
}
```

### Cursor (`~/.cursor/mcp.json` or `.cursor/mcp.json`)
```json
{
  "mcpServers": {
    "fairquery-trust": {
      "command": "npx",
      "args": ["-y", "github:fairquery/fairquery-agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "<optional-your-apify-token>" }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)
```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", "github:fairquery/fairquery-agent-trust-mcp"],
      "env": { "APIFY_TOKEN": "${input:apify-token}" }
    }
  }
}
```

### From source / Docker
```bash
git clone https://github.com/fairquery/fairquery-agent-trust-mcp && cd fairquery-agent-trust-mcp
npm ci && npm run build && node dist/index.js            # stdio
node dist/index.js --http                                # Streamable HTTP on http://127.0.0.1:3000/mcp (PORT, HOST env)
docker build -t fairquery-trust-mcp . && docker run -i --rm -e APIFY_TOKEN fairquery-trust-mcp
```

## Tests
```bash
npm run smoke        # initialize + tools/list + guide/annotation checks, no token
npm run test:live    # every free tool live, ReDoS probes, paid tools without token -> APIFY_TOKEN_MISSING
npm run test:paid    # also ONE paid call per family using APIFY_TOKEN from env (costs < $0.02)
```

## Security
See [SECURITY.md](SECURITY.md). Free tools never contact Apify or Fairquery, and the code contains no secrets.

## Disclaimer
Sanctions results come from automated fuzzy matching and are not a certified screening service. Review every potential match yourself. Email checks do not probe SMTP mailboxes.

## License
MIT © Fairquery

TDQS

A4.5/5.0

Scored across 12 tools

Disambiguation4/5

Within each domain the tools are clearly separated by action (scan vs redact vs guard) and by free-local vs paid-Actor tiering, and every description includes explicit WHEN NOT cross-references. The only residual overlap is the deliberate free/paid pairing (pii_scan_text vs pii_guard_documents, email_check_syntax vs email_validate_deliverability, osv_query_packages vs osv_audit_dependencies) plus the convenience wrapper trust_screen_lead, but each is clearly bounded by scope and cost.

Naming Consistency5/5

All 12 tools use consistent snake_case with a domain prefix followed by a verb/action phrase (pii_*, email_*, sanctions_*, osv_*, trust_*). The pattern is predictable and readable throughout, with no mixing of conventions.

Tool Count5/5

Twelve tools are well-scoped across four coherent domains (PII, email, sanctions, OSV), each with roughly three complementary operations plus a combined orchestration tool. No tool feels redundant; every one earns its place.

Completeness4/5

Each domain covers discovery/catalog, free local, and paid hosted operations, and the combined trust_screen_lead provides an end-to-end workflow, so there are no dead ends. Gaps are acknowledged rather than hidden (no PEP/adverse media, no SMTP probing, no image OCR), which are minor for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues