Server data from the Official MCP Registry
A secure MCP server that lets AI agents query databases safely.
A secure MCP server that lets AI agents query databases safely.
SafeDB MCP is a well-architected security-focused database access server with strong query validation, proper sandboxing, and comprehensive access controls. The codebase demonstrates solid security practices with read-only transaction enforcement, SQL guardrails, PII masking, and audit logging. Minor code quality issues and a single low-severity finding do not materially impact the security posture. Supply chain analysis found 6 known vulnerabilities in dependencies (1 critical, 3 high severity). Package verification found 1 issue.
7 files analyzed · 9 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: YOUR_API_KEY
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-narekmalk-safedb-mcp": {
"env": {
"YOUR_API_KEY": "your-your-api-key-here"
},
"args": [
"-y",
"@safedb/safedb-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
SafeDB MCP is a secure Model Context Protocol server that lets AI agents inspect and query Postgres with strict read-only guardrails. It is designed for teams that want useful database access without handing an agent unrestricted production credentials.
Direct database credentials are dangerous for agents because a single bad prompt, tool call, or generated SQL statement can mutate data, exfiltrate sensitive columns, or run expensive queries. SafeDB MCP puts a policy layer between the agent and Postgres: only configured schemas and tables are visible, SQL is conservatively validated, row counts are capped, results are masked, and every query attempt is audited.
This project is an MVP. It prefers false positives and blocked queries over unsafe access, and it does not claim perfect SQL security.
list_schemas, list_tables, describe_table, run_readonly_query, explain_query, get_safedb_policypgSELECT, WITH ... SELECT, and EXPLAIN SELECTredact, email, partial, and deterministic hashsafedb-mcpnpm install
npm run build
npx safedb-mcp init --output safedb.yaml
DATABASE_URL=postgres://readonly:password@localhost:5432/app npx safedb-mcp validate-config --config safedb.yaml
DATABASE_URL=postgres://readonly:password@localhost:5432/app npx safedb-mcp test-connection --config safedb.yaml
DATABASE_URL=postgres://readonly:password@localhost:5432/app npx safedb-mcp --config safedb.yaml
Use a dedicated Postgres role with database-level read-only permissions. SafeDB MCP is a defense-in-depth layer, not a replacement for least-privilege database credentials.
database:
url: ${DATABASE_URL}
safety:
default_limit: 100
max_limit: 1000
statement_timeout_ms: 5000
allow_explain: true
access:
schemas:
public:
allow_tables:
- users
- orders
- products
deny_tables:
- secrets
column_masks:
users.email: email
users.phone: partial
users.password_hash: redact
users.ssn: redact
audit:
path: safedb-audit.jsonl
Claude Desktop:
{
"mcpServers": {
"safedb": {
"command": "safedb-mcp",
"args": ["--config", "/absolute/path/to/safedb.yaml"],
"env": {
"DATABASE_URL": "postgres://readonly:password@localhost:5432/app"
}
}
}
}
Cursor or Hermes-style MCP config:
{
"servers": {
"safedb": {
"command": "safedb-mcp",
"args": ["--config", "/absolute/path/to/safedb.yaml"],
"env": {
"DATABASE_URL": "postgres://readonly:password@localhost:5432/app"
}
}
}
}
SafeDB MCP aims to guarantee that:
statement_timeout.LIMIT.COPY.npm install
npm run build
npm test
npm run lint
MIT
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.