Back to MCP Servers

SQLite MCP Server

Reference MCP server that connects an AI agent to a local SQLite database with tools for reading, writing, schema inspection, and business insight tracking.

Developer Tools by Model Context Protocol (Anthropic) None active
Overview

The SQLite MCP server is a reference implementation maintained by the Model Context Protocol project that gives an LLM direct access to a local SQLite database. It exposes a small set of tools for executing read and write SQL queries, creating tables, listing the schema, and describing individual tables. It also ships with a memo://insights resource and an append_insight tool, which together let an agent accumulate business observations as it explores the data, plus an mcp-demo prompt that walks through a domain-specific analysis scenario end to end.

This server is one of the original demo servers used to showcase what MCP can do, so it is well suited as a learning example, a local prototyping tool, or a lightweight way to let Claude inspect and modify a SQLite file on disk. It runs locally via uvx (Python) or Docker, requires no authentication, and is configured with a single --db-path argument pointing at the SQLite database file.

Note: as of 2025 the SQLite server was moved from the main modelcontextprotocol/servers repository to modelcontextprotocol/servers-archived, along with several other early reference servers. It still works, but it is no longer actively maintained by the MCP steering group. For production database access, users are generally pointed at community or vendor-maintained alternatives.

Tools

Tool Description
read_query Execute a SELECT query against the SQLite database and return the rows.
write_query Execute an INSERT, UPDATE, or DELETE statement against the database.
create_table Create a new table in the database from a CREATE TABLE statement.
list_tables List all tables in the connected SQLite database.
describe-table Show the schema (columns and types) for a specific table.
append_insight Append a new business insight to the memo://insights resource, which is continuously updated as analysis progresses.
Setup Guide

Prerequisites

  • A SQLite database file (one will be created if the path does not exist)
  • Either uv/uvx (Python) or Docker installed locally

Install and run with uvx

The package is published as mcp-server-sqlite and can be launched with uvx:

uvx mcp-server-sqlite --db-path ~/test.db

Claude Desktop config (uvx)

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": [
        "mcp-server-sqlite",
        "--db-path",
        "/full/path/to/test.db"
      ]
    }
  }
}

Claude Desktop config (Docker)

First build or pull the image, then:

{
  "mcpServers": {
    "sqlite": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "mcp-test:/mcp",
        "mcp/sqlite",
        "--db-path",
        "/mcp/test.db"
      ]
    }
  }
}

VS Code

Add an equivalent mcp.servers entry to .vscode/mcp.json using the same uvx or docker command. The MCP extension will pick it up automatically.

Development

Build the Docker image from the repo: docker build -t mcp/sqlite .

Test with the MCP inspector: mcp dev src/mcp_server_sqlite/server.py:wrapper

Use Cases
  • Let Claude explore an unfamiliar SQLite file by listing tables, describing schemas, and running ad hoc SELECT queries against the data.
  • Prototype a small application database locally by having the agent issue CREATE TABLE statements and seed data via write_query.
  • Walk through the bundled mcp-demo prompt to generate a synthetic business domain, populate it with sample data, and have the agent build up an insights memo.
  • Use as a learning tool to understand how an MCP server wires together tools, resources, and prompts in a single small codebase.
  • Run lightweight data cleanup or migration scripts on a SQLite file by chaining read_query and write_query calls under agent supervision.
Example Prompts
  • "List all tables in the database, then describe the orders table."
  • "Run a SELECT to find the top 10 customers by total order value in the last 90 days."
  • "Create a notes table with id, created_at, and body columns, then insert three sample rows."
  • "Explore this sales database and append any interesting patterns you find as insights."
  • "Walk me through the mcp-demo prompt for the topic 'subscription analytics'."
Pros
  • Official reference implementation from the MCP project, useful as a canonical example of tools, resources, and prompts in one server.
  • Zero auth and no external dependencies: just point it at a local .db file and go.
  • Covers the full read/write/schema surface most agents need for working with a SQLite database.
  • Ships with both uvx and Docker entry points for easy local setup.
Limitations
  • Now lives in modelcontextprotocol/servers-archived and is no longer actively maintained by the MCP steering group.
  • SQLite only; not suitable for Postgres, MySQL, or other remote databases.
  • No built in safety controls beyond splitting reads and writes into separate tools, so a misbehaving agent can still drop or mutate data.
Alternatives