pii-safe-db-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_SSL | No | Enables TLS with certificate verification. Default: false | |
| DB_HOST | No | Database host, used as an alternative to DATABASE_URL | |
| DB_NAME | No | Database name, used as an alternative to DATABASE_URL | |
| DB_PORT | No | Database port, used as an alternative to DATABASE_URL | |
| DB_TYPE | No | Database type: mysql or postgres. Needed only if DATABASE_URL is not set. | |
| DB_USER | No | Database user, used as an alternative to DATABASE_URL | |
| MAX_ROWS | No | Maximum number of rows returned per query. Default: 200 | |
| DB_PASSWORD | No | Database password, used as an alternative to DATABASE_URL | |
| DATABASE_URL | No | Database connection URL, e.g. mysql://user:pass@host:3306/db or postgres://user:pass@host:5432/db | |
| PII_MASK_MODE | No | Masking mode: token, partial, or redact. Default: token | |
| PII_SCAN_VALUES | No | Scans text values for embedded PII. Default: true | |
| PII_TOKEN_SECRET | No | HMAC secret for tokens. Set it to keep tokens stable across restarts. Default: random per run | |
| QUERY_TIMEOUT_MS | No | Per-query timeout in milliseconds. Default: 15000 | |
| PII_ALLOW_COLUMNS | No | Comma-separated columns never masked, for false positives, e.g. name or products.name | |
| PII_EXTRA_COLUMNS | No | Comma-separated columns that are always fully masked, e.g. notes or table.column | |
| PII_BLOCKED_COLUMNS | No | Comma-separated list of columns that can never be queried, e.g. password_hash,otp |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_tablesA | List tables and views in the connected postgres database. |
| describe_tableA | Show the columns of a table, their types, and whether each column is classified as PII (and will be masked) or blocked. |
| queryA | Run a single read-only SQL statement (SELECT / WITH / SHOW / DESCRIBE / EXPLAIN) against postgres. Results are capped at 200 rows. PII is masked before results are returned: columns recognised as PII (email, phone, name, address, Aadhaar, PAN, card numbers, passwords...) are replaced with stable tokens like <EMAIL_3f9a1c2b7d> (same input → same token, so you can still GROUP BY / COUNT DISTINCT / compare), and PII patterns found inside other text columns are masked too. Prefer aggregates (COUNT, GROUP BY) over pulling raw rows. Use ? (MySQL) or $1 (Postgres) placeholders with |
| pii_scanA | Sample rows from a table and report which columns contain PII (by column name and by detected values). Returns counts only, never values. Use it to discover PII hiding in free-text columns. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 4 tools
Each tool has a fairly clear role: schema listing, schema inspection, ad-hoc SQL execution, and PII value sampling. The main soft overlap is between describe_table (declared/classified PII) and pii_scan (PII detected in sampled values), which could confuse an agent deciding how to audit a column, but the descriptions do distinguish name-based vs value-based detection.
list_tables and describe_table follow a clean verb_noun snake_case pattern, but 'query' is a bare verb with no object and 'pii_scan' reverses the order into noun_verb. Readable overall, but the convention is not uniform across the set.
Four tools is lean but defensible for a deliberately read-only, PII-safe database interface where each tool maps to a distinct stage (discover tables, inspect columns, execute, audit PII). It sits just below the ideal range, and a schema-search or relationship tool could plausibly earn a place.
The read-only domain is well covered: discovery, column classification, masked querying with parameters, and PII detection in free text. Gaps are minor and mostly by design (no foreign-key/relationship introspection, hard 200-row cap with no pagination), and agents can work around them via query.