DB-Explorer-MCP
Provides database exploration tools for MySQL, including schema inspection, safe read-only query execution, query plan explanation, index suggestions, and migration validation.
Provides database exploration tools for PostgreSQL, including schema inspection, safe read-only query execution, query plan explanation, index suggestions, and migration validation.
Provides database exploration tools for SQLite, including schema inspection, safe read-only query execution, query plan explanation, index suggestions, and migration validation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DB-Explorer-MCPwhat tables are in the database, and show me the schema for the orders table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Database Explorer MCP
A FastMCP server for exploring and safely querying relational databases. The local development database is SQLite; SQLAlchemy also supports PostgreSQL and MySQL through their drivers.
Architecture
The MCP client performs natural-language reasoning and generates SQL. This server exposes database tools, validates read-only queries, executes them, and returns structured results.
MCP client LLM -> FastMCP tools -> safety layer -> SQLAlchemy -> databaseThe server does not call Anthropic, so an Anthropic API key is not required.
Related MCP server: nl2sql-mcp
Setup
Install uv, then from this directory run:
uv sync
uv run python tests/seed_test_db.py
uv run pytestIf uv is not on PATH yet, use:
py -m uv sync
py -m uv run pytestThe default database is:
sqlite:///sample.dbTo use another database, set DATABASE_URL before starting the server. Examples:
$env:DATABASE_URL = "sqlite:///C:/data/example.db"
$env:DATABASE_URL = "postgresql+psycopg2://user:password@localhost:5432/example"
$env:DATABASE_URL = "mysql+pymysql://user:password@localhost:3306/example"Run the MCP server
uv run server.pyThe shareable VS Code MCP configuration is in .vscode/mcp.json. It starts the server over stdio and can be used with MCP-compatible clients and Inspector.
For remote hosting, use Streamable HTTP:
$env:MCP_TRANSPORT = "streamable-http"
$env:MCP_HOST = "0.0.0.0"
$env:MCP_PORT = "8000"
uv run server.pyThe remote deployment must provide authentication and protect DATABASE_URL through its secret configuration.
Tools
explore_schema: list tables or inspect one tableexecute_query: execute one safe read-onlySELECTexplain_query: return the native execution planvalidate_schema: report missing primary keys and unindexed foreign keyssuggest_index: suggest indexes from table metadata or a query planmigration_context: provide schema context for client-side migration generationvalidate_migration: validate proposedUPandDOWNscripts without executing them
Every query execution and explanation passes through the safety layer. Mutating statements, comments, and multiple statements are rejected. Query results default to a maximum of 100 rows.
Tests
uv run pytestThe test suite uses temporary SQLite databases and does not require external credentials or a running database server.
Remote deployment
See DEPLOYMENT.md for the FastMCP Horizon deployment steps, remote database requirements, and authentication checklist.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides safe, read-only access to SQLite databases through MCP. This server is built with the FastMCP framework, which enables LLMs to explore and query SQLite databases with built-in safety features and query validation.107
- FlicenseNot gradedqualityFmaintenanceA production-ready MCP server that transforms natural language into safe, executable SQL queries with multi-database support and intelligent schema analysis.1
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for PostgreSQL that enables safe database introspection and querying via natural language.539MIT
- AlicenseNot gradedqualityAmaintenanceRead-only Text-to-SQL MCP server for PostgreSQL and MySQL that lets users query databases using natural language, with robust multi-layer safety guarantees against writes.22MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AYUSH-148/DB-Explorer-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server