An MCP server for SQL database management using SQLite.
Project description
Raja SQL MCP
An MCP (Model Context Protocol) server for interacting with SQLite databases. This server provides tools to inspect database schemas, execute SQL queries, and perform CRUD operations, making it easy to integrate databases with AI agents and LLM-powered applications.
Features
✅ Execute SQL queries
✅ List all tables in the database
✅ Inspect table schemas
✅ Execute SELECT queries
✅ Insert data dynamically
✅ Update existing records
✅ Delete records safely
✅ SQLite-based (no external database server required)
Installation
pip install raja-sql-mcp
Running the Server
sql-mcp
Or during development:
uv run python -m src.sql_mcp.main
MCP Inspector Configuration
Transport
STDIO
Command
uv
Arguments
run python -m src.sql_mcp.main
Working Directory
/path/to/SQL_MCP
Available Tools
list_tables()
Returns all tables in the database.
Example:
list_tables()
describe_table(table_name)
Returns the schema of the specified table.
Example:
describe_table("users")
execute_sql(query)
Executes SQL queries such as:
- CREATE TABLE
- INSERT
- UPDATE
- DELETE
- DROP TABLE
- ALTER TABLE
Example:
execute_sql("""
CREATE TABLE users(
id INTEGER PRIMARY KEY,
name TEXT,
age INTEGER
)
""")
execute_select(query)
Executes SELECT queries and returns rows.
Example:
execute_select(
"SELECT * FROM users"
)
insert_data(table_name, data)
Insert records dynamically.
Example:
insert_data(
"users",
{
"name": "Raja",
"age": 21
}
)
update_data(table_name, data, condition)
Update existing records.
Example:
update_data(
"users",
{
"age": 22
},
"id = 1"
)
delete_data(table_name, condition)
Delete records matching a condition.
Example:
delete_data(
"users",
"id = 1"
)
Example Workflow
Create a table:
execute_sql("""
CREATE TABLE users(
id INTEGER PRIMARY KEY,
name TEXT,
age INTEGER
)
""")
Insert data:
insert_data(
"users",
{
"name": "Raja",
"age": 20
}
)
Query data:
execute_select(
"SELECT * FROM users"
)
Update data:
update_data(
"users",
{
"age": 21
},
"id = 1"
)
Delete data:
delete_data(
"users",
"id = 1"
)
Project Structure
SQL_MCP/
│
├── src/
│ └── sql_mcp/
│ ├── __init__.py
│ ├── database.py
│ ├── tools.py
│ └── main.py
│
├── README.md
├── LICENSE
├── pyproject.toml
└── uv.lock
Use Cases
- AI Database Agents
- Cursor-like Coding Assistants
- LLM-powered CRUD Applications
- Database Automation
- Schema Inspection Tools
- SQL Learning and Experimentation
License
MIT License © 2026 Anna Vamsi Krishna Raja
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 raja_sql_mcp-0.1.0.tar.gz.
File metadata
- Download URL: raja_sql_mcp-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73caba3569d4b78b823368361d4bc283604dfae9a8b700a8780d382a3757d1de
|
|
| MD5 |
940a6691f8a9fc8d6968f7ddebd88188
|
|
| BLAKE2b-256 |
5b9c1d235134240a59b1db85e984f7e08778e0adb6371051ab8a193b82c272ca
|
File details
Details for the file raja_sql_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: raja_sql_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
999fc0802101a2430d5b57307847ba549dbfd31eb1be9bc45d2a5977adfb0e8c
|
|
| MD5 |
940b1f50497818cfce4c08ca3c1f10cb
|
|
| BLAKE2b-256 |
ca86d39bf5184cf87e66bc154d6f1e641a3ca41d01d1a96d046ab0ff2e3d9a83
|