mcp-sqlite-server
Provides tools for querying and executing SQL against a SQLite database, listing tables and views, describing table schemas, and exposing database schema resources.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-sqlite-server
An MCP (Model Context Protocol) server that provides tools and resources for interacting with SQLite databases via better-sqlite3.
Table of Contents
Related MCP server: mcp-sql-explorer
Features
Query & Execute -- run read and write SQL statements
Schema Introspection -- list tables, describe columns/indexes, view full DDL
Project-Level Configuration -- database settings live in a
.mcp-sqlite.jsonfile, not in the MCP client configWAL Mode -- enabled by default for better concurrency
Read-Only Mode -- optionally prevent write operations
Configuration
Create a .mcp-sqlite.json file in the project/workspace that will use this MCP server:
{
"database": "./data.sqlite",
"readonly": false,
"wal": true
}Field | Type | Default | Description |
| string | — | Required. Path to the SQLite file (relative to config file) |
| boolean |
| Open the database in read-only mode |
| boolean |
| Enable WAL journal mode |
The server resolves the config file in this order:
--config <path>CLI argument.mcp-sqlite.jsonin the current working directory
Tools
query
Execute a read-only SQL query (SELECT) and return results as JSON.
Input: { "sql": "SELECT * FROM users LIMIT 10" }
execute
Execute a write SQL statement (INSERT, UPDATE, DELETE, CREATE TABLE, etc.). Disabled in read-only mode.
Input: { "sql": "INSERT INTO users (name) VALUES ('Alice')" }
list_tables
List all tables and views in the database.
Input: none
describe_table
Get detailed schema for a specific table including columns, types, constraints, and indexes.
Input: { "table": "users" }
Resources
URI | Description |
| Full database schema (all DDL statements) |
| List of all tables and views |
| Schema details for a specific table |
Contributing
See CONTRIBUTING.md for setup, release/publish workflow, build instructions, testing, code conventions, and guidance on adding new tools, resources, and config fields.
Cursor MCP Configuration
Add the following to .cursor/mcp.json in any project that wants to use this server:
{
"mcpServers": {
"mcp-sqlite-server": {
"command": "npx",
"args": ["-y", "@graduenz/mcp-sqlite-server"]
}
}
}The server will look for .mcp-sqlite.json in the workspace root (the working directory Cursor launches the server from).
To use an explicit config path:
{
"mcpServers": {
"mcp-sqlite-server": {
"command": "npx",
"args": [
"-y",
"@graduenz/mcp-sqlite-server",
"--config",
".mcp-sqlite.json"
]
}
}
}Then create .mcp-sqlite.json in the project root:
{
"database": "./data.sqlite",
"readonly": false,
"wal": true
}Multiple Databases (Two MCP Servers)
If your project has multiple SQLite databases, run one MCP server instance per database.
Each instance needs its own server name in .cursor/mcp.json and its own config file passed with --config.
{
"mcpServers": {
"sqlite-main": {
"command": "npx",
"args": [
"-y",
"@graduenz/mcp-sqlite-server",
"--config",
".mcp-sqlite.main.json"
]
},
"sqlite-analytics": {
"command": "npx",
"args": [
"-y",
"@graduenz/mcp-sqlite-server",
"--config",
".mcp-sqlite.analytics.json"
]
}
}
}Create a config file for each database:
.mcp-sqlite.main.json:
{
"database": "./data/main.sqlite",
"readonly": false,
"wal": true
}.mcp-sqlite.analytics.json:
{
"database": "./data/analytics.sqlite",
"readonly": true,
"wal": true
}When prompting in Cursor, specify which MCP server to use (sqlite-main or sqlite-analytics) based on the database you want to query.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Kotlin compile-time SQL library. Docs, code validation, and SQLite execution tools.
Create, manage, and query your Google Cloud SQL resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables SQLite database interactions including querying, updating, and schema management through structured tools.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to safely explore SQLite databases through schema discovery, sampling, read-only querying, and query-plan analysis, with schema resources and an analysis prompt.MIT
- AlicenseNot gradedqualityCmaintenanceEnables an LLM to explore and query a SQLite database through tools for listing tables, describing schemas, sampling rows, and running bounded read-only SELECT queries, with table/column restrictions, resource limits, and audit logging.MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to explore a SQLite database through safe, read-only tools for listing tables, describing schemas, and running SELECT/WITH queries, with optional guarded write support when enabled.3MIT