# LogCarver

> LogCarver is an open-source MCP server for databases. Read-only MCP server that finds deleted SQL Server rows in the transaction log. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Windows, macOS, Linux
- **Website:** https://caiderek.github.io/LogCarver/
- **Repository:** https://github.com/caiderek/logcarver.mcp
- **MCP Registry name:** io.github.caiderek/logcarver-mcp
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-15

## About

When rows vanish from a SQL Server table and no Audit, CDC or Change Tracking was switched on, the transaction log is often the only record. LogCarver.Mcp lets an assistant answer "what was just deleted from dbo.Orders?" by decoding that log through fn_dblog. It wraps the MIT-licensed LogCarver decoding engine and runs on your machine; nothing is sent anywhere.

It exposes a single tool, find_deleted_rows. Parameters cover the table, an optional database (others are refused unless allow-listed), operations (delete, update, insert or all), an ISO time window, a Column=Value key for one row's history, a row cap up to 500, and an option to return suggested undo SQL that the tool never executes. The result is JSON with a summary and events carrying LSN, transaction id and before and after values.

Limits are spelled out. The login must be sysadmin, only the active log is visible, TRUNCATE and DROP cannot be recovered, and compressed tables are refused. Install needs the .NET 10 SDK or runtime, and the README recommends keeping the connection string in a file rather than on the command line.

## Features

- **Deleted-row recovery:** Finds deleted, updated or inserted rows from the live transaction log.
- **Row history by key:** Returns the history of one row using a Column=Value key.
- **Suggested undo SQL:** Optionally returns plain-text SQL that would reverse each event; it is never executed.
- **Read-only access:** Uses SELECT and DBCC PAGE reads and never changes data.
- **Database allow-list:** Refuses databases other than the connection's own unless listed.
- **Honest value handling:** Binary values are hex strings and decimals are strings, so nothing is rounded.

## Good for

- Find out which rows an accidental DELETE removed
- Trace how a single record changed over time
- Draft undo SQL for review after a bad update
- Investigate data loss without prior auditing

## Install

### Claude Code (Terminal)

```sh
claude mcp add logcarver-mcp --env LOGCARVER_MCP_CONNECTION_STRING='<LOGCARVER_MCP_CONNECTION_STRING>' -- dnx LogCarver.Mcp --yes
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "logcarver-mcp": {
      "command": "dnx",
      "args": [
        "LogCarver.Mcp",
        "--yes"
      ],
      "env": {
        "LOGCARVER_MCP_CONNECTION_STRING": "<LOGCARVER_MCP_CONNECTION_STRING>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logcarver-mcp": {
      "command": "dnx",
      "args": [
        "LogCarver.Mcp",
        "--yes"
      ],
      "env": {
        "LOGCARVER_MCP_CONNECTION_STRING": "<LOGCARVER_MCP_CONNECTION_STRING>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "logcarver-mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "LogCarver.Mcp",
        "--yes"
      ],
      "env": {
        "LOGCARVER_MCP_CONNECTION_STRING": "<LOGCARVER_MCP_CONNECTION_STRING>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logcarver-mcp": {
      "command": "dnx",
      "args": [
        "LogCarver.Mcp",
        "--yes"
      ],
      "env": {
        "LOGCARVER_MCP_CONNECTION_STRING": "<LOGCARVER_MCP_CONNECTION_STRING>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logcarver-mcp": {
      "command": "dnx",
      "args": [
        "LogCarver.Mcp",
        "--yes"
      ],
      "env": {
        "LOGCARVER_MCP_CONNECTION_STRING": "<LOGCARVER_MCP_CONNECTION_STRING>"
      }
    }
  }
}
```

## Tools

- `find_deleted_rows`: Finds deleted, updated or inserted rows in a table from the SQL Server transaction log.

## FAQ

### What permissions does it need?

The SQL login must be sysadmin because fn_dblog requires it.

### Why can the result be empty?

Only the active log is visible; if log space has been reused, for example after a checkpoint under SIMPLE recovery or a log backup, nothing remains to read.

### Can it recover TRUNCATE or DROP TABLE?

No.

### Which SQL Server versions were validated?

SQL Server 2025, 2022, 2019 and 2016 SP2.

### Is LogCarver free?

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

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

Run this command in your terminal: claude mcp add logcarver-mcp --env LOGCARVER_MCP_CONNECTION_STRING='<LOGCARVER_MCP_CONNECTION_STRING>' -- dnx LogCarver.Mcp --yes

### What are the best alternatives to LogCarver?

The closest alternatives to LogCarver 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/logcarver
