cc-channel-mem

cc-channel-mem

An MCP server and background daemon that captures Discord and Telegram conversations locally to provide persistent memory for Claude Code sessions. It enables hybrid search and automatic context injection of chat history to maintain continuity across development sessions.

Category
Visit Server

README

cc-channel-mem

<p align="center"> <img src="logo.png" alt="CC ChannelMem Logo" width="480"/> </p>

Discord/Telegram 서버 채널의 대화를 Claude Code 세션과 독립적으로 로컬에 영구 저장하고, 다음 Claude Code 세션 시작 시 관련 메모리를 자동 주입하는 MCP 서버 + 백그라운드 데몬.

핵심 원칙

  • 수신 즉시 저장 — 세션 종료 이벤트에 의존하지 않음. 데몬이 살아있으면 무조건 저장.
  • 무손실 저장 — AI 판단 없이 모든 메시지를 원본 그대로 저장.
  • 봇 B 전용 — 서버 채널 메시지 저장만. 응답 없음.

설치

npm install -g cc-channel-mem
# 또는 로컬 경로로 직접 사용

빠른 시작

1. 봇 설정

cc-channel-mem setup

Discord Bot Token, Telegram Bot Token 입력 → ~/.cc-channel-mem/.env 생성

Discord 봇 설정 시 Developer Portal에서 반드시 활성화:

  • Message Content Intent

2. 데몬 시작

cc-channel-mem start
cc-channel-mem status

3. MCP 서버 등록

claude mcp add cc-channel-mem -- node /path/to/cc-channel-mem/src/mcp/index.js

4. SessionStart Hook 등록 (선택, 자동 메모리 주입)

~/.claude/settings.json 에 추가:

{
  "hooks": {
    "SessionStart": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "/path/to/cc-channel-mem/hooks/session-start.sh"
      }]
    }],
    "PreCompact": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "/path/to/cc-channel-mem/hooks/pre-compact.sh"
      }]
    }]
  }
}

CLI 명령

cc-channel-mem start    데몬 백그라운드 실행
cc-channel-mem stop     데몬 종료
cc-channel-mem status   실행 여부 + 저장된 메시지 수 + 마지막 수신 시각
cc-channel-mem setup    .env 파일 대화형 생성
cc-channel-mem logs     오늘 일일 로그 출력

MCP 도구

도구 설명
mem_search(query, limit?) 하이브리드 검색 (FTS5 + 벡터)
mem_read(date?, platform?) 일일 로그 읽기
mem_status() 데몬 상태 + 통계
mem_inject(query?) SessionStart 컨텍스트 주입용 요약

데이터 위치

~/.cc-channel-mem/
├── .env              봇 토큰 (chmod 600)
├── MEMORY.md         장기 큐레이션 메모리
├── memory/
│   └── YYYY-MM-DD.md 일일 로그
├── main.sqlite       FTS5 + 벡터 인덱스
└── daemon.pid        데몬 PID

메모리 포맷

## HH:MM [Discord — #dev-channel] @Alex
메시지 원본 내용
S @Alex: 요약 (50자)

검색 아키텍처

쿼리
 ├── FTS5 BM25 키워드 검색 (40%)
 └── 벡터 코사인 유사도 (60%)
      ├── Ollama nomic-embed-text (로컬, 우선)
      └── Voyage-3 via Anthropic SDK (폴백)

환경 변수 (.env)

DISCORD_BOT_TOKEN=
DISCORD_ALLOWED_GUILD_IDS=      # 빈 값 = 전체 서버 허용
DISCORD_ALLOWED_CHANNEL_IDS=    # 빈 값 = 허용 서버 전체 채널
TELEGRAM_BOT_TOKEN=
TELEGRAM_ALLOWED_CHAT_IDS=      # 빈 값 = 전체 허용
ANTHROPIC_API_KEY=               # curator.js Claude 큐레이션 (선택)

기술 스택

  • Node.js 20+, discord.js v14, node-telegram-bot-api
  • better-sqlite3 + FTS5, chokidar
  • @modelcontextprotocol/sdk

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured