Loci logo

Loci

Local-first MCP memory for searching notes, preserving state, and answering questions with file-and-section citations.

Install Loci

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "loci-2": {
      "command": "uvx",
      "args": [
        "loci-rag"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio loci-2 -- uvx loci-rag

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

uvx loci-rag

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

loci MCP server turns local notes, project documents, and agent memories into a searchable knowledge base for AI tools. It combines BM25 keyword matching with vector search, supports exact-key state records, and cites answer excerpts by file and section. The index and source files remain local, while embedding and chat requests use configured providers or local endpoints. Use loci when an agent needs cross-session context, evidence-backed answers, decision history, or structured task state.

Use cases

  • Search project notes for prior decisions
  • Ask cited questions about local documentation
  • Save exact task state between agent sessions
  • Trace which decision superseded another
  • Audit stale or corrected memory notes

Key features

  • Hybrid BM25 and vector search
  • File-and-section citations
  • Exact-key JSON state records
  • Decision supersession history
  • Local web console
  • Memory health and feedback tracking

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

23/23 checks healthy over the last 68d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · loci-rag (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars101Stargazers on the source repository.
Last commit9d agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.

How Loci works

What loci MCP server does

loci MCP server gives MCP hosts access to a local knowledge base built from notes, documentation, and durable agent memories. It supports Markdown, plain text, HTML, org-mode, and chat exports by default; optional extras add PDF, Word, and OCR support. The same index can be used through MCP, the command line, or the local web console.

Search combines vector retrieval with BM25 keyword matching. This lets semantic queries find related passages while literal identifiers such as user_id, api/v2, or SHT45 can still match directly. Answers include citations in file > section form, so an agent or developer can inspect the source passage.

loci separates free-text knowledge from structured state. Notes are intended for information that may be phrased differently in future questions. State records are plain JSON addressed by an exact type and key, making them suitable for task snapshots, entity records, and other values where retrieving a similar but incorrect record would be unsafe.

How it works

Run ingestion against configured source directories to chunk and index files. Hybrid search can then retrieve relevant passages, while the ask workflow sends selected context to a configured chat provider. Embedding and chat services may be separate providers, and local endpoints can keep the workflow offline.

MCP tools expose the shared knowledge base to compatible hosts. Durable memories are stored as Markdown files, while structured records live under state/<type>/<key>.json and are intentionally excluded from vector indexing. Decision notes can use supersedes and effective frontmatter fields; loci history follows those links to show which decision replaced another.

Searches and answers that use memory notes are recorded in citations.jsonl. Explicit negative feedback can reduce the later ranking of affected chunks. The loci memory-health command combines citation history, feedback, and note age to identify corrected, unused, or heavily referenced notes.

Setup and configuration

loci requires Python 3.11 or newer. Install the package with python -m pip install loci-rag, or install from a source checkout when you need the example configuration. Set LOCI_HOME when using an existing instance directory. Optional document support is available through the pdf and docx extras.

Create config.toml from the example, configure [llm] and [embed], and point [[sources]].path at the directories to index. The embedding endpoint must provide /embeddings. API keys can be supplied with BRAIN_LLM_API_KEY and BRAIN_EMBED_API_KEY; a key is not needed for the included offline demo.

Run loci ingest, then use loci search or loci ask. loci serve-http starts the local console at 127.0.0.1:8765/ui, where users can search, ask questions, edit shared notes, inspect indexing activity, and review evidence. After changing the embedding model, rebuild the index with loci ingest --force.

Tools and capabilities

  • Expose the knowledge base to MCP hosts through loci-mcp.
  • Store and retrieve prose memories with brain_remember and brain_forget.
  • Save and fetch exact-key structured state with brain_state_save and brain_state_get.
  • Search across configured directories with semantic, keyword, tag, path, and date filtering.
  • Ask cited questions and optionally verify claims against retrieved evidence.
  • Inspect decision supersession chains with loci history.
  • Review memory usage and correction signals with loci memory-health.
  • Discover harnesses, browse files, inspect per-tool statistics, and view digest notes.

Limitations and notes

The knowledge base, index, and source files stay on the local machine, but configured embedding and chat requests may be sent to external providers. Local provider endpoints can avoid that network dependency. The server records tool calls and explicit feedback, not the host agent’s full conversation, so corrections must be submitted through the feedback workflow.

Live dialogue slots belong to the host session and are not durable memory. Values that must survive a session should be saved as exact-key state, while prose intended for later retrieval belongs in memory notes. Anonymous loopback clients have admin access to the web console by default; deployments behind a reverse proxy or SSH tunnel should disable local admin access and configure role-based tokens.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Loci

loci is an MCP server that connects AI tools to local notes, documents, and durable agent memories. Its main tools support hybrid search, cited question answering, prose memory management with brain_remember and brain_forget, and exact-key state access through brain_state_save and brain_state_get. Embedding and chat providers are configurable.

Install it with `python -m pip install loci-rag` and configure an instance directory, or install from a source checkout to use the example configuration. loci requires Python 3.11 or newer. Configure `[llm]`, `[embed]`, and source paths before running `loci ingest`.

Yes, loci works with Cursor through its MCP host support. Mount `loci-mcp` in Cursor, and the assistant can use the shared knowledge base as MCP tools. The same indexed data can also be accessed through the command line or local web console.

Yes, `loci demo` runs without a configuration file, API key, or network connection using bundled fictional notes and BM25 keyword search. For your own hybrid index, configure embedding and chat providers; local endpoints can keep those requests offline.

loci preserves exact task state with `brain_state_save` and `brain_state_get`. Records are stored as hand-editable JSON under `state/<type>/<key>.json` and retrieved by exact key rather than ranked similarity, keeping structured state separate from searchable prose memory.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLoci AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/loci-2?style=directory)](https://allmcps.com/mcp/loci-2)
HTML Embed
<a href="https://allmcps.com/mcp/loci-2"><img src="https://allmcps.com/api/badge/loci-2?style=directory" alt="Loci on AllMCPs" /></a>