Read-only MCP server for PostgreSQL, MySQL & SQLite. Lets AI assistants (Claude, Cursor, VS Code) explore schemas, run safe SELECT queries, read EXPLAIN plans, get index suggestions, and review migrations. Writes are blocked by design.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add db-explorer --env DATABASE_URL='<DATABASE_URL>' -- uvx db-explorer-mcp-server~/.codex/config.toml
[mcp_servers.db-explorer]
command = "uvx"
args = ["db-explorer-mcp-server"]
env = { DATABASE_URL = "<DATABASE_URL>" }
# codex mcp add db-explorer --env DATABASE_URL='<DATABASE_URL>' -- uvx db-explorer-mcp-server~/.cursor/mcp.json
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"db-explorer": {
"type": "stdio",
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}需要的环境变量
DATABASE_URL
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。