SQL Connector MCP
An MCP (Model Context Protocol) server that provides SQL database connectivity for AI assistants like Claude.
Features
- Database Exploration: List all table names or filter tables by substring
- Schema Inspection: Get detailed schema definitions including columns, types, primary keys, and foreign key relationships
- Query Execution: Execute SQL queries with parameterized inputs and formatted results
- Form Fetching: Retrieve form schemas from database based on trigger keywords
Installation
pip install sql-connector-mcp
Configuration
Set the following environment variables:
# Required: Database connection URL
DB_URL=mysql://user:password@host:port/database
# Optional: Maximum characters for query results (default: 4000)
EXECUTE_QUERY_MAX_CHARS=4000
# Optional: Path for saving full result sets
CLAUDE_LOCAL_FILES_PATH=/path/to/files
Usage
Run the MCP server:
python -m sql_connector_mcp.server
Opens the caldue code or cursor or any ai ide and add this json "my_database": { "command": "python", "args": ["-m", "sql_connector_mcp.server"], "env": { "DB_URL": "your dbatabase url" }
Available Tools
| Tool | Description |
|---|---|
all_table_names() |
Returns all table names in the database |
filter_table_names(q) |
Returns table names containing the substring q |
schema_definitions(table_names) |
Returns schema and relationship info for specified tables |
execute_query(query, params) |
Executes a SQL query and returns formatted results |
fetch_form(query_text, db_name) |
Fetches form schema based on trigger keywords |
Requirements
- Python >= 3.7
- SQLAlchemy
- PyMySQL
- FastMCP
License
MIT License
Author
Battula Anil Kumar (anilkumarbaatula@gmail.com)
Metadata
Release files for sql-connector-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sql_connector_mcp-0.1.1.tar.gz | 4.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sql_connector_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / sql_connector_mcp-0.1.1.tar.gz
| Download URL | sql_connector_mcp-0.1.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4c945d9af534f54c80b846cba25137786272073f39aab079b1e6e05185be773
|
|
BLAKE2b-256 checksum How to use checksums |
63a6df8c11516142580840b77e7a261334d9f9e094464a95fd018caf570a3ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / sql_connector_mcp-0.1.1-py3-none-any.whl
| Download URL | sql_connector_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36a1bbadc34691634b8761dedb66fbf6755cebff541c865ff5354b7ad5f1d6e5
|
|
BLAKE2b-256 checksum How to use checksums |
40f59f2559a8eb28fdc761cec48858625ef5197dc3169ed272c12a68d71a4a05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for sql-connector-mcp 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.