mcpField
C
ChatCrystal

ChatCrystal

ローカル
zengliangyi.github.ioメモリ・ナレッジ615 日前に更新

ChatCrystal について

ChatCrystal は、Claude Code、Cursor、Codex CLI などの AI コーディングツールの会話を収集し、LLM で検索可能な構造化ノートにまとめるローカルファーストの MCP サーバーです。個人のナレッジベースを構築したい開発者向けで、ローカルまたはセルフホストのクラウドインスタンスで動作します。

主な機能

  1. 01複数の AI コーディングツールの会話をインポート
  2. 02LLM による構造化ノートへの要約
  3. 03ナレッジベースのセマンティック検索
  4. 04ノート間の関連と タグによる閲覧
  5. 05ローカルおよび Docker によるクラウド構成

活用シーン

  1. 01コーディング中に過去の解決策を検索
  2. 02後の作業向けにプロジェクトの記憶を保存
  3. 03複数デバイスの会話を1つのクラウドインスタンスに集約

MCP 対応

ChatCrystal は crystal mcp で stdio 方式の MCP サーバーを起動し、Claude Code などのクライアントに search_knowledge、get_note、list_notes、get_relations、recall_for_task、validate_task_memory、write_task_memory などのツールを提供します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"zengliangyi-chatcrystal": {
"command": "npx",
"args": [
"-y",
"chatcrystal"
],
"env": {
"CHATCRYSTAL_BASE_URL": "<CHATCRYSTAL_BASE_URL>",
"CHATCRYSTAL_API_TOKEN": "<CHATCRYSTAL_API_TOKEN>"
}
}
}
}
起動コマンドnpx -y chatcrystal
設定が必要な環境変数
CHATCRYSTAL_BASE_URLOptional ChatCrystal Core URL. Leave empty to use the local default at http://localhost:3721.
CHATCRYSTAL_API_TOKENシークレットOptional token for a protected ChatCrystal Cloud or remote instance.

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npmchatcrystal0.6.2

ツール

7

掲載時のツール一覧 · 5 日前に更新

パラメーター型必須説明
limitnumberいいえ結果の最大件数
querystringはい検索クエリのテキスト

詳細

ChatCrystal

ChatCrystal

AI との会話から知識を結晶化

npm GitHub License: Apache-2.0


ChatCrystal は、AI コーディングツール(Claude Code、Cursor、Codex CLI、Trae、GitHub Copilot)との会話を収集し、LLM を使って検索可能な構造化ノートにまとめ、個人用ナレッジベースを構築します。

インストール

npm install -g chatcrystal

Node.js >= 20 と LLM サービス(Ollama、OpenAI、OrcaRouter、Anthropic、Google AI、または OpenAI 互換 API)が必要です。

クイックスタート

crystal import                     # Scan and import AI conversations
crystal summarize --all            # Batch summarize into notes
crystal search "React state"       # Semantic search your knowledge

最初のコマンドを実行すると、サーバーがバックグラウンドで自動起動します。手動でのセットアップは不要です。

クラウド接続

Docker のクラウドインスタンスを使用する場合、共有トークンを一度保存します。

crystal connect https://chatcrystal.example.com --token "your-long-token"
crystal import --yes

crystal import は引き続きローカルデバイス上の履歴をスキャンして解析し、正規化した会話をクラウドインスタンスにアップロードします。クラウドサーバーがローカルのファイルシステムをスキャンすることはありません。crystal mcp は保存済みの接続情報とトークンを再利用します。

クラウド接続には HTTPS を推奨しますが、選択したデプロイ方法で HTTP を使用する場合は HTTP も利用できます。

Docker クラウドトークンを管理するには:

# Rotate when you still know the current token.
crystal --base-url https://chatcrystal.example.com token rotate "new-long-token-at-least-16-chars" --current "old-token"

# Reset stored auth from the Docker host when the token is lost.
docker compose exec chatcrystal crystal token reset --yes
docker compose exec chatcrystal cat /data/setup-code

デプロイ環境で CHATCRYSTAL_API_TOKEN が設定されている場合は、token reset を使うのではなく、その環境変数を変更してコンテナを再作成してください。

CLI コマンド

# Knowledge retrieval
crystal search <query> [--limit 10]     # Semantic search
crystal notes list [--tag X]            # Browse notes
crystal notes get <id>                  # View note detail
crystal notes relations <id>            # View note relations
crystal tags                            # List tags with counts

# Data management
crystal import [--source claude-code]   # Import conversations
crystal summarize <id>                  # Summarize one conversation
crystal summarize --all                 # Batch summarize
crystal summarize --retry-errors        # Retry failed summaries
crystal status                          # Server status and DB stats

# Configuration
crystal config get                      # View config
crystal config set llm.provider openai  # Update config
crystal config test                     # Test LLM connection

# Server management
crystal serve                           # Start server (foreground)
crystal serve -d                        # Start server (daemon)
crystal serve stop                      # Stop daemon
crystal serve status                    # Check if running

グローバルオプション: --base-url <url>(サーバーアドレス)、--token <token>(クラウド API トークン)、--json(JSON 出力を強制)、--version

出力: TTY を認識して出力します。ターミナルでは色付きの表を表示し、パイプに渡す場合は JSON を出力します。

MCP サーバー

AI コーディングツールと連携すると、コーディング中に会話履歴から知識を取得できます。

crystal mcp                             # Start MCP stdio server
Claude Code

settings.json に追加します。

{
  "mcpServers": {
    "chatcrystal": {
      "command": "crystal",
      "args": ["mcp"]
    }
  }
}
MCP ツール
ツール説明
search_knowledge関連度順の検索結果が必要な場合に、ノートを対象にセマンティック検索します
get_noteノートの内容全体(要約、結論、コードスニペット)を取得します
list_notesタグまたはタイトル/要約のキーワードで、ページ分割されたノートの要約を閲覧します
get_relations関連タイプ付きで関連ノートを取得します
recall_for_taskプロジェクトの記憶を先に読み込み、続けて必要に応じて全体の教訓を読み込む、読み取り専用のタスク記憶機能です
validate_task_memoryタスクの記憶を書き込む前にドライランで検証します。受け入れ可否、理由、警告、ノートのフィールドを返します
write_task_memory有意義な作業の後に、再利用可能なタスクの記憶を保存します

設定

実行時設定は、アクティブなデータディレクトリ内の config.json に保存されます。CLI、MCP、リポジトリ/開発用チェックアウト、npm のグローバルインストール、Electron では、デフォルトで ~/.chatcrystal/data を使用します。設定を永続化するには crystal config set を使用してください。.env は任意のローカル上書きレイヤーとしてのみ引き続き利用できます。

# LLM (ollama/openai/orcarouter/anthropic/google/azure/custom)
crystal config set llm.provider openai
crystal config set llm.model gpt-4o
crystal config set llm.apiKey sk-...

# Embedding (ollama/openai/google/azure/custom)
crystal config set embedding.provider ollama
crystal config set embedding.model nomic-embed-text

OrcaRouter は ChatCrystal に組み込まれた Base URL https://api.orcarouter.ai/v1 を使用します。llm.provider を orcarouter に設定し、API Key を指定して、Web UI で検出されたモデルを選択してください。llm.baseURL の設定は不要です。OrcaRouter API Key を取得。

データソース

以下のソースを自動的に検出してインポートします。

ソースパス
Claude Code~/.claude/projects/**/*.jsonl
Codex CLI~/.codex/sessions/**/*.jsonl
Cursorプラットフォーム固有の state.vscdb
Traeプラットフォーム固有の state.vscdb
GitHub CopilotVS Code の chatSessions/*.jsonl / *.json

Web UI とデスクトップアプリ

ChatCrystal には Web UI と Electron デスクトップアプリもあります。詳細については、GitHub リポジトリをご覧ください。

ライセンス

Apache License 2.0

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。