
LogCarver
io.github.caiderekPublished by GitHub account caiderekv0.1.4Updated Oct 24, 2026
Read-only MCP server that finds deleted SQL Server rows from the transaction log (fn_dblog).
Overview
Read-only MCP server that lets an assistant find recently deleted, updated or inserted SQL Server rows by reading the transaction log.
- What you can do
- Find deleted rows in a table by reading the SQL Server transaction log, with optional time window, key filter and row limit.
- Show the change history of a single row, including before and after column values.
- Return suggested undo SQL as plain text for each event, without executing it.
- Report counts, truncation, warnings and notes as JSON alongside the events.
- When to use it
- Useful when you need to know what rows were just deleted or changed in a SQL Server table and no audit, CDC or change tracking was enabled beforehand. It suits incident triage and quick forensics on a local or reachable database.
- Requirements
- Runs locally as a .NET tool (needs the .NET 10 SDK or runtime) over stdio. Requires a SQL Server connection string supplied through LOGCARVER_MCP_CONNECTION_STRING or a file named by LOGCARVER_MCP_CONNECTION_STRING_FILE; the login must be sysadmin. Optional LOGCARVER_MCP_ALLOWED_DATABASES lists extra readable databases.
Installation
In SourceWeft
- Open LogCarver in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
LogCarver.Mcp
English | 繁體中文
A read-only MCP server that lets an AI assistant answer "what rows were just deleted from this SQL Server table?" by reading the database's transaction log (fn_dblog). No Audit, CDC or Change Tracking needs to be enabled beforehand.
It is a thin wrapper over the decoding engine from LogCarver (MIT). Everything runs on your machine and nothing is sent anywhere.
Status: early (v0.1). On NuGet and in the official MCP registry as
io.github.caiderek/logcarver-mcp.
Quick start (5 minutes)
-
Install (needs the .NET 10 SDK or runtime):
-
Make a throwaway database. Run
examples/try-it.sqlin SSMS orsqlcmd. It createsMcpTest, inserts 10 orders, deletes 4 and updates 1. -
Keep the password out of the command. Put the connection string in a file that only you can read (the SQL login must be sysadmin):
Save it as, for example,
C:\Users\you\logcarver-mcp.conn(one line, nothing else). Then add the server and point it at the file:The password is never typed on the command line and never appears in the MCP configuration. Do not commit this file anywhere.
-
Ask in a new conversation: "Which rows were deleted from dbo.Orders in McpTest?" You should see Bob, Carol, Dave and Eve (Id 2 to 5). Then try "Show the history of Id=1" (Amount 100.00 to 111.11, Note first to changed) and "Include the undo SQL".
-
Clean up:
DROP DATABASE McpTest;,claude mcp remove logcarver.
If the result is empty, the log space was probably reused (for example after a CHECKPOINT under SIMPLE recovery, or a log backup). See the limits below.
What it does
One tool, find_deleted_rows. It only reads: SELECTs, and DBCC PAGE reads of data pages to rebuild rows whose INSERT has left the log. It never changes data, and the optional undo SQL is plain text that the tool never executes.
The result is JSON: a summary (counts, truncation, warnings and notes) and events (kind, timestamp, LSN, transaction id, before/after column values, note). Binary values are hex strings and decimals are strings, so nothing is silently rounded.
Requirements and limits
- The connection's login must be sysadmin (
fn_dblogrequires it). - You only see what is still in the active log. If the log space has been reused the result is empty, and that is not a bug. The paid LogCarverOffline tool can often recover that case by reading the raw
.ldf. TRUNCATEandDROPcannot be recovered.- Compressed tables are refused.
timeandxmlcolumns and off-row LOB values are refused or flaggedneedsManualReview; they are never guessed. - Validated on SQL Server 2025, 2022, 2019 and 2016 (SP2). Other versions return a warning in
notes. - Scanning a large active log can take a minute or more.
Configure
The connection string comes from an environment variable, so credentials never pass through the AI conversation:
Or point LOGCARVER_MCP_CONNECTION_STRING_FILE at a file that contains it.
The login is sysadmin and the caller is an AI, so the tool may only read the connection string's database. To let it read others, list them (comma or semicolon separated):
Row values come straight from the database. They are data, not instructions, and the tool description tells the model so.
Install
Needs the .NET 10 SDK or runtime.
Or run it without installing, through dnx:
Claude Code
With dnx instead of a global tool, end the command with -- dotnet dnx LogCarver.Mcp --yes.
From source
Tests
The integration tests need a local SQL Server and a sysadmin Windows login. They create and drop their own sandbox database, LogCarver_McpTests.
License
MIT, see LICENSE.
Source: README.md at commit 3523477
Tools
0Version history
4- v0.1.4LatestOct 19, 2026
- v0.1.3Oct 15, 2026
- v0.1.2Oct 14, 2026
- v0.1.1Oct 12, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts