# database-mcp-sqlite MCP server

> Provides AI clients with safe, structured access to SQLite databases using tools for SQL execution and schema searching.

- Repository: https://github.com/arifulislamat/database-mcp
- Page: https://hostedmcp.org/servers/arifulislamat/database-mcp-sqlite
- Transport: stdio
- Stars: 5
- License: MIT
- Latest version: 0.5.0

## Install

### Claude Code

```sh
claude mcp add --env 'SQLITE_PATH=<SQLITE_PATH>' database-mcp-sqlite -- npx -y @database-mcp/sqlite
```

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

```json
{
  "mcpServers": {
    "database-mcp-sqlite": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/sqlite"
      ],
      "env": {
        "SQLITE_PATH": "<SQLITE_PATH>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "database-mcp-sqlite": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/sqlite"
      ],
      "env": {
        "SQLITE_PATH": "<SQLITE_PATH>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"database-mcp-sqlite","type":"stdio","command":"npx","args":["-y","@database-mcp/sqlite"],"env":{"SQLITE_PATH":"<SQLITE_PATH>"}}'
```

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

```json
{
  "mcpServers": {
    "database-mcp-sqlite": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/sqlite"
      ],
      "env": {
        "SQLITE_PATH": "<SQLITE_PATH>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add database-mcp-sqlite --env 'SQLITE_PATH=<SQLITE_PATH>' --env 'SQLITE_PATH=<SQLITE_PATH>' --env 'SQLITE_PATH=<SQLITE_PATH>' -- npx -y @database-mcp/sqlite
```

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

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

[mcp_servers.database-mcp-sqlite.env]
SQLITE_PATH = "<SQLITE_PATH>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'SQLITE_PATH=<SQLITE_PATH>' -e 'SQLITE_PATH=<SQLITE_PATH>' -e 'SQLITE_PATH=<SQLITE_PATH>' database-mcp-sqlite npx -- -y @database-mcp/sqlite
```

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

```json
{
  "mcpServers": {
    "database-mcp-sqlite": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/sqlite"
      ],
      "env": {
        "SQLITE_PATH": "<SQLITE_PATH>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SQLITE_PATH` | yes | no | Path to the SQLite database file |
| `SQLITE_PATH` | yes | no | Path to the SQLite database file |
| `SQLITE_PATH` | yes | no | Path to the SQLite database file |

## FAQ

### How safe is the database access?

The server is safe by default, enforcing read-only mode through SQL guards and database settings, capping rows at 1000, and setting a 30s statement timeout.

### Can I provide database credentials through a chat prompt?

No, credentials must be configured at launch via flags, environment variables, or a YAML config file; they are never accepted through tool calls.

### What tools are available in this server?

The server exposes two minimal tools: execute_sql for running queries and search_objects for discovering the database schema.
