Sqlite MCP — Local Database for AI Agents
Official MCP server for SQLite databases. Let Claude Code query, analyze, and modify local SQLite databases through natural language. Zero-config, instant setup.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install f67139b3-1666-4c8a-93d9-29c9c29e6ab2 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
SQLite MCP is the official Model Context Protocol server for SQLite databases. It gives AI agents like Claude Code the ability to query, analyze, and modify SQLite databases through natural language. The server exposes database operations as MCP tools, so the agent can run SQL queries, inspect schemas, and write data without you writing any code.
This server is for developers who use SQLite as a local database and want their AI coding assistant to interact with it directly. It is particularly useful for data exploration, quick analysis, and prototyping database-backed features.
How it saves time or tokens
Without the MCP server, you would need to write SQL queries manually, copy results into your conversation, and iterate. With SQLite MCP, the agent reads the schema, writes queries, executes them, and interprets results in one step. This workflow provides the MCP configuration JSON that you paste into your project config file.
How to use
- Add the SQLite MCP server to your
.mcp.json:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "./data/app.db"]
}
}
}
- Restart Claude Code or your MCP-compatible client.
- Ask the agent to interact with your database:
'Show me the schema of the users table'
'Find the top 10 orders by total amount'
'Create a new table for tracking events'
Example
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-server-sqlite",
"--db-path", "./analytics.db"
]
}
}
}
Once configured, the agent can run queries like:
SELECT date, COUNT(*) as visits, AVG(duration) as avg_duration
FROM page_views
WHERE date >= date('now', '-7 days')
GROUP BY date
ORDER BY date;
Related on TokRepo
- MCP SQLite integration -- Deep dive into SQLite MCP capabilities
- Database tools -- Other database tools for AI-assisted development
Common pitfalls
- The database file path must be accessible from the directory where the MCP server runs. Relative paths are resolved from the project root.
- SQLite MCP gives the agent write access by default. For read-only exploration, add
--read-onlyto the args array to prevent accidental modifications. - Large databases with millions of rows can cause slow query responses. The agent should use LIMIT clauses for initial exploration.
Preguntas frecuentes
It is an official Model Context Protocol server that exposes SQLite database operations as tools. AI agents can query schemas, run SQL, and modify data through the MCP interface without you writing code.
No. The MCP server includes SQLite bindings. You only need uvx (the Python package runner) installed. The server handles database connections internally.
Yes, by default the server has read-write access. To prevent modifications, add the --read-only flag to the args array in your MCP configuration. This restricts the agent to SELECT queries only.
It works with any MCP-compatible client. Claude Code, Cursor, and other tools that implement the Model Context Protocol can use this server. The MCP standard ensures interoperability.
Yes. Add multiple entries in your mcpServers configuration with different names and database paths. Each entry creates an independent server instance connected to its own database file.
Referencias (3)
- MCP Servers GitHub— Official MCP server for SQLite databases
- MCP Documentation— Model Context Protocol specification for tool integration
- SQLite Official— SQLite is a self-contained, serverless SQL database engine
Relacionados en TokRepo
Fuente y agradecimientos
Created by Anthropic. Licensed under MIT.
modelcontextprotocol/servers — Official MCP servers collection
Discusión
Activos relacionados
openDB — Local Memory DB + MCP for Agents
openDB gives agents a local SQLite memory database with MCP tools: index a workspace, search files, then run `opendb serve-mcp` to expose 12 tools.
WhatsApp MCP Server — Chat with WhatsApp via AI Agents
MCP server connecting Claude and AI agents to your personal WhatsApp. Search contacts, read messages, send replies and media via natural language.
Apify MCP Server — 8,000+ Web Scrapers for Agents
Apify MCP Server connects agents to Apify Actors via a hosted endpoint (mcp.apify.com) or local run, turning thousands of web scrapers into callable tools.
DBHub — Token-Efficient Database MCP Server
Database MCP server for Postgres/MySQL/MariaDB/SQL Server/SQLite. Includes execute_sql + schema search with guardrails: read-only, row limits, timeouts.