Skip to main content
ConTXT BOX

ConTXT BOX

A local-first external context box for coding agents.

CI Python MCP MarkItDown Docling License


What Is It?

ConTXT BOX is a strict, local-first knowledge layer that sits beside any project or document folder. It gives coding agents such as Claude Code, Codex, Cursor, and other MCP clients a fast external memory: indexed filenames, folders, neighbors, summaries, cached document/image context, and durable chat preservation.

The design is intentionally narrow. Documents and images are the core path because they cover most real user context. Heavy extraction uses exactly one configured engine: MarkItDown or Docling. No multi-tool fallback chain is used in core extraction.

Features

  • Lazy indexing with rel_path, filename, folder, mtime, size, type, neighbors, folder summaries, and cheap file summaries.
  • On-demand extraction only through MarkItDown or Docling.
  • Permanent Markdown sidecars under .contextbox/history/media/.
  • MCP tools for coding agents.
  • Watchdog-based watch command for continuous index updates.
  • Preview-only smart reorganization.
  • Auto preservation into .contextbox/CONTEXT.md plus JSONL history.

Quick Start

uv sync
uv run contxtbox --help
uv run contxtbox init --root "S:\Papers"
uv run contxtbox config-show --root "S:\Papers"
uv run contxtbox index --root "S:\Papers"
uv run contxtbox health --root "S:\Papers"
uv run contxtbox search "computer vision" --root "S:\Papers"

When commands are run from inside the target workspace, --root can be omitted.

Install the document/image engines:

uv sync --extra media

Extract one file with the strict default engine:

uv run contxtbox extract-media "Computer Vision\paper.pdf" --root "S:\Papers"

Use Docling explicitly:

uv run contxtbox extract-media "Computer Vision\paper.pdf" --root "S:\Papers" --engine docling

Watch a folder:

uv run contxtbox watch --root "S:\Papers"

Run production readiness checks:

uv run contxtbox health --root "S:\Papers" --fail-on-error

Show the effective workspace config:

uv run contxtbox config-show --root "S:\Papers"

Production and MCP setup guides:

How It Works

workspace/
`-- .contextbox/
    |-- index.json
    |-- config.toml
    |-- CONTEXT.md
    |-- preservation.jsonl
    `-- history/
        `-- media/
            `-- sanitized__file__path.context.md

Indexing Rules

index, update_index, and watch always record:

  • rel_path
  • filename
  • folder_path
  • mtime
  • size
  • file_type
  • neighbors
  • parent_folder_summary
  • last_indexed
  • context_summary

The default summary is cheap and deterministic. It uses filename, folder name, and 5-7 nearby files. It does not open PDFs or images during indexing.

Configuration

init creates .contextbox/config.toml:

extraction_engine = "markitdown"
max_inline_bytes = 512000
large_file_bytes = 50000000
max_neighbors = 10
debounce_seconds = 2.0
auto_watch = true

ignored_dirs = [
  ".git",
  ".venv",
  "node_modules",
]

priority_folders = [
  "codebases/",
  "research/",
  "specs/",
  "decisions/",
  "assets/images/",
]

Use "docling" when you want Docling as the strict extraction engine.

Extraction Rules

Heavy extraction only happens when:

  • extract-media path is called,
  • or an MCP client calls get_file(path, depth="full").

The result is cached as Markdown in .contextbox/history/media/, and index.json receives:

  • extracted_at
  • context_ref
  • extraction_method
  • extraction_status
  • extraction_warnings
  • extraction_duration_seconds

Sidecars include the same audit header before extracted content. Status values are conservative: success, partial, metadata-only, or cached.

MCP Tools

  • update_index()
  • server_info()
  • set_root(root, index=true)
  • health()
  • search(query, limit=10)
  • get_file(path, depth="metadata" | "full")
  • pull_context(task, limit=5)
  • extract_media(path, force=false)
  • reorganize(instruction)
  • auto_preserve_context(summary, metadata=null)

Start the MCP server:

uv run contxtbox mcp --root "S:\Papers"

Attribution

Roadmap

  • Stronger semantic search over sidecars.
  • Reorganization scoring based on folder summaries and neighbor cues.
  • MCP client recipes for Claude Code, Codex, Cursor, and others.
  • Safe apply/undo flow for reorganization.
  • Configurable ignore rules and extraction engine policy.

License

MIT. See LICENSE.

Release

PyPI publishing is configured for Trusted Publishing through GitHub Actions. See Production readiness.

Metadata

Release files for contxt-box 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contxt-box 0.1.3
File Size Uploaded Provenance Actions
contxt_box-0.1.3.tar.gz 4.1 MB With provenance Details for contxt_box-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for contxt-box 0.1.3
File Interpreter ABI Platform Actions
contxt_box-0.1.3-py3-none-any.whl Python 3 none any Details for contxt_box-0.1.3-py3-none-any.whl

Total release size: 4.1 MB

Release files / contxt_box-0.1.3.tar.gz

Download URL contxt_box-0.1.3.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
de52b3ff5c1dda3fcbd78b9e497735cbff34ca811cbd581e0f73a4406ca6a418
BLAKE2b-256 checksum
How to use checksums
c313f4a402bbbc2290c0636f5b6115765e255dc1913bb88201846529a61df7d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Release files / contxt_box-0.1.3-py3-none-any.whl

Download URL contxt_box-0.1.3-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8716194d482761ec42b9c4fe972dea192f3e1153dd6109dba74f2f6b5ce8b22
BLAKE2b-256 checksum
How to use checksums
7d86cf89399bf5ece898e4fea7d8a350021dfd565971280366bb07d883534d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Security for contxt-box 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for contxt_box-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page