Skip to main content

sql-mini-mcp

A read-only SQL Server MCP server for coding agents: 6 metadata tools, no unrestricted SQL.

CI Release PyPI Version Python License: MIT

Model Context Protocol compatible MCP Registry: io.github.proprock/sql-mini-mcp

Read the data. Protect the identity.

Read the data. Protect the identity.

General-purpose database MCP servers hand the agent a raw SQL prompt and dozens of tools. This server gives a coding agent the schema knowledge it needs to write correct code - servers, databases, tables, columns, keys, indexes, stored procedures - and nothing that can change or leak data.

  • 6 tools, all read-only - every one is annotated read-only and earns its place in context; see tools.
  • No caller-provided SQL - the server never executes SQL an agent wrote. Metadata comes from SQLAlchemy Inspector and fixed catalog queries.
  • Your aliases, not your network - the agent sees only the server aliases you configure. There is no network discovery, and the catalog is not published as MCP resources.
  • Secrets stay out of sight - connection URLs live in YAML with ${NAME} placeholders resolved from the environment. They never appear in logs or model-visible errors.
  • Compact, predictable output - object-rooted results with stable sorting, literal case-insensitive name filters, and stored procedure lists that do not expand definitions.
  • Errors an agent can act on - an ambiguous name lists the candidate schemas. Errors never contain connection details, credentials, or rows.
  • Fails closed - security decisions are allowlists; anything unrecognized is refused.
  • On PyPI - uvx sql-mini-mcp, no repo clone required.
Tool Access Purpose
list_servers 🟢 read Configured server aliases
list_databases 🟢 read Databases visible to the credentials
list_tables 🟢 read Base tables, filtered by schema or name
get_table_definition 🟢 read Columns, keys, constraints, and indexes of one table
list_stored_procedures 🟢 read Stored procedures, without definitions
get_stored_procedure 🟢 read The definition of one stored procedure
execute_sql 🟢 read One restricted SELECT on a pii_safe server; protected columns return tokens

More detail lives in docs/: the configuration reference and what the tools return.

Install

uvx sql-mini-mcp

or

pip install sql-mini-mcp

Pin a version when you want a fixed surface: uvx sql-mini-mcp==1.0.0.

Requires Python 3.12+, uv (or pip), and Microsoft ODBC Driver 18 for SQL Server.

Configure

Copy sql-mini-mcp.example.yaml to sql-mini-mcp.yaml, list your servers, and keep credentials in environment variables:

version: 1
servers:
  reporting:
    engine: sqlserver
    access_level: metadata
    connection_url: "${REPORTING_SQL_URL}"

Point the server at the file with SQL_MINI_MCP_CONFIG (or --config), and check it without connecting to any database:

SQL_MINI_MCP_CONFIG=sql-mini-mcp.yaml uvx sql-mini-mcp --check-config

Configuration is validated at startup, and an error names the problem without printing a URL or secret. Keep credentials in the host's own configuration and never commit them. The server acts with the database account's permissions, so use a dedicated login with the least access the job needs. Every setting, including the runtime limits, is in configuration.md.

Claude Code
claude mcp add --env SQL_MINI_MCP_CONFIG=/path/to/sql-mini-mcp.yaml --env REPORTING_SQL_URL=mssql+pyodbc://... --transport stdio sql-mini -- uvx sql-mini-mcp

Put at least one other option between the last --env and the server name, as above - the CLI otherwise reads the name as another KEY=value pair.

Claude Desktop

In claude_desktop_config.json:

{
  "mcpServers": {
    "sql-mini": {
      "command": "uvx",
      "args": ["sql-mini-mcp"],
      "env": {
        "SQL_MINI_MCP_CONFIG": "/path/to/sql-mini-mcp.yaml",
        "REPORTING_SQL_URL": "mssql+pyodbc://..."
      }
    }
  }
}
Codex CLI
codex mcp add sql-mini --env SQL_MINI_MCP_CONFIG=/path/to/sql-mini-mcp.yaml --env REPORTING_SQL_URL=mssql+pyodbc://... -- uvx sql-mini-mcp
Any other stdio host

Command uvx, argument sql-mini-mcp, and the environment variables your configuration references, plus SQL_MINI_MCP_CONFIG. The server speaks MCP over stdio and logs only to stderr.

Security

The MCP caller, SQL input, database metadata, rows, and tokens are untrusted; the operator, the process environment, and the database credentials are the trusted boundary. Database permissions remain the primary authorization control - this server never widens them. The full model, and how to report a vulnerability, are in SECURITY.md.

Contributing and security

Setup, checks, the test commands, the branch and commit conventions, and the release model are in CONTRIBUTING.md. Report vulnerabilities privately as described in SECURITY.md. Changes that affect someone running the server are recorded in CHANGELOG.md.

License

MIT.

Release files for sql-mini-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sql-mini-mcp 1.0.0
File Size Uploaded
sql_mini_mcp-1.0.0.tar.gz 26.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sql-mini-mcp 1.0.0
File Interpreter ABI Platform
sql_mini_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.7 kB

Release files / sql_mini_mcp-1.0.0.tar.gz

Download URL sql_mini_mcp-1.0.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
543db799cb292b79eb27eb1399ebd4bf3fc191e1616708e529fae8195012d735
BLAKE2b-256 checksum
How to use checksums
a62d39d653a1c36456e809ddade0dfd89950f550055d66c7d53d9f5a4f81043a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / sql_mini_mcp-1.0.0-py3-none-any.whl

Download URL sql_mini_mcp-1.0.0-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4beeb6d6b0fa6603164b49abf18514d4e456b5369f5742b2d3cbf5387122fa8
BLAKE2b-256 checksum
How to use checksums
2782555342b0f18f89b0fbe6a33e463aa244243293287fdcc883a7fb7a360768
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.9.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page