Skip to main content

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)

uvx mcp-server-sql-inspector

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

  1. Install dependencies:

    poetry install --extras all
    
  2. Run the server:

    export DATABASE_URL="sqlite:///test.db"
    poetry run mcp-server-sql-inspector
    

License

MIT

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

mcp_server_sql_inspector-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_sql_inspector-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_sql_inspector-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_server_sql_inspector-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/25.1.0

File hashes

Hashes for mcp_server_sql_inspector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6c100f729b508bfb6da0392ca4aae9084f37f1df20fff48fc9f08bec4346ad1
MD5 a9b535c3c1e8766ab58fc96d20c2946c
BLAKE2b-256 21e15c51867a1fe36838e370857030629d593c2ce6716893a223b041ddba3972

See more details on using hashes here.

File details

Details for the file mcp_server_sql_inspector-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_sql_inspector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e849184d7a137999a75ab91ec831d98380a900680a11a2f1944243386e43cdd1
MD5 99180552071014f0f703fd4d9e586d20
BLAKE2b-256 47e139968663d1acf6114a1649dd7c24e883d57ed35417bec38dc4066e86e809

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page