Skip to main content

MCP server for resilient chunked reads of large files

Project description

resilient-read

MCP server that lets coding agents read very large files safely in small, resumable chunks.

Why this exists

When context windows are small, naive full-file reads are brittle and expensive. resilient-read provides deterministic pagination with cursor-based continuation and drift detection.

Tools

  • rr.stat - get file metadata (size, mtime_ns, optional sha256)
  • rr.read_bytes - read byte windows with offset, max_bytes, next_offset, eof
  • rr.read_lines - read line-numbered slices for code/log analysis
  • rr.read_tail - read only the latest lines from append-only files
  • rr.search_then_page - search with contextual excerpts and next_from_line
  • rr.make_cursor - mint resumable cursor token
  • rr.read_next - read next chunk from cursor (fails if file changed)

Install

uv sync

PyPI release (0.1.0): https://pypi.org/project/resilient-read/0.1.0/

Install from PyPI:

pip install resilient-read

Run with stdio (default):

uv run resilient-read

Run with SSE:

uv run resilient-read --transport sse --host 127.0.0.1 --port 8000

Run with Streamable HTTP:

uv run resilient-read --transport http --host 127.0.0.1 --port 8000

MCP config (stdio)

{
  "mcpServers": {
    "resilient-read": {
      "command": "uvx",
      "args": ["resilient-read"],
      "env": {
        "RR_WORKSPACE": "/path/to/your/project"
      }
    }
  }
}

MCP config (SSE)

{
  "mcpServers": {
    "resilient-read": {
      "type": "sse",
      "url": "http://127.0.0.1:8000/sse"
    }
  }
}

MCP config (HTTP)

{
  "mcpServers": {
    "resilient-read": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

Example workflows

Cursor-based file pagination

  1. Call rr.stat(path="large.log")
  2. Call rr.make_cursor(path="large.log", offset=0, max_bytes=65536)
  3. Loop on rr.read_next(cursor=...) until eof=true

Targeted search pagination

  1. Call rr.search_then_page(path="server.log", query="timeout", max_matches=3)
  2. Follow with rr.search_then_page(..., from_line=<next_from_line>)

Each response is small and composable, so you can process huge files while staying inside small model contexts.

Project housekeeping

  • Release notes and version history: CHANGELOG.md
  • Manual semver tagging flow: docs/RELEASE.md
  • JSON-RPC examples: examples/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resilient_read-0.1.1.tar.gz (45.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resilient_read-0.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file resilient_read-0.1.1.tar.gz.

File metadata

  • Download URL: resilient_read-0.1.1.tar.gz
  • Upload date:
  • Size: 45.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for resilient_read-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c3ccbea3b3812cc3e73ae19130126ad58fd847aa5f8c21bf23a81d46151062f4
MD5 f75da2125035c38fa62d7e767d9ba788
BLAKE2b-256 d83e90d277728cb480da21c59ad4620c7a2687f167e45ef28a7714b865304b73

See more details on using hashes here.

File details

Details for the file resilient_read-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: resilient_read-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for resilient_read-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 affa421defc41d0e8b5c61f409d2a500949e5225e1eedf0a8ae0dd0b5d73342f
MD5 3d67fb3e2502304d31b1c32bcae89344
BLAKE2b-256 1fdf4403641de99fedd3854634fd9f0ab6759a89f1f365566a7a2ce945b1d0b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page