An MCP server for safe, configurable SQL database access
Project description
mcp-tools-sql
Status: Under active development — not yet functional.
An MCP server for safe, configurable SQL database access. Exposes schema introspection, user-defined SELECT queries, and structured UPDATE operations as MCP tools for LLM-assisted workflows.
Key Ideas
- Configurable, not ad-hoc: Every query the LLM can run is defined upfront in config. The config is the security boundary.
- Schema discovery: Built-in tools to explore schemas, tables, columns, and foreign key relations.
- Structured updates: UPDATE operations are defined as table + key + fields, not raw SQL. The server generates the SQL.
- Split config: Query definitions live in the project repo (safe to commit). Credentials live in the user's home directory (never committed).
- Multi-backend: MS SQL Server (primary), PostgreSQL, SQLite.
Architecture
MCP Client (Claude Code, etc.)
↕ STDIO/MCP
mcp-tools-sql server
├── Built-in tools (schema introspection)
├── Configured query tools (from mcp-tools-sql.toml)
├── Configured update tools (from mcp-tools-sql.toml)
└── Backend abstraction
├── SQLite (stdlib)
├── MS SQL Server (pyodbc)
└── PostgreSQL (psycopg)
See docs/architecture/architecture.md for details.
Installation
pip install mcp-tools-sql # core + SQLite
pip install mcp-tools-sql[mssql] # + SQL Server support
pip install mcp-tools-sql[postgresql] # + PostgreSQL support
Quick Start
# Generate starter project query config (mcp-tools-sql.toml) and a
# database config skeleton at ~/.mcp-tools-sql/config.toml
mcp-tools-sql init --backend sqlite
# Edit ~/.mcp-tools-sql/config.toml and set the SQLite path, e.g.:
# [connections.default]
# backend = "sqlite"
# path = "./mydb.db"
# Validate environment, configs, dependencies, and connectivity
mcp-tools-sql verify
# Start MCP server
mcp-tools-sql --config mcp-tools-sql.toml
See docs/cli.md for the full CLI reference (all flags, example output, exit codes).
Configuration
Two config files:
| File | Purpose | Location |
|---|---|---|
mcp-tools-sql.toml |
Query/update definitions | Project dir (committed) |
~/.mcp-tools-sql/config.toml |
Database connections + credentials | User home (never committed) |
The --config flag overrides the project query config path; the
--database-config flag overrides the database config path.
See the planning document for full details.
License
MIT
Project details
Release history Release notifications | RSS feed
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_tools_sql-0.1.1.tar.gz.
File metadata
- Download URL: mcp_tools_sql-0.1.1.tar.gz
- Upload date:
- Size: 147.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9056d74c010867dc0bf9cf272cccb01082d482e2ef5da9f7f077c0ee24217c7
|
|
| MD5 |
fde9e5e881c9f162c85544438ca1d415
|
|
| BLAKE2b-256 |
ebc341f2c7c43b3cf36e71d7175318e93bbc970b38fc43b8c4daa1cd2d2d6373
|
Provenance
The following attestation bundles were made for mcp_tools_sql-0.1.1.tar.gz:
Publisher:
publish.yml on MarcusJellinghaus/mcp-tools-sql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_tools_sql-0.1.1.tar.gz -
Subject digest:
e9056d74c010867dc0bf9cf272cccb01082d482e2ef5da9f7f077c0ee24217c7 - Sigstore transparency entry: 1586375031
- Sigstore integration time:
-
Permalink:
MarcusJellinghaus/mcp-tools-sql@abb11a856646a9002e885e550fc1be2251f4dd28 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/MarcusJellinghaus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abb11a856646a9002e885e550fc1be2251f4dd28 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_tools_sql-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_tools_sql-0.1.1-py3-none-any.whl
- Upload date:
- Size: 54.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ace9001339c8cfaafee4c62ba5209ed5e0e6094cc24540ae5ac7bcfa0a825669
|
|
| MD5 |
de67f64efa5f970700e81c24214f4f4c
|
|
| BLAKE2b-256 |
8cf5539ccc0efefc3515cdd960cf5903dd14fbc05a8d38d8bce94b8647b55bcf
|
Provenance
The following attestation bundles were made for mcp_tools_sql-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on MarcusJellinghaus/mcp-tools-sql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_tools_sql-0.1.1-py3-none-any.whl -
Subject digest:
ace9001339c8cfaafee4c62ba5209ed5e0e6094cc24540ae5ac7bcfa0a825669 - Sigstore transparency entry: 1586375071
- Sigstore integration time:
-
Permalink:
MarcusJellinghaus/mcp-tools-sql@abb11a856646a9002e885e550fc1be2251f4dd28 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/MarcusJellinghaus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abb11a856646a9002e885e550fc1be2251f4dd28 -
Trigger Event:
release
-
Statement type: