# fenghaochang/LoreRoom [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/fenghaochang/LoreRoom  
**GitHub Stars:** 2  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fenghaochang-loreroom

## Description
Encrypted, local memory for your Claude Code Telegram bot. Captures both sides of the conversation at the plugin source (survives restarts and crashes) and recalls it via MCP tools — whole-file SQLCipher encryption, FTS5 full-text search (CJK-friendly), never touches your bot token.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/fenghaochang/LoreRoom), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/fenghaochang/LoreRoom.git && cd LoreRoom
```

2. Install:

```sh
npm install
```

3. Install:

```sh
npm run build
```

4. Configure:

```sh
node dist/cli.js init        # creates config.json + a fresh encryption key, prints the next steps
```

5. Configure:

```sh
node dist/patch-plugin.js    # patches the Telegram plugin to capture in + out
```

6. Add to Claude Code:

```sh
claude mcp add --scope user loreroom -- "$(command -v node)" "$PWD/dist/mcp-server.js"
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/fenghaochang-loreroom/readme_

