mcp-tools-sql
Provides safe, configurable SQL database access via MCP tools, enabling schema introspection, predefined queries, and structured updates with multi-backend support.
README
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.