DB Explorer MCP
Read-only MCP server letting AI assistants explore schemas and run safe SELECTs on Postgres, MySQL, SQLite.
Tested on Linux
Use it
Linux x86_64
You need first
- Runtimes:
Python 3.11+
git clone https://github.com/AYUSH-148/DB-Explorer-MCP.git repo
git clone https://github.com/AYUSH-148/DB-Explorer-MCP.git repouv sync (installs dependencies)
cd repo && uv sync
Check that it works
cd repo && uv run pytest -qThe output should contain “336 passed”.
First thing to try
cd repo && uv run pytest -qAdd it to your agent
claude mcp add db-explorer-mcp -e DATABASE_URL='<DATABASE_URL>' -e MCP_AUTH_TOKEN='<MCP_AUTH_TOKEN>' -- uv run server.pyJSON for Claude Desktop, Cursor and other clients
{
"mcpServers": {
"db-explorer-mcp": {
"command": "uv",
"args": [
"run",
"server.py"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>",
"MCP_AUTH_TOKEN": "<MCP_AUTH_TOKEN>"
}
}
}
}You fill in
DATABASE_URL: database connection string (required)MCP_AUTH_TOKEN: bearer token for HTTP (required)
Ask the user for DATABASE_URL, MCP_AUTH_TOKEN; pickfit never had a value, so these are placeholders.
Start the server with uv run server.py from the project folder and connect it to your MCP client.
What it does
- Explore database schemasTested
How to use it
- Start the server with
uv run server.pyand connect your MCP client. - Call the
explore_schematool with no arguments to list tables and columns.
- Start the server with
- Run safe SELECT queriesTested
How to use it
- Start the server with
uv run server.pyand connect your MCP client. - Call the
execute_querytool with{"sql": "<your SELECT query>"}.
- Start the server with
- Read EXPLAIN query plansTested
How to use it
- Start the server with
uv run server.pyand connect your MCP client. - Call the
explain_querytool with{"sql": "<your SELECT query>"}to see its execution plan.
- Start the server with
- Get index suggestionsNot shown working
How far pickfit got
Linux x86_64
- Installs
- Connects
- 3 of 4 features work
- Works offline
Good for
- list tables and find missing primary keys
- query top rows from orders table
- explain slow query execution plan
- suggest indexes for unindexed foreign keys
- draft and validate database migration scripts
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
An MCP client called one of its tools
- Replayed from scratch
- Works offline
- Checked on 1 Nov 2026
- Version 3.4.7
An MCP client handshake over stdio listed 7 tools, and a call to explore_schema returned a result.