Skip to main content
Glama

lore

License: MIT TypeScript lore MCP server

Semantic search across your Claude Code and OpenAI Codex CLI conversations. Find anything you've ever discussed -- across all projects, all sessions, any branch, any agent.

lore MCP server

Features

  • Hybrid search (vector + keyword) Combines multilingual-e5-small embeddings with FTS5/BM25 via Reciprocal Rank Fusion. Finds results by meaning and exact terms.

  • Multi-agent: Claude Code + Codex CLI Indexes both ~/.claude/projects/ (Claude Code) and ~/.codex/sessions/ (OpenAI Codex CLI) in the same DB. Codex sessions are grouped by cwd from session_meta, surfaced as codex-<path> virtual projects so you can search them together or filter to one agent.

  • Fully local, zero API keys Everything runs on your machine. ONNX Runtime for embedding, sqlite-vec for storage. No data leaves your device.

  • Auto-index on session end A SessionEnd hook automatically indexes all new sessions in the background. No manual triggers needed.

  • Background indexing Manual index triggers return instantly. Monitor progress while you keep working. Search what's already indexed while the rest catches up.

  • Opt-out by default All projects are indexed automatically. Exclude the ones you don't want. No registration needed.

  • Conversation-aware chunking Splits by logical turns (user question + full assistant response chain), not arbitrary token windows. Handles tool-use chains, thinking blocks, and multi-step interactions correctly.

  • 100+ languages Korean, Japanese, Chinese, English, and 90+ more. CJK-aware token estimation for accurate chunking.

Related MCP server: Semantic Search MCP Server

Quick Start

Add to Claude Code

# No install needed — always runs latest version
claude mcp add -s user lore -- npx getlore

# Or for a single project only
claude mcp add -s project lore -- npx getlore

Add to OpenAI Codex CLI

# No install needed
codex mcp add lore -- npx getlore
npm install -g getlore

# Then register with your tool:
claude mcp add -s user lore -- getlore   # Claude Code
codex mcp add lore -- getlore            # Codex CLI

# Manage your install:
getlore --version   # Check installed version
getlore update      # Update to latest

Usage

Once connected, the AI can use lore's tools directly:

You: "What did we discuss about auth refactoring last week?"

Claude: [calls lore search] Found 3 relevant conversations...
        In your "my-webapp" project on March 15, you decided to...

First time setup:

  1. Index -- index() scans all projects automatically, runs in background

  2. Search -- ask anything about past conversations

  3. Exclude (optional) -- hide noisy projects you don't care about

Tools

Tool

Purpose

manage_projects

Exclude/include projects from indexing (opt-out model)

index

Start background indexing. All non-excluded projects. Modes: incremental (default), rebuild, cancel

status

Check indexing progress, ETA, skip reasons, DB health

search

Semantic + keyword search across conversations

get_context

Expand search results with surrounding conversation

list_sessions

Browse indexed sessions by project

Why This Exists

Claude Code stores every conversation as a JSONL transcript in ~/.claude/projects/, and OpenAI Codex CLI stores its rollouts in ~/.codex/sessions/YYYY/MM/DD/. After a few weeks, you have hundreds of sessions across dozens of projects, often spread across both agents -- discussions about architecture decisions, debugging sessions, code reviews, and design explorations.

But there's no way to search through them. You can't ask "what approach did we take for the auth middleware?" or "which project had that database migration discussion?"

Existing tools either require cloud APIs, spawn zombie processes, or treat conversations as generic documents. lore is purpose-built for AI coding sessions: it understands turn boundaries, tool-use chains, and thinking blocks, and parses both Claude Code and Codex JSONL formats natively. It runs entirely locally with zero dependencies beyond Node.js.

How It Works

~/.claude/projects/*/*.jsonl     ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
        \                                       /
         \                                     /
          JSONL Parser (Claude Code + Codex formats, skips noise)
                              |
          Turn-pair Chunker (groups by logical conversation turns)
                              |
          Transformers.js (multilingual-e5-small, INT8 quantized, 384d)
                              |
          sqlite-vec + FTS5 (hybrid vector + keyword storage)
                              |
          Reciprocal Rank Fusion (combines both signals for ranking)

Codex sessions are grouped by cwd extracted from each file's session_meta line and surfaced as codex-<path> virtual projects in the index.

Storage: Single SQLite file at ~/.lore/lore.db with WAL mode for concurrent reads.

Config: Project exclusions stored in ~/.lore/config.json.

Environment Variables

Variable

Default

Description

LORE_DIR

~/.lore

Data directory

LORE_DB

~/.lore/lore.db

Database path

CLAUDE_PROJECTS_DIR

~/.claude/projects

Claude Code transcripts location

CODEX_SESSIONS_DIR

~/.codex/sessions

OpenAI Codex CLI rollouts location

Measured on Apple Silicon (M-series):

Metric

Value

Search latency

20-30ms

Index speed

~10 sessions/sec

First search (cold model load)

~5s

DB size

~0.1MB per 10 sessions

Model size (downloaded once)

~112MB

"No sessions found"

Run manage_projects with action list to see available projects. All are indexed by default unless excluded.

Stale lock file

If indexing was interrupted, the lock file auto-cleans on next run (PID-based detection).

DB corruption

Delete ~/.lore/lore.db and re-index. Your source data (~/.claude/projects/) is never modified.

Development

git clone https://github.com/hyunjae-labs/lore.git
cd lore
npm install
npm run build
npm test          # 135 tests

Tech Stack

License

MIT

Available Tools

6 tools
get_contextA

Retrieve more conversation context around a specific search result. Use ONLY after calling search, when you need to see what was discussed before or after a result.

ParametersJSON Schema
NameRequiredDescriptionDefault
chunk_idYes
directionNo
countNo

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool retrieves context, it lacks details on permissions, rate limits, error handling, or what the output looks like (e.g., format, size limits). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and front-loaded, with two sentences that directly state the purpose and usage guidelines without any wasted words. Every sentence earns its place by providing essential information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description covers purpose and usage well but is incomplete. It lacks details on parameters, behavioral traits, and output format, which are necessary for full understanding. The description is adequate as a minimum but has clear gaps in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It only vaguely references 'a specific search result' (implied to relate to 'chunk_id') and 'before or after a result' (implied to relate to 'direction'), but provides no specifics on parameter meanings, formats, or constraints. This fails to adequately explain the three parameters beyond basic schema hints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieve more conversation context') and resource ('around a specific search result'), distinguishing it from siblings like 'search' (which finds results) or 'list_sessions' (which lists sessions). It explicitly defines the tool's scope as fetching contextual conversation snippets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('Use ONLY after calling search, when you need to see what was discussed before or after a result'), including a prerequisite (must call 'search' first) and a clear use-case (viewing surrounding context). It effectively differentiates from alternatives by specifying its post-search role.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

indexA

Update the search index with recent Claude Code sessions. Call if search returns stale results or the user asks to refresh the index. Modes: 'incremental' (default, only new/changed), 'full' (delete all and rebuild from scratch), 'cancel' (stop running index).

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNo
projectNo
confirmNo

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by explaining the three modes and their behaviors ('incremental' for new/changed, 'full' for delete and rebuild, 'cancel' to stop). It could mention performance impact or permissions but covers core operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with zero waste: first states purpose, second gives usage guidelines, third details modes. Each sentence earns its place, and the structure is front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, no annotations, and no output schema, the description is quite complete—covering purpose, usage, and key parameter semantics. It could note that 'full' mode might be resource-intensive or that 'confirm' is for safety, but it's largely adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains the 'mode' parameter's three values and their meanings, which adds crucial semantics beyond the bare enum in the schema. It doesn't cover 'project' or 'confirm', but the mode explanation is substantial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Update the search index') and resources ('recent Claude Code sessions'), distinguishing it from sibling tools like 'search' or 'list_sessions' which query rather than update the index.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance is provided on when to use this tool: 'if search returns stale results or the user asks to refresh the index.' This directly addresses the tool's purpose relative to alternatives like 'search'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_sessionsB

List all indexed Claude Code sessions. Use when the user wants to browse conversation history or find sessions by project/date.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
limitNo
sortNo

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that sessions are 'indexed' and implies filtering capabilities ('by project/date'), but lacks details on permissions, rate limits, pagination, or what 'indexed' entails. For a list tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, consisting of two sentences that efficiently convey the tool's purpose and usage. The first sentence states what it does, and the second provides context for when to use it, with no wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (3 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral aspects like permissions or rate limits, and parameter semantics are underspecified. Without an output schema, it also doesn't describe return values (e.g., session format). For a tool with moderate complexity and no structured support, the description should provide more comprehensive guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 3 parameters with 0% description coverage, meaning no parameter details are documented in the schema. The description only vaguely references 'project/date' for filtering, which partially covers the 'project' parameter but ignores 'limit' and 'sort'. It doesn't explain what 'limit' controls (e.g., number of results) or the meaning of 'sort' enum values ('recent', 'oldest'), failing to compensate for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all indexed Claude Code sessions.' It specifies the verb ('List') and resource ('indexed Claude Code sessions'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate this tool from sibling tools like 'search' or 'get_context', which might also involve session retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage guidance: 'Use when the user wants to browse conversation history or find sessions by project/date.' This gives context for when to invoke the tool, such as for browsing or filtering by project/date. It doesn't explicitly state when not to use it or name alternatives like 'search', but the context is sufficient for basic decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

manage_projectsA

Manage which projects are registered for indexing. Use 'list' to see all projects on disk and their registration status. Use 'add' to register a project for indexing. Use 'remove' to unregister. Projects must be registered before they can be indexed.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes
projectNo

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the three discrete actions and the registration requirement, but doesn't mention permissions needed, whether changes are reversible, rate limits, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with three sentences: an overview statement, specific action explanations, and a prerequisite. Every sentence adds value with no redundant information, making it easy to parse and understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter tool with no annotations and no output schema, the description provides good purpose and usage guidance but lacks details about response format, error conditions, and the exact format of the 'project' parameter. It's adequate but has clear gaps in behavioral transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate. It explains the meaning of the 'action' parameter values ('list', 'add', 'remove') and implies the 'project' parameter is used with 'add' and 'remove' actions. However, it doesn't specify what format the 'project' parameter expects (path, name, ID).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('manage', 'list', 'add', 'remove') and resources ('projects', 'indexing'), distinguishing it from sibling tools like 'index' or 'search'. It explains that this tool handles registration status for indexing, not the indexing process itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use each action ('list' to see status, 'add' to register, 'remove' to unregister) and includes a prerequisite statement ('Projects must be registered before they can be indexed') that helps differentiate from the 'index' sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

statusA

Check the health and progress of lore indexing. Shows indexing status, session counts, DB size. Use this to monitor indexing progress after calling index.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool does (checking health/progress and showing specific metrics) but lacks details on permissions needed, rate limits, or what happens if indexing isn't running. It doesn't contradict annotations, but could be more informative.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that are front-loaded: the first states the purpose and what it shows, the second provides usage guidance. Every sentence adds value without redundancy or waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is reasonably complete. It explains the tool's purpose, what it returns, and when to use it. However, without an output schema, it could benefit from more detail on return format or error conditions, but this is minor for a status-check tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter information, but it implicitly confirms no parameters are needed by not mentioning any. This meets the baseline for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('check', 'shows') and resources ('health and progress of lore indexing', 'indexing status, session counts, DB size'). It distinguishes from siblings by focusing on monitoring rather than performing operations like 'index' or 'search'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage ('Use this to monitor indexing progress after calling index'), indicating when to use it in relation to the 'index' sibling tool. However, it doesn't explicitly state when not to use it or mention alternatives among other siblings like 'list_sessions' or 'get_context'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updates
    • First observedget_context
    • First observedindex
    • First observedlist_sessions
    • First observedmanage_projects
    • First observedsearch
    • First observedstatus

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: get_context retrieves conversation context around search results, index updates the search index, list_sessions lists indexed sessions, manage_projects handles project registration, search performs searches, and status checks indexing health. The descriptions explicitly differentiate their use cases, preventing agent confusion.

Naming Consistency4/5

Tool names follow a consistent snake_case pattern and use clear verbs like get, index, list, manage, search, and status. However, 'status' deviates slightly as a noun rather than a verb (e.g., 'check_status' would be more consistent), but overall the naming is predictable and readable.

Tool Count5/5

With 6 tools, this server is well-scoped for its purpose of managing and searching conversation history. Each tool serves a specific function in the indexing and retrieval workflow, from setup (manage_projects, index) to query (search, get_context) and monitoring (list_sessions, status), with no unnecessary bloat.

Completeness5/5

The tool set provides complete coverage for the domain of indexing and searching Claude Code sessions. It includes project management (manage_projects), indexing operations (index, status), session listing (list_sessions), search functionality (search), and context retrieval (get_context), ensuring agents can handle the full lifecycle without gaps.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables comprehensive search and analysis of Claude Code conversation history using full-text search, optional semantic vector search, and conversation management tools. Provides fast SQLite-based indexing with role-based filtering, project organization, and hybrid search capabilities combining keyword and semantic matching.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides hybrid semantic and keyword code search for Claude Code using BM25 and vector retrieval. It enables indexing and searching local codebases with language-aware chunking and local embeddings.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables local semantic search over documents and code for Claude Code and Claude Desktop, running entirely offline with local embeddings and vector storage.
    12
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides Claude Code with local semantic search and indexing of your codebase using AST-aware chunking and hybrid search, enabling deep code understanding without sending data to the cloud.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hyunjae-labs/lore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server