Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_tools_sql-0.1.0.tar.gz (144.9 kB view details)

Uploaded Source

Built Distribution

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

mcp_tools_sql-0.1.0-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_tools_sql-0.1.0.tar.gz
  • Upload date:
  • Size: 144.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_tools_sql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 342ff4dce273ea91a640885a7d1ce5d4a691a515f115eae37a99c8072ae4eed2
MD5 c21d2bbbcb6fa7f5aa7a1164304b706e
BLAKE2b-256 3f9368eb57298ed410e0c7da6e3489637f16c367ba3a8a28eb8e59b454e78998

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_tools_sql-0.1.0.tar.gz:

Publisher: publish.yml on MarcusJellinghaus/mcp-tools-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: mcp_tools_sql-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_tools_sql-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4de3e9c171f259859a5fffaa2e99171c503f7e89a242d9aafb729351f3f76795
MD5 77ba0fefdb906d03783975fcbcec91e9
BLAKE2b-256 1f3c21d86e9cdd078ab6fda2312df5338a1884f9ba510771ae06230eeab33d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_tools_sql-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MarcusJellinghaus/mcp-tools-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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