Metadata-Version: 2.5
Name: failslice-mcp
Version: 0.1.1
Summary: MCP server for FailSlice: shrink multi-table data to a small, verified reproducer of a data bug.
Project-URL: Homepage, https://github.com/sdmhdn/failslice
Project-URL: Documentation, https://github.com/sdmhdn/failslice/blob/main/docs/mcp.md
Project-URL: Source, https://github.com/sdmhdn/failslice
Project-URL: Issues, https://github.com/sdmhdn/failslice/issues
Project-URL: Changelog, https://github.com/sdmhdn/failslice/blob/main/CHANGELOG.md
Author-email: Saeed Mahdian <saeed.mahdian@gmail.com>
Maintainer-email: Saeed Mahdian <saeed.mahdian@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: data-quality,delta-debugging,duckdb,mcp,mcp-server
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: failslice==0.1.1
Description-Content-Type: text/markdown

# failslice-mcp

The MCP server of [FailSlice](https://github.com/sdmhdn/failslice), for AI agents in
Claude Code, Claude Desktop, Cursor and other MCP clients.

FailSlice shrinks a multi-table CSV/Parquet dataset to the handful of rows that still
trigger a data bug, keeps foreign keys intact, verifies the result in a fresh process and
exports a ready-to-run pytest regression test. Over MCP, an agent drives that loop with
paths and SQL: it sees counts, schemas, bounded previews (at most 20 rows) and reports on
the reduced rows, never the full dataset.

## What this package is

This distribution only provides the `failslice-mcp` command, so that
`uvx failslice-mcp` works without installing anything first. The server itself is part of
the [`failslice`](https://pypi.org/project/failslice/) package, which this one installs,
pinned to the same version. If you already use `failslice`, `python -m
failslice.mcp_server` starts the same server.

## Setup

[uv](https://docs.astral.sh/uv/) is the only requirement; `uvx` fetches Python 3.11+ if
needed. Use absolute paths.

Claude Code:

```bash
claude mcp add failslice -- uvx failslice-mcp --root /absolute/path/to/your/data
```

Claude Desktop (`claude_desktop_config.json`) and Cursor (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "failslice": {
      "command": "uvx",
      "args": ["failslice-mcp", "--root", "/absolute/path/to/your/data"]
    }
  }
}
```

Claude Desktop does not read your shell's `PATH`: if it cannot start `uvx`, put the
absolute path that `which uvx` prints in `command`.

## Tools

| tool | does |
|---|---|
| `inspect_dataset` | row and NULL counts, schemas, orphan counts for declared foreign keys, previews |
| `suggest_relationships` | primary/foreign key **suggestions** with evidence and confidence |
| `check_predicate` | validates the failure predicate and checks that it is deterministic |
| `reduce_failure` | reduces the data, replays the result in a fresh process, writes the report, manifest and test |
| `verify_reproducer` | replays a finished run in a fresh process |
| `explain_reproducer` | observations on the surviving rows (not a diagnosis) |
| `export_pytest` | re-verifies a run and writes a standalone pytest bundle |

Runs are also readable as resources (`failslice://runs`, manifests, reports, table
previews), and the `debug-data-bug` prompt walks the agent from a bug description to an
exported test.

## Safety

The server reads supported data files only inside `--root` and writes only under
`<root>/.failslice/`. One expensive operation runs at a time and budgets have ceilings
(`--max-evals`, `--wall-clock`, `--eval-timeout`). Cancelling a predicate check, a
reduction or a replay stops its child process; artifact steps that are already running
finish first. Previews show real data values, so point `--root` only at data the agent
may read.

FailSlice isolates rows; it does not determine the root cause.

## More

Full reference (options, budgets, resources, limits):
[docs/mcp.md](https://github.com/sdmhdn/failslice/blob/main/docs/mcp.md) ·
[FailSlice README](https://github.com/sdmhdn/failslice#readme) ·
[Changelog](https://github.com/sdmhdn/failslice/blob/main/CHANGELOG.md)

Created and maintained by Saeed Mahdian ([@sdmhdn](https://github.com/sdmhdn)). MIT license.

<!-- mcp-name: io.github.sdmhdn/failslice -->
