A Model Context Protocol server that enables AI to inspect SQL databases and analyze query performance.
Project description
MCP Server SQL Inspector
A Model Context Protocol (MCP) server that enables AI to inspect SQL databases and analyze query performance.
Features
- List Tables: See all available tables in your database.
- Get Schema: detailed schema information including columns, types, primary keys, foreign keys, and indexes.
- Table Statistics: specific row counts to understand table size.
- Explain Analyze: Run
EXPLAIN ANALYZE(or equivalent) on queries to get performance insights and execution plans.
Installation
Using uv (Recommended)
When using uv no installation is necessary. You can run the server directly:
uvx mcp-server-sql-inspector
Configuration with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"sql-inspector": {
"command": "uvx",
"args": ["mcp-server-sql-inspector"],
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/dbname"
}
}
}
}
From Source
git clone <repository-url>
cd mcp-server-sql-inspector
poetry install --extras all
Docker
docker run -e DATABASE_URL="postgresql://user:password@host:port/dbname" mcp-server-sql-inspector
Configuration
The server requires a DATABASE_URL environment variable to connect to your database.
Supported database protocols (requires appropriate drivers):
- PostgreSQL:
postgresql://... - MySQL:
mysql://... - MSSQL:
mssql+pyodbc://... - SQLite:
sqlite:///...
Development
-
Install dependencies:
poetry install --extras all
-
Run the server:
export DATABASE_URL="sqlite:///test.db" poetry run mcp-server-sql-inspector
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_sql_inspector-0.1.1.tar.gz.
File metadata
- Download URL: mcp_server_sql_inspector-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/25.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58cf0b5d681cc0989d570f984bb8daae63c941b97ac88b5b4d3849249b077a7e
|
|
| MD5 |
091da6ad0d396ee4b554606219ca2743
|
|
| BLAKE2b-256 |
d49fe807d653e106d9a441823a683ce59859652f14cfaa680ae793b32c7bb065
|
File details
Details for the file mcp_server_sql_inspector-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_server_sql_inspector-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/25.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31f461ab51a5d82b72982c48cc791c40e7b504deed000abc26890bec287710e7
|
|
| MD5 |
3ed50a51676fa01f015fe2fbaa76a518
|
|
| BLAKE2b-256 |
d1c7116e171bdba2cbe65fc0420c0cb9cd0a445f670a37293c0d5e99f06a94b8
|