Metadata-Version: 2.4
Name: sieve-mcp-server
Version: 0.1.0
Summary: Sieve-MCP: the MCP server that hands local files to AI tools in a shareable form, over the sieve-tray engines
Author: Kai IWASAKI
License: MIT
Project-URL: Homepage, https://github.com/neguseatama/sieve-mcp
Project-URL: Repository, https://github.com/neguseatama/sieve-mcp.git
Project-URL: Bug Tracker, https://github.com/neguseatama/sieve-mcp/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Text Processing :: Filters
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sieve-tray>=2.6.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: mcp>=2.3.0; extra == "test"
Dynamic: license-file

**English** | [日本語](README.ja.md)

# Sieve-MCP v0.1.0 (sieve-mcp-server)

**The MCP server that hands local files to AI tools in a form ready to share**

Sieve-MCP is a small Model Context Protocol server for Claude Desktop,
Claude Code, and any other MCP client. It works as a lightweight wrapper
with the [Sieve Tray](https://github.com/neguseatama/sieve-tray) engines
built in: when the AI specifies a file or folder inside the folders you
allow, the reply includes what the material looks like and where the
shareable copy went — counts, status words, checksums, digests, and
relative paths. The package installs as `sieve-mcp-server`; the product
name is Sieve-MCP.

```
pip install sieve-mcp-server
```

The only runtime dependency is `sieve-tray>=2.6.0` (installed
automatically, no extra needed). Requires Python >= 3.10.

## Configure

### Claude Desktop

Edit `claude_desktop_config.json` (the standard places: macOS
`~/Library/Application Support/Claude/`, Windows `%APPDATA%\Claude\`)
and add:

```json
{
  "mcpServers": {
    "sieve-mcp": {
      "command": "sieve-mcp-server",
      "args": ["--root", "/path/to/your/folder",
               "--out", "/path/to/output"]
    }
  }
}
```

### Claude Code

```
claude mcp add sieve-mcp -- sieve-mcp-server --root /path/to/your/folder --out /path/to/output
```

`--root` names the folders the server may read (one or more); `--out`
names the folder every run writes into; the two must not contain each
other. `sieve-mcp-server --print-config --root ... --out ...` prints
this configuration from your own values, and
`sieve-mcp-server --self-check` runs the whole flow in one process and
exits 0 when everything matches.

## The tools

| Tool | What it does | What the reply carries |
| --- | --- | --- |
| `prepare_for_sharing` | Strips hidden characters and masks sensitive values into a fresh output folder (`handoff/` + `local/`) | Per-item status words, hidden-character kind counts, handoff file names and sizes, the record digest |
| `read_handoff` | Reads a UTF-8 text from a previous output's `handoff/` in slices | The text slice, the total length, the continuation offset |
| `observe_hidden_text` | Observes a file or a folder for hidden text, writing nothing | The check shape (`check_version: 1`): per-file status words and kind counts |
| `verify_record` | Re-checks a run record against a folder | `match` / `differs` / `not_verifiable` with the closed reason words |
| `remove_metadata` | Copies a JPEG, PNG, Office or PDF file with its metadata stripped | The eight metadata categories before and after, the re-observation, the output path |
| `create_file_list` | Lists a tree with per-file hashes and the whole-tree checksum | The file count, the overall checksum, the record path |

## How the answers stay safe

Every reply carries counts, status words, checksums and relative paths
only - the hidden text, the metadata values, the layer names and the
absolute paths never enter a reply, and everything the engines print
during a run is captured and dropped, so the protocol stream carries
the JSON messages alone. The server reads only inside the `--root`
folders (no `..`, no symbolic links, no special files), writes only
under `--out` into numbered folders that are never overwritten, leaves
the originals untouched, and skips the `.obsidian/` and `.trash/`
folders of a folder target by default.

## Development

- Test suite: `python -m pytest -v` (the protocol tests also ride the
  official SDK; `pip install ".[test]"`).
- Public-text watch: `python tools/check_public_text.py`.
- The docs: `docs/tools.md` (the tool shapes) and `docs/protocol.md`
  (the protocol versions and their sources).
