What it does
SQLite MCP gives Claude read and write access to a SQLite database file on your local machine. It is part of the official Anthropic MCP reference server collection and requires no network connection or external service — just a .db file path at connection time.
Claude can explore unfamiliar databases by listing tables and describing schemas, then write targeted queries to answer questions about the data. It can also create new tables, insert records, and run complex analytical queries that would take significant manual effort in a GUI client.
- Run arbitrary
SELECTqueries with results formatted for readability - Execute
INSERT,UPDATE, andDELETEstatements - Create new tables with full column and constraint definitions
- List all tables in the database
- Inspect column names, types, and constraints for any table
- Run multi-statement queries for complex analysis
How to connect
Replace ./database.db with the path to your SQLite file. The file will be created if it does not exist.
claude mcp add sqlite -- npx -y @modelcontextprotocol/server-sqlite \ --db-path ./database.db
Available tools
read_query— run a SELECT query and return resultswrite_query— run INSERT, UPDATE, or DELETEcreate_table— create a new table with a schema definitionlist_tables— list all tables in the databasedescribe_table— return column names, types, and constraintsrun_query— execute any SQL statement
Example usage
Ask Claude to analyze your app's database and surface insights or data quality issues:
# User prompt
Look at my database, find the users table,
and tell me how many users signed up per month
in 2025. Show it as a table.
list_tables() → ["users", "orders", "products", "sessions"] describe_table("users") → id, email, created_at, plan_id read_query("SELECT strftime('%Y-%m', created_at) as month, COUNT(*) as signups FROM users WHERE created_at >= '2025-01-01' GROUP BY month ORDER BY month") → returns 12-row result set
Read-only mode: To prevent accidental writes, you can open the database in read-only mode by passing --read-only to the server. This disables write_query, create_table, and run_query for mutating operations.