# Log Detective MCP

> Log Detective MCP is an open-source MCP server for developer tools. Cluster big logs into representative snippets and extract Python tracebacks for agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/fedora-copr/logdetective-mcp
- **MCP Registry name:** io.github.fedora-copr/logdetective-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The tools are meant to shrink huge build or test logs before an agent reasons over them. The Drain3 algorithm groups similar log messages into templates and returns one representative snippet per cluster, and a second tool pulls Python tracebacks, including chained exceptions. It implements core log-analysis pieces of the Log Detective project from the Fedora Copr team, packaged for use by other agents.

Logs can arrive as raw text, a file path on the server's filesystem or an HTTP(S) URL, and exactly one source must be given. Options set the maximum number of clusters (default 8), maximum snippet length (2,000 characters), regex skip patterns, and grep-style context lines from 0 to 50 around each hit.

Input is capped at 100 MB, and compressed files are unpacked transparently: .gz, .bz2, .xz, .lzma, .zip and tar variants, with a 100:1 compression-ratio limit and no nested archives. It needs Python 3.11 or later.

## Features

- **Drain3 clustering:** Groups similar messages and returns one snippet per cluster.
- **Traceback extraction:** Finds Python tracebacks, including chained exceptions.
- **Three input routes:** Accepts text, a server file path or a URL.
- **Context lines:** Adds 0 to 50 surrounding lines like grep -C.
- **Archive support:** Reads gzip, bzip2, xz, zip and tar logs.
- **Zip-bomb limits:** Caps size at 100 MB and compression ratio at 100:1.

## Good for

- Reduce a long CI log before sending it to an agent
- Find the traceback behind a failed Python build
- Skip noisy patterns while summarising logs
- Analyse a compressed log archive by URL

## Install

### Claude Code (Terminal)

```sh
claude mcp add logdetective-mcp -- uvx logdetective-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "logdetective-mcp": {
      "command": "uvx",
      "args": [
        "logdetective-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logdetective-mcp": {
      "command": "uvx",
      "args": [
        "logdetective-mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "logdetective-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "logdetective-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logdetective-mcp": {
      "command": "uvx",
      "args": [
        "logdetective-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "logdetective-mcp": {
      "command": "uvx",
      "args": [
        "logdetective-mcp"
      ]
    }
  }
}
```

## Tools

- `extract_log_snippets`: Extract representative log snippets using Drain3 clustering
- `extract_python_tracebacks`: Extract Python tracebacks from the log, including chained exceptions

## FAQ

### What Python version is needed?

Python 3.11 or newer.

### How large can a log be?

Downloaded inputs and decompressed archives are limited to 100 MB.

### Which archive formats work?

gz, bz2, xz, lzma, zip, tar, tar.gz, tar.bz2 and tar.xz, containing exactly one file.

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

Run claude mcp add logdetective -- logdetective-mcp after installing the package.

### Is Log Detective MCP free?

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

### How do I add Log Detective MCP to Claude Code?

Run this command in your terminal: claude mcp add logdetective-mcp -- uvx logdetective-mcp

### What are the best alternatives to Log Detective MCP?

The closest alternatives to Log Detective MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [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.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers 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.

---
Source: https://ai-powered.com/mcp/log-detective-mcp
