mcp-sqlite
Sqlite MCP server
claude mcp add --transport stdio liliang-cn-mcp-sqlite-server mcp-sqlite-server /path/to/your/database/directory \ --env PATH="Include Go bin directory in PATH, e.g. $HOME/go/bin (required for zsh users as shown in install guide)"
How to use
This MCP server provides a secure interface to interact with SQLite databases from an AI assistant. It supports multiple databases within allowed directories, and exposes a comprehensive set of tools to query data, modify schemas, manage databases and perform analysis. Available capabilities include querying data with SELECT statements, inserting/updating/deleting rows, and executing transactions. You can also create and manage tables (create, list, describe, drop), manage indexes (create/list/drop), and manage database files themselves (create, check existence, switch, list, delete) within the configured allowed directories. For analysis, you can run query analysis and obtain database statistics, and perform maintenance like VACUUM and ANALYZE to optimize performance. To use it, start the server with at least one valid database path or directory and then invoke the tools through your MCP-enabled assistant, observing the directory restrictions enforced by the server. Setup details and examples are provided in the usage section of the README, including how to configure the server in Claude Desktop and how to supply path arguments.
How to install
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 notes:
- Ensure you provide at least one valid database path or directory when starting the server.
- The directory must contain at least one .db file for the server to operate.
- The server is designed to restrict operations to the configured allowed directories to improve security.
Additional notes
Tips and considerations:
- Always provide a valid directory or database file path when launching the server; otherwise the server will exit with an error.
- When using Claude Desktop or other MCP clients, ensure the args point to directories containing .db files and that PATH includes $HOME/go/bin if you installed via Go.
- Directory traversal and invalid file types are blocked by path validation; only legitimate SQLite database files in allowed directories are accessible.
- Use the provided tools in a logical order (e.g., create or switch database, then describe tables or run queries) to manage and inspect your data safely.
- For production deployments, consider locking down the allowed directories and enabling appropriate access controls to prevent unauthorized database access.
Related MCP Servers
kodit
👩💻 MCP server to index external repositories
furi
CLI & API for MCP management
mcp-time
MCP (Model Context Protocol) server which provides utilities to work with time and dates, with natural language, multiple formats and timezone convertion capabilities
mcp
Teamwork.com MCP server
muster
MCP tool management and workflow proxy
cursor-buddy
🤖 MCP server that gives AI agents deep context about your project - coding standards, knowledge base, todos, database schema & history. Keep your AI assistant consistent and context-aware.