# LiteScope

> LiteScope is an open-source MCP server for databases. Dry-run, snapshot and rewind AI writes to SQLite, Cloudflare D1 and Turso databases. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://litescope-site.pages.dev
- **Repository:** https://github.com/croc100/litescope
- **MCP Registry name:** io.github.croc100/litescope
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-16

## About

The core promise is that an agent should never write blind. Every write is a dry run by default that reports the exact rows affected, and each applied write captures a rewind point first: a local snapshot, or a Cloudflare D1 Time Travel bookmark, so a single call can undo it. The README's example is asking Claude to delete inactive users, seeing the blast radius, approving, and later saying undo that.

Beyond safety it is a pure-Go operations toolkit for SQLite fleets: one-command health checks with an HTML report, SQLITE_BUSY diagnosis, VACUUM INTO backups, schema and data diffs, schema lint for CI, missing-index advice, Mermaid ERDs, portable SQL export, CSV to SQLite import, and Prometheus metrics for Grafana.

The server is read-only unless started with --allow-writes, and D1 sources need a Cloudflare API token and account ID. The code is AGPL-3.0; a hosted dashboard is the only paid part. A Claude Code plugin adds five skills.

## Features

- **Dry-run writes:** Shows exact rows affected before anything changes.
- **One-call undo:** Rewind via a local snapshot or D1 Time Travel bookmark.
- **Lock diagnosis:** Explains SQLITE_BUSY with the PRAGMA fix.
- **Schema diff and lint:** Compares databases and flags design smells for CI.
- **Fleet metrics:** Exposes health and drift as Prometheus text.
- **Read-only default:** Writes need --allow-writes.

## Good for

- Let an agent edit a D1 table with an undo path
- Diagnose a locked SQLite database
- Diff local and production schemas for a migration
- Back up Turso databases with retention
- Import a CSV into a typed database

## Install

### Claude Code (Terminal)

```sh
claude mcp add litescope --env CLOUDFLARE_API_TOKEN='<CLOUDFLARE_API_TOKEN>' -- npx -y litescope
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "litescope": {
      "command": "npx",
      "args": [
        "-y",
        "litescope"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "<CLOUDFLARE_API_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "litescope": {
      "command": "npx",
      "args": [
        "-y",
        "litescope"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "<CLOUDFLARE_API_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "litescope": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "litescope"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "<CLOUDFLARE_API_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "litescope": {
      "command": "npx",
      "args": [
        "-y",
        "litescope"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "<CLOUDFLARE_API_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "litescope": {
      "command": "npx",
      "args": [
        "-y",
        "litescope"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "<CLOUDFLARE_API_TOKEN>"
      }
    }
  }
}
```

## FAQ

### Is it free?

Yes, AGPL-3.0; only a hosted dashboard is paid.

### Can it write by default?

No. Writes require --allow-writes and are dry-run first.

### What does D1 need?

A Cloudflare API token and account ID.

### How do I add it to Claude Code?

Run claude mcp add litescope -- litescope mcp.

### Is LiteScope free?

Yes. LiteScope is open source, so you can use and self-host it for free.

### How do I add LiteScope to Claude Code?

Run this command in your terminal: claude mcp add litescope --env CLOUDFLARE_API_TOKEN='<CLOUDFLARE_API_TOKEN>' -- npx -y litescope

### What are the best alternatives to LiteScope?

The closest alternatives to LiteScope are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/litescope
