# sqlite-tools MCP server

> Allows an AI client to perform safe, local SQLite database operations including reading, writing, schema management, and CSV imports/exports.

- Repository: https://github.com/spences10/mcp-sqlite-tools
- Page: https://hostedmcp.org/servers/spences10/mcp-sqlite-tools
- Transport: stdio
- Stars: 20
- License: MIT
- Latest version: 0.0.11

## Install

### Claude Code

```sh
claude mcp add mcp-sqlite-tools -- npx -y mcp-sqlite-tools
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-sqlite-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-sqlite-tools"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-sqlite-tools": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-sqlite-tools"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-sqlite-tools","type":"stdio","command":"npx","args":["-y","mcp-sqlite-tools"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-sqlite-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-sqlite-tools"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-sqlite-tools -- npx -y mcp-sqlite-tools
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-sqlite-tools]
command = "npx"
args = ["-y", "mcp-sqlite-tools"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-sqlite-tools npx -- -y mcp-sqlite-tools
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-sqlite-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-sqlite-tools"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SQLITE_ALLOW_ABSOLUTE_PATHS` | no | no |  |
| `SQLITE_BACKUP_PATH` | no | no |  |
| `SQLITE_BUSY_TIMEOUT` | no | no |  |
| `SQLITE_DEFAULT_PATH` | no | no |  |
| `SQLITE_JOURNAL_MODE` | no | no |  |

## Tools (19)

- `open_database`: ✓ SAFE: Open or create a SQLite database file
- `close_database`: ✓ SAFE: Close a database connection
- `list_databases`: ✓ SAFE: List available database files in a directory
- `database_info`: ✓ SAFE: Get information about a database (size, tables, etc.)
- `list_tables`: ✓ SAFE: List all tables and views in a database
- `describe_table`: ✓ SAFE: Get schema information for a table
- `create_table`: ⚠️ SCHEMA CHANGE: Create a new table with specified columns
- `drop_table`: ⚠️ DESTRUCTIVE: Permanently delete a table and all its data
- `backup_database`: ✓ SAFE: Create a backup copy of a database
- `vacuum_database`: ✓ MAINTENANCE: Optimize database storage by reclaiming unused space
- `execute_read_query`: ✓ SAFE: Execute read-only SQL queries (SELECT, PRAGMA, EXPLAIN)
- `execute_write_query`: ⚠️ DESTRUCTIVE: Execute SQL that modifies data (INSERT, UPDATE, DELETE)
- `execute_schema_query`: ⚠️ SCHEMA CHANGE: Execute DDL queries (CREATE, ALTER, DROP)
- `bulk_insert`: ⚠️ DESTRUCTIVE: Insert multiple records efficiently in batches
- `begin_transaction`: ⚠️ TRANSACTION: Begin a database transaction
- `commit_transaction`: ✓ TRANSACTION: Commit the current database transaction
- `rollback_transaction`: ⚠️ TRANSACTION: Rollback the current database transaction
- `export_schema`: ✓ SAFE: Export database schema as SQL or JSON
- `import_schema`: ⚠️ SCHEMA CHANGE: Import and execute schema from SQL or JSON

## FAQ

### How do I install this server?

You can install it using npx via MCPick or by manually adding it to your MCP client configuration.

### Can I restrict which files the server can access?

Yes, you can restrict database and CSV paths through configuration using environment variables like SQLITE_DEFAULT_PATH.

### Is it safe to run write queries?

The server classifies destructive tools separately so clients can require explicit approval for write, schema, and maintenance actions.

### What are the system requirements?

You need Node.js version 24.12 or later and an MCP client that supports stdio servers.
