# SQLite

> Local SQLite database access with full read/write support.

[Canonical HTML page](https://top-mcps.com/mcp/sqlite) · [server.json](https://top-mcps.com/mcp/sqlite.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
claude mcp add sqlite -- uvx mcp-server-sqlite --db-path /path/to/db.sqlite
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "sqlite": {
      "command": "uvx",
      "args": [
        "mcp-server-sqlite",
        "--db-path",
        "/path/to/db.sqlite"
      ]
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "uvx",
          "args": [
            "mcp-server-sqlite",
            "--db-path",
            "/path/to/db.sqlite"
          ]
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.sqlite]
command = "uvx"
args = [
  "mcp-server-sqlite",
  "--db-path",
  "/path/to/db.sqlite",
]
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "sqlite": {
      "command": {
        "path": "uvx",
        "args": [
          "mcp-server-sqlite",
          "--db-path",
          "/path/to/db.sqlite"
        ]
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

SQLite doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Anthropic (archived reference; community-maintained via PyPI)
- **Transport:** stdio
- **Auth model:** None
- **Required secrets:** None
- **Supported clients:** Claude, Cursor, Any MCP-compatible client
- **License:** MIT
- **Language:** Python
- **Latest version:** latest
- **Last verified:** 2026-05-31
- **GitHub stars:** 266 (fetched 2026-06-02T11:55:51.449Z)
- **Score:** 65/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `read_query` | Run a SELECT and return rows. | `query: string` | read |
| `write_query` | Run an INSERT / UPDATE / DELETE statement. | `query: string` | write |
| `create_table` | Execute a CREATE TABLE statement. | `query: string` | write |
| `list_tables` | List every table in the database. | `—` | read |
| `describe_table` | Return the column schema of a table. | `table_name: string` | read |
| `append_insight` | Append a learned insight to the memo table (if initialised). | `insight: string` | write |

## Security & scope

- **Access scope:** read-write
- **Sandbox:** Opens a local SQLite file using the path passed at launch. Access is scoped to that single database file; no network or filesystem access beyond it.
- **Gotchas:**
  - The server bundles read and write; there is no read-only mode at the MCP level.
  - SQLite is a single-file database — back it up before letting an agent run destructive statements.

## Quick answer

**What it does.** Provides read and write access to a local SQLite database file. Supports queries, inserts, updates, schema inspection, and table creation.

**Best for:**
- Local prototyping
- Agent memory storage
- Offline data workflows
- Testing SQL logic
- Simple CRUD applications

**Not for:**
- Production workloads
- Multi-user concurrent access
- Large datasets

## Recipes

### Create a todos table and populate it

```
Create a `todos` table in demo.db with columns id INTEGER PRIMARY KEY, title TEXT NOT NULL, done INTEGER DEFAULT 0. Insert three sample rows. Then list them, sorted by id.
```

_Tested with: Claude Desktop, Cursor_

## Description

The SQLite MCP gives AI models direct access to local SQLite databases. Unlike the Postgres MCP, it supports both read and write operations. Perfect for local development, prototyping, and testing AI workflows that need persistent storage without a server.

## Why it matters

SQLite is the simplest persistent storage option for local AI workflows. This MCP enables full database interaction without any server setup.

## Key features

- Full read/write access
- Schema creation
- No server required
- Lightweight setup
- File-based persistence

## FAQ

### Does the SQLite MCP support write operations?

Yes. Unlike the Postgres MCP, it exposes INSERT, UPDATE, DELETE, and full DDL (CREATE TABLE, ALTER, DROP). That makes it the default pick for "give the agent a scratch database it can mutate."

### Is a server process required?

No. SQLite is a file-based embedded database. Point the MCP at a `.sqlite` file path and it opens it in-process — no daemon, no port, no schema migration tooling.

### Will the file be created if it does not exist?

Yes. If the path does not exist, SQLite creates a new empty database file when the first connection opens. That is convenient for scratch use but means a typo in the path gives you a fresh empty DB instead of an error.

### Can two agents use the same SQLite file at once?

Yes, within limits. SQLite allows concurrent readers but serializes writes. Two MCP processes pointed at the same file will work for read-heavy workloads; for write-heavy agent work you will hit `SQLITE_BUSY` and should pick one owner.

### Is it a good fit for long-term agent memory?

It works, but the dedicated Memory MCP gives you a knowledge-graph model that is more natural for agents than raw SQL. Use SQLite when you specifically want relational structure or want to query with SQL; use Memory for "remember X about user Y".

## Changelog

- **2026-05-31** — Refreshed install snippets and fact sheet; verified for 2026.
- **2024-11-25** — Initial directory listing.
