home / mcp / sqlite mcp server
Provides secure, granular access to SQLite databases via MCP with fine-grained permissions and audit logging.
Configuration
View docs{
"mcpServers": {
"berthojoris-sqlite-mcp": {
"command": "npx",
"args": [
"-y",
"@berthojoris/mcp-sqlite-server",
"sqlite:////path/to/database.sqlite",
"list,read,create,update,delete"
]
}
}
}You can securely expose and manage SQLite databases through a Model Context Protocol (MCP) server. This server provides a standardized interface to run queries, manage schema, and perform maintenance while enforcing fine-grained permissions and audit logging for secure, controlled access.
Connect to the SQLite MCP Server using an MCP client. You can either run the server directly via a command line, or configure your MCP client to connect and operate with a defined set of permissions.
Two practical usage patterns are shown below. Use the first to run immediately, or the second to integrate into your client configuration.
# Run directly with npx (no installation required)
npx @berthojoris/mcp-sqlite-server sqlite:////path/to/database.sqlite list,read,create,update,delete
```
```
# Add to your MCP client configuration
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@berthojoris/mcp-sqlite-server", "sqlite:////path/to/db.sqlite", "list,read,create,update,delete"]
}
}
}Prerequisites: ensure you have Node.js (LTS version) and npm installed on your system.
Step 1: Run the server directly without installation (NPX) to try it out.
npx @berthojoris/mcp-sqlite-server sqlite:////path/to/your/database.sqlite list,read,utilityStep 2: Install globally so you can run the server from anywhere.
npm install -g @berthojoris/mcp-sqlite-server
mcp-sqlite-server sqlite:////path/to/your/database.sqlite list,read,create,updateStep 3: Install locally in a project.
npm install @berthojoris/mcp-sqlite-serverConfiguration is typically done in your MCP client config. The server supports a standard connection string format for SQLite and a set of permissions to control what actions are allowed.
The MCP server provides secure, granular access to SQLite operations with a comprehensive permission system. Permissions include: list, read, create, update, delete, execute, ddl, transaction, utility, and others. Each permission controls a specific set of SQL operations to prevent unauthorized actions.
Follow security best practices: grant only the permissions you need, use parameterized queries, keep backups, monitor audit logs, and enforce rate limiting. The server includes SQL injection protection, query validation, and detailed audit trails to help you maintain a secure environment.
- Read-only access: list,read - Full CRUD: list,read,create,update,delete - Full database access: list,read,create,update,delete,execute,ddl,transaction,utility - Analytics: list,read,utility - Development: list,read,create,update,delete,ddl,transaction,utility
Execute SELECT queries with parameterized support
Insert single records into tables
Update existing records
Delete records from tables
Get comprehensive schema information
List all tables in database
Analyze table relationships and foreign keys
Execute multiple queries atomically
Create database backup
Bulk insert with relational support
Bulk update with progress tracking
Bulk delete with cascade support
Schema management (CREATE/ALTER/DROP)
Create, drop, and manage database views
Index management and optimization
View constraints and foreign keys
Data migration between tables
Backup tables and restore from SQL files
Column statistics and data profiling
Database summary and metadata
Entity relationship diagram data
RAG context for AI models
Query analysis and execution plans
Query optimization suggestions
Database health and integrity checks
Find unused or redundant indexes
Connection pool statistics