@jkumonpm/sqlite-dba-mcp
v1.0.0
Published
SQLite DBA MCP server — query, execute, schema, and tables tools for SQLite databases
Downloads
75
Maintainers
Readme
sqlite-dba-mcp
SQLite DBA MCP server. Query, execute, inspect schema, and list tables.
Powered by better-sqlite3 — high-performance synchronous SQLite.
Install
npm install -g sqlite-dba-mcpUsage
Claude Desktop / Cursor / OpenCode
Add to your MCP config:
{
"mcpServers": {
"sqlite-dba": {
"command": "npx",
"args": ["-y", "sqlite-dba-mcp"]
}
}
}Tools
tables — List Tables
List all tables in the SQLite database.
Input:
{
"db_path": "./my-database.db"
}Output:
{
"db_path": "/path/to/my-database.db",
"count": 3,
"tables": ["posts", "users", "comments"]
}schema — Get Table Schema
Get the column structure of a specific table.
Input:
{
"db_path": "./my-database.db",
"table": "users"
}Output:
{
"db_path": "/path/to/my-database.db",
"table": "users",
"columns": [
{ "cid": 0, "name": "id", "type": "INTEGER", "notnull": 1, "pk": 1 },
{ "cid": 1, "name": "name", "type": "TEXT", "notnull": 1, "pk": 0 },
{ "cid": 2, "name": "email", "type": "TEXT", "notnull": 0, "pk": 0 },
{ "cid": 3, "name": "age", "type": "INTEGER", "notnull": 0, "pk": 0 }
]
}query — Execute SQL Query
Execute a read-only SQL query (SELECT, PRAGMA, etc.) and return results.
Input:
{
"db_path": "./my-database.db",
"sql": "SELECT * FROM users WHERE age > ?",
"params": [25]
}Output:
{
"db_path": "/path/to/my-database.db",
"sql": "SELECT * FROM users WHERE age > ?",
"row_count": 2,
"results": [
{ "id": 1, "name": "Alice", "email": "[email protected]", "age": 30 },
{ "id": 3, "name": "Charlie", "email": "[email protected]", "age": 35 }
]
}execute — Execute SQL Write
Execute a write SQL statement (INSERT, UPDATE, DELETE, CREATE, etc.).
Input:
{
"db_path": "./my-database.db",
"sql": "INSERT INTO users (name, email, age) VALUES (?, ?, ?)",
"params": ["Diana", "[email protected]", 28]
}Output:
{
"db_path": "/path/to/my-database.db",
"sql": "INSERT INTO users (name, email, age) VALUES (?, ?, ?)",
"changes": 1,
"lastInsertRowid": 4
}Design
| Feature | Why |
|---------|-----|
| better-sqlite3 | High-performance synchronous SQLite |
| Read-only safety | query tool only allows SELECT/PRAGMA; writes require execute |
| Prepared statements | All queries use parameterized statements to prevent SQL injection |
| Cross-platform | better-sqlite3 supports Windows/macOS/Linux |
License
MIT
