lorexplore
Indexes local Git history, commits, renames, Lore trailers, and working-tree changes, and can install hooks and draft commit trailers.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lorexplore (lxp)
Local-first codebase intelligence, git archaeology, temporal co-change coupling, and progressive-disclosure MCP/CLI engine.
Single SQLite WAL + FTS5 index per repository. Zero cloud services, zero LLM API calls required for indexing or retrieval, strict token budgets, and real-time dirty working-tree overlay.
Status: Alpha (
0.1.0a*). CLI flags and MCP tool schemas may evolve before0.1.0.
Architecture
Static AST search alone misses why code exists and which files silently break together. lorexplore joins four local layers into one queryable SQLite WAL index:
flowchart LR
subgraph Inputs["Repository Inputs (Local Only)"]
SRC["Source Files\n(Python AST + 6 Tree-sitter Grammars)"]
GIT["Git History\n(Non-Squashed Commits, Renames, Lore Trailers)"]
DOCS["Plans, ADRs & Runbooks\n(Bi-Temporal Supersession Chains)"]
DIRTY["Dirty Working Tree\n(Uncommitted Edits Overlay)"]
end
subgraph Engine["SQLite WAL + FTS5 Engine (<= 64 MiB Cache, 0-mmap)"]
AST["Symbols & Static Call Graph\n(EXTRACTED vs HEURISTIC)"]
PPR["Personalized PageRank\n(Query & Focus-Seeded)"]
CO["Temporal Co-Change Graph\n(90d Decay, <= 30-File Filter)"]
FTS["Acronym-Safe FTS5\n(BM25 + RRF Fusion)"]
end
subgraph Surface["Progressive-Disclosure Interface"]
CLI["CLI: lorexplore / lxp\n(Markdown & --json)"]
MCP["MCP Server (MIT mcp SDK)\n(stdio & Localhost Streamable HTTP)"]
end
SRC --> AST
SRC --> FTS
AST --> PPR
GIT --> CO
GIT --> FTS
DOCS --> FTS
DIRTY -. "Live Overlay" .-> FTS
DIRTY -. "Live Overlay" .-> PPR
PPR --> CLI
CO --> CLI
FTS --> CLI
PPR --> MCP
CO --> MCP
FTS --> MCPStructural AST & Call Graph: Python stdlib
ast(with error-toleranttree-sitter-pythonfallback for broken dirty files) + offline official MIT Tree-sitter grammars for TypeScript/TSX, JavaScript, Go, Rust, and Bash.Git Archaeology & Temporal Coupling: Non-squashed commit mining, Lore commit trailers (
Plan:,Directive:,Rejected:),git mvrename lineage, symbol-level diff tracking (-U0), and 90-day time-decayed co-change coupling (excluding bulk>30-file sweeps).Bi-Temporal Docs & ADRs: Indexes Plans/ADRs/runbooks, resolves
Supersedes:chains, and flags drifted docs whose referenced files were deleted or heavily churned.FTS5 + Personalized PageRank: Acronym-safe BM25 + Reciprocal Rank Fusion (RRF) with live dirty working-tree overlay.
Related MCP server: engram-serve
Progressive-Disclosure Workflow
Instead of dumping full files into an LLM context window, agents orient in bounded hops and check blast radius before editing:
sequenceDiagram
participant Agent as Coding Agent / Dev
participant LXP as lorexplore (CLI / MCP)
Agent->>LXP: 1. repo_map(focus_paths, max_tokens=1024)
LXP-->>Agent: PageRank-ranked files + top signatures
Agent->>LXP: 2. locate(query="token_bucket", scope="all")
LXP-->>Agent: RRF hits across code, commits & ADRs (with cursor)
Agent->>LXP: 3. read_symbol(targets, mode="skeleton")
LXP-->>Agent: Compact AST signatures (~70% token savings)
Agent->>LXP: 4. explain_why(target="src/auth/policy.py")
LXP-->>Agent: Lore directives, fix/revert history, rename lineage & ADRs
Agent->>LXP: 5. co_change_impact(target="working_tree")
LXP-->>Agent: Static callers + implicit temporal co-change companions
Note over Agent,LXP: Targeted edit -> lxp draft-lore -> commit with Lore trailersInstall
# Run directly via uvx (alpha pre-release)
uvx --prerelease=allow lorexplore --help
# Install into a project environment (alpha pre-release)
uv pip install --prerelease=allow lorexplore
# Local development install
uv sync --group devQuickstart
# 1. Build local index (~/.cache/lorexplore/<repo_hash>.db)
lxp sync
# 2. Keep index fresh automatically on commit, merge, and checkout
lxp install-hooks
# 3. Progressive-disclosure queries (add --json for machine output)
lxp map --focus src/auth --max-tokens 1024
lxp locate "token_bucket"
lxp read src/auth/policy.py --mode skeleton
lxp trace src/auth/policy.py --direction callers
lxp why src/auth/policy.py
lxp impact working_tree
lxp history "TOKEN_TTL" --fixes-only
lxp stale
lxp timeline --target src/auth --since 30d
lxp draft-loreMCP Server
Runs on the official MIT mcp SDK (MCPServer). Defaults to zero-socket stdio; --read-only opens SQLite read-only and omits record_decision.
# Recommended for IDE / agent clients (stdio, zero sockets)
lxp --repo /path/to/repo --read-only serve
# Optional localhost-only stateless Streamable HTTP (DNS-rebinding Host/Origin guard)
lxp --repo /path/to/repo --read-only serve --transport streamable-http --host 127.0.0.1 --port 8770Example MCP client configuration:
{
"mcpServers": {
"lorexplore": {
"command": "lxp",
"args": ["--repo", "/path/to/repo", "--read-only", "serve"]
}
}
}Tool Surface
Tool | Purpose | Read-Only |
| Personalized PageRank file/signature skeleton map | Yes |
| RRF search across symbols, commits, and ADRs | Yes |
| Batch AST skeletons or exact line/symbol bodies | Yes |
| N-hop static callers, callees, imports, and tests | Yes |
| Commits, Lore trailers, rename lineage, ADRs, and co-changes | Yes |
| Pre-edit blast radius (static callers + temporal co-change) | Yes |
| FTS5 search over commits, Lore trailers, and ADRs | Yes |
| Flags active docs with deleted or heavily churned file refs | Yes |
| Chronological SHA-anchored feed for onboarding or synthesis | Yes |
| Records a bi-temporal decision and emits Lore trailers | No |
Lore Commit Trailers
lorexplore indexes structured commit trailers automatically:
Plan: Plan 02
Directive: Enforce token_bucket bounds; never re-enable legacy fixed fallback.
Rejected: Unbounded burst quota.
Verified-By: pytest tests/test_policy.pyGenerate a pre-commit trailer draft and missed-companion check from your staged diff with lxp draft-lore.
Quality & Security Gates
Every commit is verified across Linux, macOS, and Windows (Python 3.11–3.14):
Static & Complexity:
ruff(lint, format, McCabeC901 <= 12, branches<= 12, statements<= 50) +complexipy(Sonar cognitive complexity<= 15).Type Safety:
mypy --strict+ Astralty.Security & Compliance:
banditSAST,pip-auditCVE scan, and automated runtime permissive license allowlist (MIT,Apache-2.0,BSD,ISC,PSF-2.0).Testing & Performance:
>= 90%combined line and branch coverage (pytest --cov-branch), Hypothesis property fuzzing,<= 50 msp95 query latency,<= 150 MBpeak RSS, and< 50 mslazy CLI cold start.Releases: Dynamic
hatch-vcsversioning with automated PyPI OIDC Trusted Publishing and CycloneDX SBOM generation on merges tomain.
Optional Extras
lorexplore[polyglot]: Opt-intree-sitter-language-packfor long-tail languages beyond the 6 offline core grammars.evaldependency group: Offline agentic evaluation & Pareto prompt optimization (Inspect AI,DSPy+GEPA, local SQLiteMLflow).
License
Licensed under Apache-2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Shared knowledge for teams and AI agents: search, brief, and record decisions with provenance.
The context platform for AI agents: code search, team decisions, and grounded project context.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents and IDEs to query a local structural code graph and retrieve focused, token-bounded context on code entities, Git relationships, callers/callees, impact, paths, and recorded mistakes for more efficient sessions.24 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to retrieve bounded, focused context from a local structural code graph, including source entities, Git relationships, and recorded project memory. It supports exploring structure, inspecting callers, callees, and impact, and carrying prior mistakes into later sessions without reading full files.24 npmMIT
- AlicenseBqualityBmaintenanceEnables coding agents to retrieve the most relevant code for a task within a hard token budget by fusing code graph, BM25, local embeddings, and git history, and to navigate symbols, callers, impact, and related files. It runs locally over MCP with no API keys and keeps its index fresh.10MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to search and navigate indexed codebases through lexical, semantic, and hybrid queries, with tools for symbols, call graphs, outlines, spans, impact analysis, and recall.9Apache 2.0