Skip to main content
Glama
README.md
# `seedmask-mcp` — Offline Deterministic `pg_dump`, MySQL, CSV & JSONL PII Anonymizer MCP Server, CLI & GitHub Action

[![z121245017-ai/seedmask-mcp MCP server](https://glama.ai/mcp/servers/z121245017-ai/seedmask-mcp/badges/score.svg)](https://glama.ai/mcp/servers/z121245017-ai/seedmask-mcp)

Zero-dependency, 100% offline **Model Context Protocol (`MCP`) Server**, **CLI**, and **GitHub Action** enabling AI coding agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to deterministically sanitize **PostgreSQL `COPY ... FROM stdin` dumps**, **MySQL `INSERT INTO` dumps**, **RFC 4180 `.csv` exports**, and **`.jsonl` / `.json` traces** without breaking **cross-table `FOREIGN KEY` joins**, **`UNIQUE` constraints**, **`ISO/IEC 7812 Luhn` payment card check digits**, or **`GB 11643-1999 Mod 11-2` 18-digit Resident ID check characters**.

## MCP Tools Exposed (`stdio`)

| Tool | Purpose | Safety Annotations |
| :--- | :--- | :--- |
| `anonymize_sql_or_structured_dump` | Deterministically anonymizes PostgreSQL `COPY ... FROM stdin` blocks (preserving `\N` NULLs & `jsonb`), SQL `INSERT INTO` multi-row statements (`''` & `\'` quote-safe), RFC 4180 `.csv` exports, and `.jsonl`/`.json` payloads via HMAC-SHA256 token mapping. | `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `audit_unmasked_pii_exposure` | Scans SQL seed scripts, CSV exports, and JSONL fixtures offline for live non-RFC-2606 emails, Luhn payment cards outside sandbox BINs, valid GB 11643-1999 18-digit IDs, public IPv4s, and unredacted JWT/API tokens without echoing raw secrets. | `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `verify_cross_table_fk_consistency` | Anonymizes two or more related SQL, CSV, or JSONL datasets under a shared HMAC-SHA256 session salt and verifies 100% `FOREIGN KEY` join parity across parent and child tables. | `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `validate_synthetic_checksums` | Validates or deterministically generates format-preserving test identifiers passing `ISO/IEC 7812 Luhn Mod-10` (`400000` test cards), `GB 11643-1999 Mod 11-2` (18-digit Chinese Resident IDs), RFC 2606 safe emails, and RFC 5737 documentation IPs. | `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |

## Quick Start (MCP Client & Local CLI)

```bash
# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/seedmask-mcp

# List MCP tool schemas from terminal
npx -y github:z121245017-ai/seedmask-mcp --list

# Deterministically sanitize a pg_dump or MySQL seed file offline
npx -y github:z121245017-ai/seedmask-mcp --input ./prod_dump.sql --output ./staging_seed.sql --salt staging-2026

# Audit repository test fixtures for accidental PII leaks (exits 2 on findings)
npx -y github:z121245017-ai/seedmask-mcp --input ./fixtures/seed.sql --audit-only

# Invoke any MCP tool directly via --cli
npx -y github:z121245017-ai/seedmask-mcp --cli validate_synthetic_checksums '{"generateFromSeed":"qa-checkout-01"}'
```

### Claude Desktop / Cursor / Windsurf / Antigravity Config

```json
{
  "mcpServers": {
    "seedmask": {
      "command": "npx",
      "args": ["-y", "github:z121245017-ai/seedmask-mcp"]
    }
  }
}
```

### Docker (`node:22-alpine`, non-root `USER node`)

```bash
docker build -t seedmask-mcp .
docker run -i --rm seedmask-mcp
```

## GitHub Action (`z121245017-ai/seedmask-mcp@v1`)

Block accidental commits of unmasked production emails, Luhn payment cards, 18-digit Resident IDs, public IPs, and bearer credentials inside `.sql`, `.csv`, and `.jsonl` test fixtures:

```yaml
name: SeedMask Fixture PII Gate

on:
  pull_request:
    paths:
      - '**/*.sql'
      - '**/*.csv'
      - '**/*.jsonl'

permissions:
  contents: read

jobs:
  seedmask:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Scan SQL, CSV & JSONL fixtures for unmasked PII
        uses: z121245017-ai/seedmask-mcp@v1
        with:
          paths: 'seeds,fixtures'
          strict: 'true'
```

## Format-Preserving Checksum & Referential Integrity Matrix

| PII Category | Deterministic Output Standard | Downstream Validator Compatibility |
| :--- | :--- | :--- |
| **Email (`UNIQUE` / `FK`)** | `first.last.<6hex>@example.test` (RFC 2606) | Case-normalized HMAC keeps `users.email = orders.email` joins intact |
| **Payment Card (`PAN`)** | `4000-00xx-xxxx-xxxC` (Visa sandbox BIN) | Passes `ISO/IEC 7812 Luhn Mod-10` check digit validation |
| **18-Digit CN Resident ID** | Valid GB/T 2260 region + calendar `YYYYMMDD` + Mod 11-2 | Passes `GB 11643-1999` (`ISO 7064 Mod 11-2`, including `X` check char) |
| **Phone (`CN` / `E.164`)** | `138`/`139` 11-digit mobile & `+1-xxx-555-01xx` | Preserves `+86`, hyphen, parenthesis, and numeric JSON column types |
| **Client IP (`IPv4` / `IPv6`)** | `203.0.113.1..254` & `2001:db8:5eed::/48` | RFC 5737 & RFC 3849 non-routable documentation blocks |
| **API Keys & JWTs** | `smk_test_EXAMPLE_REDACTED_<12hex>` | Eliminates live bearer credentials while keeping 3-part JWT structure |

## Commercial Air-Gapped Browser Workbench & DevSecOps Suite

Need a zero-install **Bilingual Air-Gapped Browser Workbench (`connect-src 'none'`)** for drag-and-drop SQL/CSV/JSONL sanitization, zero-plaintext JSON/Markdown compliance audit certificates, `1080×1440` sign-off cards, and Excel column audit summaries without touching the command line?

Explore **SeedMask Pro Workbench** and our full offline DevSecOps & developer utility catalog at **[https://z121245017-ai.github.io/](https://z121245017-ai.github.io/)**.

## Verification

```bash
npm test
```

## License

MIT License — `0` external npm dependencies, `0` network calls, `100%` local deterministic execution.

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation4/5

Each tool has a distinct primary action: anonymize, audit, verify cross-table integrity, and validate/generate checksums. anonymize_sql_or_structured_dump and verify_cross_table_fk_consistency both perform anonymization, but the latter is clearly scoped to multi-dataset shared-salt workflows and referential-integrity verification.

Naming Consistency5/5

All tool names use consistent snake_case with a leading action verb followed by a clear object phrase. The pattern is predictable across anonymize, audit, verify, and validate operations.

Tool Count5/5

Four tools is well-scoped for a focused seed-data anonymization and validation server. Each tool earns its place by covering a distinct stage of the workflow rather than duplicating functionality.

Completeness4/5

The surface covers detection, anonymization, cross-table integrity verification, and format-preserving identifier validation/generation. Minor gaps exist around salt/mapping lifecycle management or exporting audit evidence, but core offline masking workflows are covered.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues