# 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. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Add to your `.mcp.json`: ```json { "mcpServers": { "sqlite": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "./data/app.db"] } } } ``` Restart Claude Code. Ask "show me all tables" or "find users who signed up this week". ## What is SQLite MCP? SQLite MCP is an official Model Context Protocol server that connects AI agents to SQLite databases. It lets Claude Code, Cline, and other MCP clients query, analyze, and modify local SQLite databases through natural language — with zero configuration beyond pointing to your `.db` file. **Answer-Ready**: SQLite MCP is an official MCP server that connects AI agents like Claude Code to local SQLite databases. Query, analyze, and modify data through natural language with zero-config setup. Part of the official MCP server collection. **Best for**: Developers who want Claude Code to interact with local SQLite databases. **Works with**: Claude Code, Cline, any MCP-compatible client. **Setup time**: Under 1 minute. ## Core Features ### 1. Natural Language Queries ``` You: "Show me all users who signed up in the last 7 days" Claude Code: Runs SELECT * FROM users WHERE created_at > datetime('now', '-7 days') → Returns formatted table of 23 users You: "What's the average order value by country?" Claude Code: Runs SELECT country, AVG(total) FROM orders GROUP BY country ORDER BY AVG(total) DESC → Returns ranked list with averages ``` ### 2. Available Tools | Tool | Description | |------|-------------| | `read_query` | Execute SELECT queries | | `write_query` | Execute INSERT/UPDATE/DELETE | | `create_table` | Create new tables | | `list_tables` | Show all tables | | `describe_table` | Show table schema | | `append_insight` | Save analysis notes | ### 3. Schema Exploration ``` You: "What tables exist and what's in them?" Claude Code: → list_tables: users, orders, products, reviews → describe_table for each → Summary: "4 tables with 15,000 total rows..." ``` ### 4. Data Analysis ``` You: "Analyze the orders table and find trends" Claude Code: → Queries order counts by month → Calculates growth rates → Identifies top products → Returns markdown report with insights ``` ### 5. Safe Write Operations ``` You: "Add a 'last_login' column to the users table" Claude Code: Asks for confirmation before executing → ALTER TABLE users ADD COLUMN last_login DATETIME → Confirms: "Column added successfully" ``` ### 6. Multiple Database Support ```json { "mcpServers": { "app-db": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "./data/app.db"] }, "analytics-db": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "./data/analytics.db"] } } } ``` ## Use Cases | Use Case | Example | |----------|---------| | Data exploration | "What's in this database?" | | Bug investigation | "Find orders with negative totals" | | Report generation | "Monthly revenue by category" | | Data migration | "Create a new normalized schema" | | Prototyping | "Set up tables for a todo app" | ## FAQ **Q: Is it safe to use on production databases?** A: SQLite MCP supports read-only mode. For production, use `--read-only` flag to prevent accidental writes. **Q: Does it work with other databases?** A: This server is SQLite-specific. For PostgreSQL, use `@modelcontextprotocol/server-postgres`. **Q: Can it handle large databases?** A: Yes, queries are executed directly by SQLite. For very large result sets, the AI will add LIMIT clauses automatically. ## Source & Thanks > Created by [Anthropic](https://github.com/modelcontextprotocol). Licensed under MIT. > > [modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) — Official MCP servers collection ## Quick Start Point `.mcp.json` to your `.db` file and restart Claude Code — query your database in natural language. ```json { "mcpServers": { "sqlite": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "./data/app.db"] } } } ``` ## What is SQLite MCP? The official MCP server that connects AI agents to local SQLite databases. Query, analyze, and modify data with natural language. **In one sentence**: Official MCP server that lets Claude Code query local SQLite databases in natural language — zero configuration. **For**: Developers who need Claude Code to interact with local databases. ## Core Features ### 1. Natural-Language Queries Describe what you want — SQL is generated and executed automatically. ### 2. Schema Exploration List tables, view structure, understand data. ### 3. Data Analysis Trend analysis, aggregate statistics, report generation. ### 4. Safe Write Operations Confirm before modification; read-only mode supported. ## FAQ **Q: Safe for production databases?** A: Supports `--read-only` mode. **Q: Does it support other databases?** A: SQLite only. Use `server-postgres` for PostgreSQL. ## Source & Thanks > [modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) — official MCP server, MIT --- Source: https://tokrepo.com/en/workflows/sqlite-mcp-local-database-ai-agents-f67139b3 Author: MCP Hub