QueryVault MCP
Provides read-only SQLite database inspection and querying capabilities, including listing tables, describing schemas, running guarded SELECT/WITH queries with PII redaction, explaining query plans, and detecting numeric anomalies.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
QueryVault MCP
Read-only SQLite Model Context Protocol (MCP) server built with FastMCP and Pydantic v2. It exposes database inspection, guarded SQL execution, automatic PII redaction, query plan auditing, and z-score anomaly detection over stdio or Streamable HTTP with zero external API keys.
Architecture
flowchart LR
Client["MCP Client (Claude Desktop / Cursor / FastMCP)"] --> Server["QueryVault FastMCP Server"]
Server --> Guard["SQL Guard (comment strip, stacked check, keyword block)"]
Guard --> DB["SQLite URI (?mode=ro + PRAGMA query_only=ON)"]
DB --> Redactor["PII Redaction Engine (column names + email/phone regex)"]
Redactor --> Audit["Bounded Audit Log (deque maxlen=100)"]
Audit --> ClientMCP Client (stdio / Streamable HTTP)
|
v
+---------------------------------------------------+
| QueryVault FastMCP Server |
| - 5 Tools (list, describe, query, explain, z) |
| - 3 Resources (schema, table sample, audit log) |
| - 2 Prompts (revenue drop, query performance) |
+---------------------------------------------------+
|
v
+---------------------------------------------------+
| Security & Guardrails Layer |
| 1. Comment stripper (-- and /* */) |
| 2. Stacked statement rejector (;) |
| 3. Read-only prefix + blocked keyword filter |
| 4. Identifier allowlist against sqlite_master |
| 5. PII redactor (columns + inline regex) |
+---------------------------------------------------+
|
v
SQLite (?mode=ro, PRAGMA query_only=ON, timeout=5s)Related MCP server: shop-sql-mcp
MCP Primitives
Tools (5)
list_tables: Lists tables, row counts, indexes, and detected PII columns.describe_table(table_name): Returns column types, nullability, PK/FK constraints, distinct counts, and PII flags.run_readonly_query(sql, limit=50, redact_pii=True): Executes a single guardedSELECTorWITH ... SELECTstatement with execution timing (elapsed_ms), row-cap enforcement, and PII redaction.explain_query_plan(sql): RunsEXPLAIN QUERY PLAN, flags full tableSCANsteps, and generatesCREATE INDEXrecommendations.detect_anomalies(table_name, column_name, z_threshold=2.0): Computes mean, sample standard deviation, and z-score outliers on a validated numeric column.
Resources (3)
db://schema: Full JSON schema, index map, PII column inventory, and server limits.db://tables/{table_name}/sample: PII-redacted 5-row sample of a validated table.db://audit/recent: Recent in-memory audit log entries (newest first).
Prompts (2)
investigate_revenue_drop: Guided workflow chaining schema inspection, z-score anomaly detection, and grouped root-cause queries.audit_query_performance: Guided workflow chainingexplain_query_plan, index review, andCREATE INDEXproposals.
Security Invariants and Hard Caps
SQLite Read-Only Enforcement: Every connection opens via
file:<path>?mode=ro(uri=True) and immediately executesPRAGMA query_only = ON.SQL Statement Guard: Comments (
--and/* */) are stripped before inspection. Stacked statements (;followed by non-whitespace) are rejected. Only singleSELECT,WITH ... SELECT, orEXPLAIN QUERY PLAN SELECTstatements pass. Blocked keywords (INSERT,UPDATE,DELETE,DROP,ALTER,CREATE,REPLACE,TRUNCATE,ATTACH,DETACH,VACUUM,REINDEX,PRAGMA,SAVEPOINT,RELEASE,ROLLBACK,BEGIN,COMMIT,LOAD_EXTENSION) are rejected outside string literals.PII Redaction: Columns matching
email,phone,mobile,ssn,api_key,token,password, orsecretare masked automatically. Inline email addresses (a***@example.com) and phone numbers (***-***-1234) inside free-text columns (such asnotesorpayload) are also redacted.Hard Caps:
Default query row limit:
50Maximum query row limit:
100(requests above100are clamped to100withtruncated=Truewhen additional rows exist)SQLite busy timeout:
5.0secondsIn-memory audit log retention:
100entries (collections.deque(maxlen=100))
Quickstart
Local setup (project-local venv)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"Run the live showcase
python scripts/demo_showcase.pyRun the test suite
pytest -vRun as a server
Stdio transport (default):
queryvault-mcp --db demo.db --seed-demo --transport stdioStreamable HTTP transport:
queryvault-mcp --db demo.db --seed-demo --transport http --host 127.0.0.1 --port 8000Docker:
docker build -t queryvault-mcp .
docker run --rm -p 8000:8000 queryvault-mcpClient Configuration
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"queryvault": {
"command": "C:/path/to/queryvault-mcp/.venv/Scripts/queryvault-mcp.exe",
"args": [
"--db",
"C:/path/to/queryvault-mcp/demo.db",
"--seed-demo",
"--transport",
"stdio"
]
}
}
}Cursor (.cursor/mcp.json)
{
"mcpServers": {
"queryvault": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Governed SQL access to your databases: redaction, query review and an audit log.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Read-only bank & investment accounts via Plaid: balances, holdings, transactions, SQL analytics.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables safe exploration and analysis of SQLite databases through guarded read-only queries, schema inspection, aggregations, and CSV imports.5MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents read-only analytical access to a SQLite database over stdio, with tools for listing tables, describing schemas, and running paginated SQL queries.-
- FlicenseAqualityCmaintenanceEnables safe read-only analysis of a local SQLite e-commerce database over stdio, providing tools for schema inspection and parameterized SELECT queries.2-
- AlicenseNot gradedqualityCmaintenanceEnables AI models to securely analyze SQLite datasets and read local text documents through a local stdio interface. It provides read-only querying, schema discovery, pagination, and timeout protections to prevent data leaks or destructive changes.MIT