MCP SQL Connector
Provides tools to list tables, describe table schemas, run read-only SELECT/CTE queries, and summarize tables with row counts and sample rows from a SQLite database.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP SQL Connector
An MCP server that lets Claude query SQLite databases. Ask questions in natural language and Claude translates them into SQL queries.
Tools
Tool | What it does |
| Show all tables in the database |
| Show columns and types for a table |
| Run a read-only SQL SELECT query |
| Get row count + sample rows |
Related MCP server: mcp-sqlite-insights
Safety
Database is opened in read-only mode (
mode=ro) at the driver levelOnly
SELECTandWITH(CTE) queries are allowedDangerous keywords (
INSERT,UPDATE,DELETE,DROP,ALTER,ATTACH,LOAD_EXTENSION, etc.) are blockedTable names are validated against a strict alphanumeric pattern before use
SQL comments are stripped before safety checks to prevent bypass attempts
Setup
Prerequisites
Python 3.10+
A SQLite database file
Install
git clone https://github.com/sruthir28/mcp-sql-connector.git
cd mcp-sql-connector
python -m venv .venv
source .venv/bin/activate
pip install -e .Create sample data (optional)
python setup_db.pyConfigure in Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"sql-connector": {
"command": "/path/to/mcp-sql-connector/.venv/bin/python",
"args": ["/path/to/mcp-sql-connector/server.py"],
"env": {
"MCP_DB_PATH": "/path/to/your/database.db"
}
}
}
}Configure in Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"sql-connector": {
"command": "/path/to/mcp-sql-connector/.venv/bin/python",
"args": ["/path/to/mcp-sql-connector/server.py"],
"env": {
"MCP_DB_PATH": "/path/to/your/database.db"
}
}
}
}Usage Examples
Once connected, you can ask Claude things like:
"What tables are in the database?"
"Show me all employees in Engineering"
"What's the total budget across all active projects?"
"Which tasks are high priority and still in progress?"
Claude will use the MCP tools to query the database and return results.
Environment Variables
Variable | Default | Description |
|
| Path to the SQLite database file |
|
| Maximum rows returned per query |
|
| Query timeout in milliseconds |
Error Responses
All tools return errors in a consistent JSON format:
{"error": "Description of what went wrong"}Common errors:
Table not found: The table name doesn't exist in the database
Invalid table name: Table name contains special characters (only letters, numbers, underscores allowed)
Query rejected: The SQL contains disallowed keywords or doesn't start with SELECT
Database not found: The
MCP_DB_PATHdoesn't point to a valid file (server won't start)
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Query, explore, and manage your databases through natural conversation.
Ask plain-English questions of your database: answers, the SQL that ran, and the rows.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to safely explore and query a SQLite database through natural language, including listing tables, inspecting schemas, and running read-only SELECT queries.MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude and other MCP clients to map a SQLite database's schema and run read-only SQL queries against it, with writes blocked at the SQLite level through multiple enforcement layers. Results come back as context-friendly Markdown tables with row caps and a query timeout.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP clients to inspect a local SQLite database's tables, columns, and schema, and run safe read-only SQL queries with capped JSON results.MIT
- AlicenseAqualityBmaintenanceEnables Claude or any MCP host to explore and query a SQLite database through read-only tools for listing tables, describing schemas, and running SQL queries.3MIT