db-read is a read-only MCP server (Model Context Protocol) for coding agents to safely access PostgreSQL, MySQL, and MongoDB databases. Version 0.1.1 is the first stable release, offering unified configuration via .db-read.yml, CLI tools for validation and serving, and strict read-only guards: SQL queries are filtered for multi-statement and non-read commands, MongoDB aggregation blocks $out and $merge, and limits on rows/documents and timeouts are enforced. It supports environments (dev, staging, prod) and local or hosted connections. Compared to other MCP database tools, db-read uniquely supports three database kinds in one server with a focus on read-only safety for AI agents.
npm install db-readNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with .db-read.yml config file, CLI commands for validation and serving, and a programmatic ESM import example.
Use import syntax or set \"type\": \"module\" in package.json.
Upgrade Node to v20 or later.
Copy .db-read.example.yml to .db-read.yml and fill in credentials.
Do not rely on ${VARIABLE} syntax; use direct values or a separate env management tool.Remove $out and $merge stages from your aggregations.
Change require('db-read') to import 'db-read'.Add 'defaultEnvironment: dev' (or another env) to the config.
Increase timeoutMs in .db-read.yml under defaults or connection config.