LoreRoom logo

LoreRoom

by fenghaochang

Stores encrypted Telegram bot conversations locally and exposes recent-context and full-text history searches through MCP.

Install LoreRoom

Run the project’s own setup commands, in order.

Setup steps from the project

fenghaochang/LoreRoom installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/fenghaochang/LoreRoom.git && cd LoreRoom
    
  2. 2. Install
    npm install
    
  3. 3. Install
    npm run build
    
  4. 4. Configure
    node dist/cli.js init        # creates config.json + a fresh encryption key, prints the next steps
    
  5. 5. Configure
    node dist/patch-plugin.js    # patches the Telegram plugin to capture in + out
    
  6. 6. Add to Claude Code
    claude mcp add --scope user loreroom -- "$(command -v node)" "$PWD/dist/mcp-server.js"
    

Overview

fenghaochang/LoreRoom MCP server adds encrypted, local memory to a Claude Code bot using the official Telegram plugin. A patch captures inbound and outbound messages into a spool file, while the MCP server ingests them into a SQLCipher-encrypted SQLite database with FTS5 search. Use it when Telegram conversations must survive restarts, crashes, busy sessions, or missing bot replies. It is specifically designed for Claude Code with the official Telegram plugin, not for general Telegram bot applications.

Use cases

  • Recall earlier Telegram bot conversations after a Claude Code restart
  • Search CJK or multilingual Telegram history by keyword
  • Preserve inbound messages received while Claude is busy
  • Review recent messages with timestamps and sender information

Key features

  • Captures inbound and outbound Telegram messages
  • Encrypts the SQLite database with SQLCipher
  • Searches history with FTS5 trigram indexing
  • Provides recent-context and keyword-search MCP tools
  • Uses a spool to retain messages before database ingestion
  • Supports chat and message capture filters

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.

15/15 checks healthy over the last 112d

Adoption & maintenance

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

GitHub stars2Stargazers on the source repository.
Last commit5mo agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How LoreRoom works

What fenghaochang/LoreRoom MCP server does

fenghaochang/LoreRoom MCP server records both directions of a conversation between a user and a Claude Code Telegram bot. It stores the messages in a locally managed SQLite database protected with SQLCipher whole-file encryption, then exposes the history to Claude through MCP tools.

The capture includes incoming Telegram messages and outgoing bot replies. This preserves messages that may never appear in a hook or transcript, including messages delivered while Claude is busy or unavailable. The stored results include message text, sender, role, chat ID, and timestamp.

How it works

The project modifies the official Claude Code Telegram plugin at its inbound and outbound message handling points. A small helper writes captured events to a JSONL spool in the plugin’s Telegram state directory. An ingester drains that spool into the encrypted database and removes processed entries.

The MCP server drains the spool when it starts, every 20 seconds, and before a query. It can also be run separately through the project CLI for one-time or continuous ingestion. FTS5 trigram indexing supports full-text searches, including CJK text; short search terms use a LIKE fallback.

The plugin patch is idempotent, so running the patch command again does not add duplicate changes. Updating the Telegram plugin can overwrite the patch, requiring the patch command to be run again.

Setup and configuration

fenghaochang/LoreRoom requires Node.js 20 or newer, Claude Code, and an already working Claude Code session using the official Telegram plugin. Installation involves cloning the repository, installing dependencies, building the project, initializing its configuration, patching the plugin, and registering the MCP server with Claude Code.

Initialization creates config.json and an encryption key. The configuration can set the database path, encryption key, spool path, and optional chat or message filters. The default database is data/memory.sqlite, while the default spool is under ~/.claude/channels/telegram/. The key is a 32-byte value represented as 64 hexadecimal characters and should not be committed or logged.

The database and configuration remain inside the project directory by default and are git-ignored. The spool is plaintext while waiting to be ingested, but it is kept in the plugin state directory with restricted permissions and removed after processing.

Tools and capabilities

The MCP interface provides two tools:

  • get_recent_context({ hours, chat_id? }) returns messages from the last specified number of hours, optionally limited to one chat.
  • search_tg_history({ keyword, chat_id? }) searches the complete captured history by keyword, with an optional chat filter.

Both tools return timestamps, senders, roles, chat IDs, and message text. A Claude session can call them when a user asks about an earlier Telegram exchange; users do not need to invoke the tools manually.

Limitations and notes

fenghaochang/LoreRoom only supports Claude Code with the official Telegram plugin. It is not a general Telegram bot framework and does not manage the Telegram bot token. A bot session must be running for normal capture and ingestion; messages received while the session is down are handled when the plugin reconnects and fetches them.

The native encrypted-SQLite module is tied to the Node.js ABI. If the Node version used during initialization changes, dependencies must be rebuilt and the MCP server re-registered. Reapply the plugin patch after Telegram plugin updates. Losing the encryption key makes the encrypted database unreadable.

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 LoreRoom

fenghaochang/LoreRoom is an MCP server that connects Claude Code’s official Telegram plugin to an encrypted local SQLite memory store. It captures inbound and outbound bot messages, then provides get_recent_context for recent messages and search_tg_history for full-text history searches, including CJK-friendly matching.

Install it by cloning the repository, running npm install and npm run build, initializing the configuration, patching the Telegram plugin, and registering dist/mcp-server.js with Claude Code. Restart the Claude Code Telegram session afterward so the patched plugin begins capturing messages.

The documented setup targets Claude Code with its official Telegram plugin, not Cursor.

It searches captured messages with the search_tg_history MCP tool. FTS5 trigram indexing handles full-text searches and CJK text, while short keywords use a LIKE fallback; an optional chat_id limits results to one conversation.

Messages are written to a spool at the plugin’s capture point and ingested later. Messages received while Claude is busy, crashed, or not replying can therefore be retained, while messages received while the bot session is stopped are processed when it restarts and fetches them.

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 PreviewLoreRoom AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/fenghaochang-loreroom?style=directory)](https://allmcps.com/mcp/fenghaochang-loreroom)
HTML Embed
<a href="https://allmcps.com/mcp/fenghaochang-loreroom"><img src="https://allmcps.com/api/badge/fenghaochang-loreroom?style=directory" alt="LoreRoom on AllMCPs" /></a>