- Home
- MCP servers
- MCP SQLite Server
MCP SQLite Server
- go
0
GitHub Stars
go
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"cnosuke-mcp-sqlite": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"cnosuke/mcp-sqlite:latest"
],
"env": {
"DEBUG": "false"
}
}
}
}The MCP SQLite Server lets clients run JSON‑RPC commands to manage and query an SQLite database through a standardized MCP interface. It combines the simplicity of SQLite with the MCP protocol, enabling tools to create tables, inspect schemas, list tables, and run read or write queries against a single, persistent database.
How to use
You connect to the MCP SQLite Server from your MCP client by starting the server locally (or remotely) and then issuing JSON‑RPC tool requests. The server exposes five primary tools you can invoke: create_table to create new tables, describe_table to view a table’s schema, list_tables to enumerate all tables, read_query to run SELECT statements, and write_query to perform INSERT, UPDATE, or DELETE operations. Use these tools to set up your schema, inspect data, and perform data manipulation in your SQLite database through the MCP protocol.
How to install
Prerequisites you need before starting: Docker (recommended) and Go 1.24 or later if you plan to run the Go binary directly. You also need SQLite installed or available in your working environment so the database file is created if it does not exist.
# Docker—default run with an in-container SQLite database
docker pull cnosuke/mcp-sqlite:latest
docker run -i --rm cnosuke/mcp-sqlite:latest
# Docker—persist data by mounting a host SQLite database
# (replace /path/to/your/db with your actual path)
docker run -i --rm -v /path/to/your/db:/app/sqlite.db cnosuke/mcp-sqlite:latest
# Go binary—build the server from source (if you prefer building locally)
# Build the server
make bin/mcp-sqlite
# Run the server
./bin/mcp-sqlite server --config=config.yml
# Go binary with Claude Desktop (example config)
# Create a config.yml and run the server with the JSON config for Claude Desktop
Additional information
Configuration and runtime behavior are controlled via a YAML file (default: config.yml) or equivalent environment variables. The YAML example below shows how to enable logging and specify the SQLite database path. When using the stdio transport (for Claude Desktop or similar clients), direct logging to standard output should be avoided so as not to interfere with protocol messages.
log: 'mcp-sqlite.log'
debug: false
sqlite:
path: './sqlite.db'
Security and logging notes
Logging is directed to the file specified by the log option or the LOG_PATH environment variable. If you leave this path empty, only fatal errors are emitted. When using a stdio transport, do not write logs to standard output to prevent interference with MCP communication. The Docker image disables file logging by default since container logs are collected by the container runtime.
If you run the Go binary, you can pass environment variables to control behavior, for example to disable file logging or to point to a specific SQLite file.
MCP server connection methods
You can start the server either as a Docker container or as a local Go binary. The following configurations show how to register the server with an MCP client such as Claude Desktop.
Troubleshooting tips
Ensure the SQLite database path is writable and the directory exists. If logs are suppressed, verify that LOG_PATH is set appropriately or that the log file path is accessible. When using Docker, ensure the container can access the mounted database file and that the correct volume path is provided.
Notes and transitions
The MCP tools you’ll use most are create_table, describe_table, list_tables, read_query, and write_query. Start by creating your schema, then describe it to verify structure, list tables to confirm creation, and run read or write queries to interact with your data.
Available tools
create_table
Executes a CREATE TABLE statement to define a new table in the SQLite database.
describe_table
Retrieves the schema details for a specified table, including column definitions and constraints.
list_tables
Returns a list of all tables currently existing in the SQLite database.
read_query
Executes a SELECT query and returns the results in JSON format.
write_query
Executes write operations such as INSERT, UPDATE, or DELETE against the database.