Read-only SQL, MongoDB, Redis and Elasticsearch access, switchable mid-conversation.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
Let your AI assistant look at your databases without being able to change them.
Point it at MySQL, PostgreSQL, SQLite, SQL Server, ClickHouse, MongoDB, Redis or Elasticsearch, then just ask questions in plain words: "how many users signed up this week?", "what's in the orders table?", "which Redis keys hold sessions?". It can read anything you give it access to, and it cannot write, update or delete anything.
Works with Claude Desktop, Claude Code, and any other MCP client.
1. Have Node.js 22.13 or newer (node --version), or Docker.
2. Add the server to your client. For Claude Desktop, edit claude_desktop_config.json (Settings, Developer, Edit Config). For Claude Code, create .mcp.json in your project:
Replace the DB_URL with your own database. The examples below show one for every kind.
3. Restart the client once, and ask away:
"What tables are in my database?" "Show me the 5 newest orders." "How many customers are in each country?"
That's it. You never need to restart again to change database; just ask the assistant to switch.
Each database has a URL format, then a real example to copy and change. Put the finished URL in DB_URL.
Replace each [PLACEHOLDER] with your own value:
| Placeholder | What to put there |
|---|---|
[USER] | The database user name |
[PASSWORD] | That user's password |
[HOST] | The server's address, e.g. localhost or db.example.com |
[PORT] | The server's port. Optional: leave out :[PORT] to use the usual one shown for each database |
[DATABASE] | The database name. Optional for most: leave it out and ask the assistant to list them |
No password? Leave out :[PASSWORD]. No user either? Leave out [USER]:[PASSWORD]@ entirely.
Format (usual port 3306):
Example:
"List the tables in shop." · "Describe the orders table." · "What were last month's top 10 products by revenue?"
Format (usual port 5432). Add ?sslmode=require to use TLS:
Example:
"Which tables are in the reporting schema?" · "Show the foreign keys on invoices." · "Count signups per day this week."
Format (three slashes, then the full path to the file):
Example:
The file is opened read-only.
"What tables does this file have?" · "Show 10 rows from notes."
Format (usual port 1433). Add ?trustServerCertificate=true for a local server with a self-signed certificate:
Example:
"List the tables in Sales." · "Show the top 5 customers by order total." (SQL Server uses
TOP 5, notLIMIT; the assistant knows.)
Format (usual port 8123, or 8443 with clickhouse+https):
Example:
"How many events per hour did we have yesterday?" · "What is the sorting key of the events table?"
Format (usual port 27017). Use mongodb+srv for MongoDB Atlas, with no port:
Example:
"What collections are in myapp?" · "What fields do documents in users have?" · "Find the 5 most recent orders over 100." · "Count users by country."
Format (usual port 6379). [DB_NUMBER] is the database number, 0 if left out; rediss means TLS:
Example:
"Which keys start with session:?" · "What's inside user:42?" · "How long until cache:home expires?"
Format (usual port 9200, no database). Add +https for TLS, or ?api_key=[API_KEY] instead of a user and password:
Example:
"What indices do we have?" · "Find error logs from the last hour." · "How many documents are in logs-2026.09?"
Detailed notes for every database, including how to create a read-only account, are in the Databases guide.
Give each one a name with DB_PROFILES, and switch by asking ("switch to legacy", "use the cache"):
You can also connect to a database you didn't list, mid-conversation: "connect to postgres://readonly@10.0.0.5/reports".
Password with special characters (@, /, #)? Give it separately instead of inside the URL: DB_PASSWORD next to DB_URL, or {"url": "...", "password": "..."} inside DB_PROFILES.
Nothing to install but Docker:
Inside Docker, use host.docker.internal instead of localhost to reach a database on your own computer. For SQLite, mount the folder: add "-v", "/Users/me/data:/data:ro" and use sqlite:///data/app.db.
Turn on logging to keep a record of every query the assistant runs, and see them live in your browser.
1. Save logs to a folder by adding this to the server's env:
Each query is saved as its own file, one folder per day. Nothing is ever deleted automatically.
2. Open the viewer in a terminal, whenever you want to watch:
Then open http://127.0.0.1:4800/. You'll see every call: what was asked, the exact query sent, how long it took, and the result. It updates live, shows 20 per page (10, 20, 30 or 50 to choose from), and lets you filter and copy anything. Press Ctrl+C to close it.
The viewer has no password. Anyone who can reach that port on your network can read the log while it runs.
Passwords are never written to the logs. More in the Logging guide.
Yes, in two independent ways, so a mistake in one is caught by the other:
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/databases-read-only-switchable)<a href="https://allmcps.com/mcp/databases-read-only-switchable"><img src="https://allmcps.com/api/badge/databases-read-only-switchable?style=directory" alt="Databases (read Only, switchable) on AllMCPs" /></a>