About
Sqlite MCP server
README
A Model Context Protocol (MCP) server for SQLite database operations, built with Go. This server allows AI assistants to interact with SQLite databases through a secure, directory-restricted interface.
Features
- Multi-database support: Switch between different SQLite databases dynamically
- Directory security: Operations restricted to specified allowed directories
- Complete SQLite operations: Query, execute, transactions, table management, indexing
- Database management: Create, delete, list, and switch between databases
- Query analysis: Analyze query execution plans and get database statistics
- Transaction support: Execute multiple statements atomically
Installation
Prerequisites
- Go 1.19 or later
- SQLite3 (for creating/managing database files)
Install via go install (recommended)
go install github.com/liliang-cn/mcp-sqlite-server@latest
# Add to PATH (for zsh users)
echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Verify installation
mcp-sqlite-server --help
Build from source
git clone https://github.com/liliang-cn/mcp-sqlite-server.git
cd mcp-sqlite-server
go build -o mcp-sqlite-server
Usage
Basic usage
Required: You must specify at least one database path or directory as an argument.
# Specify a single database file
mcp-sqlite-server /path/to/database.db
# Specify a directory containing .db files (will use the first found)
mcp-sqlite-server /path/to/db/directory
# Specify multiple directories for access control
mcp-sqlite-server /path/to/db/dir1 /path/to/db/dir2
Note: The server will exit with an error if:
- No arguments are provided
- No valid SQLite database files are found in the specified directories
With Claude Desktop
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"sqlite": {
"command": "mcp-sqlite-server",
"args": ["/path/to/your/database/directory"]
}
}
}
Important: Make sure to:
- Add
$HOME/go/binto your PATH (for zsh: addexport PATH="$HOME/go/bin:$PATH"to~/.zshrc) - Provide a valid database file or directory path in the
argsarray - Ensure the specified directory contains at least one
.dbfile
Available Tools (19 Total)
Query & Data Manipulation
query- Execute a SELECT query on the SQLite databaseexecute- Execute an INSERT, UPDATE, or DELETE statementtransaction- Execute multiple SQL statements in a transaction (INSERT/UPDATE/DELETE only, no SELECT)
Table Management
create_table- Create a new table in the databaselist_tables- List all tables in the databasedescribe_table- Get the schema of a specific tabledrop_table- Drop a table from the database
Index Management
create_index- Create an index on a table column(s) with advanced optionslist_indexes- List all indexes for a tabledrop_index- Drop an index from the database
Database Management
create_database- Create a new SQLite database file with an AI-generated name in the specified directorydatabase_exists- Check if a database file exists and is valid in allowed directoriesswitch_database- Switch to a different SQLite database file in allowed directoriescurrent_database- Show the currently connected database file pathlist_database_files- List all SQLite database files in a directorydelete_database- Delete a SQLite database file from allowed directories (CAUTION: This permanently deletes the file)
Database Analysis & Optimization
vacuum- Optimize the database by rebuilding itanalyze_query- Analyze the execution plan of a SQL querydatabase_stats- Get database statistics and information
Security
- All operations are restricted to specified allowed directories
- Path validation prevents directory traversal attacks
- Database file validation ensures only SQLite files are accessed
- Transaction isolation ensures data consistency
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Installing Sqlite Server
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/liliang-cn/mcp-sqlite-serverFAQ
Is Sqlite Server MCP free?
Yes, Sqlite Server MCP is free — one-click install via Unyly at no cost.
Does Sqlite Server need an API key?
No, Sqlite Server runs without API keys or environment variables.
Is Sqlite Server hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Sqlite Server in Claude Desktop, Claude Code or Cursor?
Open Sqlite Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolCompare Sqlite Server with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
