Labsco
akshay2211 logo

Universal Context Pipeline

β˜… 4

from akshay2211

Local-first MCP server that indexes folders, PDFs, code, and past AI conversations β€” and exposes them as a single grounded-search tool. Runs fully offline.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

UCP β€” Universal Context Pipeline

crates.io docs.rs

A local-first MCP server that grounds LLMs in your own files.

UCP indexes folders on your machine β€” notes, code, conversation exports β€” and exposes them to any MCP-compatible client (Claude Desktop, Cursor, LM Studio, and other local-agent runtimes) as a single tool: search_local_context. Hybrid retrieval (BM25 + vector), tree-sitter-aware code chunking, full citations, content-hash embedding cache. Single binary. No telemetry. No cloud.

Paired with a local model in LM Studio (or Ollama via ucp-local ask), the whole stack β€” indexing, embeddings, retrieval, and the chat model β€” runs fully offline. Works on a plane, in an air-gapped facility, or anywhere a cloud LLM isn't an option.

Demos

Conversation memory β€” make every past Claude chat searchable across every future session.

Conversation memory demo

Air-gap RAG β€” local Ollama + local index, zero network traffic.

Air-gap RAG demo

Quick start β€” install, index, ask, in under a minute.

Quick start demo

Who is this for?

If you are…UCP gives you…
A Claude / Cursor / LM Studio power userA searchable archive of every past AI conversation, callable from any future session as the search_local_context tool.
A software engineerCode + private docs + sibling repos + past Claude chats unified under one MCP tool β€” surfaced inside Cursor or Claude Code alongside their native indexers.
A researcher, writer, or academicA PDF + notes corpus you can ask grounded questions against, with line-level citations, without anything leaving the machine.
In a privacy-regulated workflow (legal, medical, defense, NDA-bound IP)A single Rust binary with zero telemetry and zero cloud. Pair with LM Studio for a fully offline, end-to-end RAG stack.
A solo founder or consultantPer-folder client isolation via folder_filter β€” no risk of leaking client A's context into client B's session.

Full audience analysis, competitive comparison, and the two wedges UCP is explicitly built to win on: see POSITIONING.md.

Status

v0.1, headless. Track scope in ROADMAP.md.

What ships:

  • Hybrid search: SQLite FTS5 (BM25) ⨉ sqlite-vec (ANN) merged via reciprocal-rank fusion.
  • Tree-sitter chunking for Rust, Python, TypeScript/JavaScript. Heading-aware Markdown. Sentence-bounded prose fallback.
  • Conversation memory: ingest your Claude conversations.json export and search across past chats.
  • PII masking on by default β€” email, OpenAI sk-, AWS keys, GitHub PATs, JWT.
  • Content-hash embedding cache: re-indexing unchanged content makes zero Ollama calls.
  • Filesystem watcher: edit a file, the index updates in ~500ms.

What's not in v0.1:

  • Desktop UI / tray (deferred β€” was in original spec, now in ROADMAP tier 2+).
  • OS hotkey injector and HTTP proxy interceptor (cut from the original spec).
  • OpenAI / Anthropic embedding providers (Ollama only for now).
  • Cursor and ChatGPT export formats (Claude only; others later).

Config

~/.config/ucp/config.toml (or the platform equivalent β€” ucp-local status prints the resolved path). All fields optional; defaults shown:

Copy & paste β€” that's it
[ollama]
host = "http://localhost:11434"
embedding_model = "nomic-embed-text"

[chunking]
max_tokens = 512
overlap_sentences = 1

What gets indexed

By extension: md, markdown, txt, rs, py, ts, tsx, js, jsx, mjs, go, pdf.

PDFs: text is extracted via pdf-extract and chunked as prose. Works well for digitally generated PDFs (papers, docs, exported notes). Falls down on scanned image-only PDFs β€” those need OCR (v0.2+). Citation line numbers reference the extracted plaintext, not PDF page numbers; page-aware citations are on the v0.2 list.

Skipped directories: .git, .idea, .vscode, target, node_modules, __pycache__, .venv, venv, dist, build, .next, .nuxt, coverage, .pytest_cache, .mypy_cache. Dotfiles are skipped.

Architecture

ModuleRole
ingestionMasking + per-format chunkers (prose / markdown / code via tree-sitter) + dispatcher
storagerusqlite + sqlite-vec + FTS5; hybrid search via RRF
embeddingsOllamaClient + content-hash cache via EmbeddingCache::hash
indexerWalk + read + chunk + embed + insert; single-file and bulk-chunk paths
watchernotify-based debounced re-index
mcpJSON-RPC 2.0 stdio server, one tool: search_local_context

See CLAUDE.md for the developer-facing architecture summary, and Universal Context Pipeline Specification.md for the original (now narrower in scope) design doc.

Development

Copy & paste β€” that's it
cargo test                    # full test suite
cargo test --lib ingestion    # one module
cargo run -- index <path>     # iterate against the dev build
RUST_LOG=ucp_local=info cargo run -- watch <path>   # verbose

Changelog

Release history and notes live in CHANGELOG.md. The current published version is 0.1.0 (crates.io).

License

Under Apache-2.0.