Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ registry=https://registry.npmmirror.com
# 常用二进制镜像(本项目核心依赖)
electron-mirror=https://npmmirror.com/mirrors/electron/
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
# 使用 GitHub 官方地址:npmmirror 缺少 dmg-builder 新版本
electron_builder_binaries_mirror=https://github.com/electron-userland/electron-builder-binaries/releases/download/
better-sqlite3_binary_host_mirror=https://npmmirror.com/mirrors/better-sqlite3

# 历史项目依赖兼容:保留 hoist 行为,避免安装结构变化带来回归
Expand Down
40 changes: 40 additions & 0 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ChatLab は、チャット履歴を深く理解するためのローカル完結
- 🤖 **実データを扱える AI Agent**:10 以上の Function Calling ツールを備え、文脈に応じて動的に呼び分けながら履歴を掘り下げます。
- 📊 **多面的な可視化**:アクティブ度の推移、時間帯の傾向、メンバーランキングなどを分かりやすく確認できます。
- 🧩 **形式差分を吸収する標準化**:異なるチャットアプリのエクスポート形式を統一モデルに変換し、同じ視点で比較・分析できます。
- 🔌 **MCP Server**:Model Context Protocol を通じて、Claude Code や Cursor などの外部 AI ツールからチャット分析機能を直接呼び出せます。HTTP と Stdio の 2 つの接続方式をサポートします。

## ガイド

Expand All @@ -35,6 +36,45 @@ ChatLab は、チャット履歴を深く理解するためのローカル完結

![Preview Interface](/public/images/intro_en.png)

## MCP Server

ChatLab には MCP(Model Context Protocol)サーバーが内蔵されており、Claude Code や Cursor などの外部 AI ツールからチャット履歴の分析機能を直接呼び出せます。

**利用可能なツール(計 17 個):** `list_sessions`、`get_session_overview`、`get_members`、`get_member_stats`、`get_member_profile`、`get_member_name_history`、`get_interaction_frequency`、`search_messages`、`get_recent_messages`、`get_date_range_messages`、`get_message_context`、`get_conversation_between`、`export_messages`、`get_time_stats`、`get_word_frequency`、`execute_sql`、`get_schema`

### HTTP モード

**設定 → MCP Server** からサーバーを起動し、SSE エンドポイントでクライアントを接続します:

```json
{
"mcpServers": {
"chatlab": {
"url": "http://127.0.0.1:3000/sse"
}
}
}
```

REST API も利用できます:`http://127.0.0.1:{port}/api/v1/`

### Stdio モード

ChatLab 側での起動操作は不要です。**設定 → MCP Server → 外部ツール設定情報** から設定スニペットをコピーし、クライアントの設定ファイル(例:`claude_desktop_config.json`)に貼り付けます:

```json
{
"mcpServers": {
"chatlab": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js", "--db-dir", "/path/to/databases"]
}
}
}
```

プロセスのライフサイクルはクライアントが自動管理します。

## システムアーキテクチャ

### 設計原則(Architecture Principles)
Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Currently supported: **WhatsApp, LINE, WeChat, QQ, Discord, Instagram, and Teleg
- 🤖 **AI that can actually operate on data**: Agent + Function Calling workflows can search, summarize, and analyze chat records with context.
- 📊 **Insight-rich visual views**: See trends, time patterns, interaction frequency, rankings, and more in one place.
- 🧩 **Cross-platform normalization**: Different export formats are mapped into a unified model so you can analyze them consistently.
- 🔌 **MCP Server**: Expose chat analysis capabilities to Claude Code, Cursor, and other external AI tools via the Model Context Protocol — over HTTP/SSE or stdio.

## Usage Guides

Expand All @@ -35,6 +36,45 @@ For more previews, please visit the official website: [chatlab.fun](https://chat

![Preview Interface](/public/images/intro_en.png)

## MCP Server

ChatLab includes a built-in MCP (Model Context Protocol) server that lets external AI tools like Claude Code and Cursor directly query your chat data.

**Available tools (17 total):** `list_sessions`, `get_session_overview`, `get_members`, `get_member_stats`, `get_member_profile`, `get_member_name_history`, `get_interaction_frequency`, `search_messages`, `get_recent_messages`, `get_date_range_messages`, `get_message_context`, `get_conversation_between`, `export_messages`, `get_time_stats`, `get_word_frequency`, `execute_sql`, `get_schema`

### HTTP Mode

Start the server from **Settings → MCP Server**, then connect your client using the SSE endpoint:

```json
{
"mcpServers": {
"chatlab": {
"url": "http://127.0.0.1:3000/sse"
}
}
}
```

A REST API is also available at `http://127.0.0.1:{port}/api/v1/`.

### Stdio Mode

No need to start anything in ChatLab. Copy the config snippet from **Settings → MCP Server → External Tool Configuration** and paste it into your client (e.g. `claude_desktop_config.json`):

```json
{
"mcpServers": {
"chatlab": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js", "--db-dir", "/path/to/databases"]
}
}
}
```

The client manages the process lifecycle automatically.

## System Architecture

### Architecture Principles
Expand Down
40 changes: 40 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ChatLab 是一个专注于社交记录分析的本地化应用。通过 AI Agent
- 🤖 **智能 AI Agent**:集成 10+ Function Calling 工具,支持动态调度,深度挖掘聊天记录中的更多有趣。
- 📊 **多维数据可视化**:提供活跃度趋势、时间规律分布、成员排行等多个维度的直观分析图表。
- 🧩 **格式标准化**:通过强大的数据抽象层,抹平不同聊天软件的格式差异,即使是再小众的聊天软件,也能分析。
- 🔌 **MCP Server**:通过 Model Context Protocol 将聊天分析能力开放给 Claude Code、Cursor 等外部 AI 工具,支持 HTTP 和 Stdio 两种接入方式。

## 使用指南

Expand All @@ -35,6 +36,45 @@ ChatLab 是一个专注于社交记录分析的本地化应用。通过 AI Agent

![预览界面](/public/images/intro_zh.png)

## MCP Server

ChatLab 内置了一个 MCP(Model Context Protocol)服务,可以让 Claude Code、Cursor 等外部 AI 工具直接调用聊天记录的分析能力。

**可用工具(共 17 个):** `list_sessions`、`get_session_overview`、`get_members`、`get_member_stats`、`get_member_profile`、`get_member_name_history`、`get_interaction_frequency`、`search_messages`、`get_recent_messages`、`get_date_range_messages`、`get_message_context`、`get_conversation_between`、`export_messages`、`get_time_stats`、`get_word_frequency`、`execute_sql`、`get_schema`

### HTTP 模式

在 **设置 → MCP Server** 中启动服务,然后用 SSE 端点接入客户端:

```json
{
"mcpServers": {
"chatlab": {
"url": "http://127.0.0.1:3000/sse"
}
}
}
```

同时提供 REST API:`http://127.0.0.1:{port}/api/v1/`

### Stdio 模式

无需在 ChatLab 中手动启动。在 **设置 → MCP Server → 外部工具配置信息** 中复制配置片段,粘贴到客户端配置文件(如 `claude_desktop_config.json`):

```json
{
"mcpServers": {
"chatlab": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js", "--db-dir", "/path/to/databases"]
}
}
}
```

客户端会自动管理进程的生命周期。

## 系统架构

### 架构原则(Architecture Principles)
Expand Down
40 changes: 40 additions & 0 deletions README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ChatLab 是一款專注於社交記錄分析的本機應用。結合 AI Agent
- 🤖 **可實際操作資料的 AI Agent**:內建 10+ 個 Function Calling 工具,可依任務動態調度,深入挖掘聊天脈絡與重點。
- 📊 **多維度視覺化分析**:提供活躍度趨勢、時段分布、成員排行等多種圖表與分析視角。
- 🧩 **統一資料格式**:透過穩定的資料抽象層,抹平不同聊天平台的匯出差異,分析流程更一致。
- 🔌 **MCP Server**:透過 Model Context Protocol 將聊天分析能力開放給 Claude Code、Cursor 等外部 AI 工具,支援 HTTP 與 Stdio 兩種接入方式。

## 使用指南

Expand All @@ -35,6 +36,45 @@ ChatLab 是一款專注於社交記錄分析的本機應用。結合 AI Agent

![預覽畫面](/public/images/intro_zh.png)

## MCP Server

ChatLab 內建 MCP(Model Context Protocol)服務,可讓 Claude Code、Cursor 等外部 AI 工具直接呼叫聊天記錄的分析能力。

**可用工具(共 17 個):** `list_sessions`、`get_session_overview`、`get_members`、`get_member_stats`、`get_member_profile`、`get_member_name_history`、`get_interaction_frequency`、`search_messages`、`get_recent_messages`、`get_date_range_messages`、`get_message_context`、`get_conversation_between`、`export_messages`、`get_time_stats`、`get_word_frequency`、`execute_sql`、`get_schema`

### HTTP 模式

在 **設定 → MCP Server** 中啟動服務,接著用 SSE 端點接入客戶端:

```json
{
"mcpServers": {
"chatlab": {
"url": "http://127.0.0.1:3000/sse"
}
}
}
```

同時提供 REST API:`http://127.0.0.1:{port}/api/v1/`

### Stdio 模式

無需在 ChatLab 中手動啟動。在 **設定 → MCP Server → 外部工具設定資訊** 中複製設定片段,貼到客戶端設定檔(如 `claude_desktop_config.json`):

```json
{
"mcpServers": {
"chatlab": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js", "--db-dir", "/path/to/databases"]
}
}
}
```

客戶端會自動管理行程的生命週期。

## 系統架構

### 架構原則(Architecture Principles)
Expand Down
7 changes: 7 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ files:
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
# 将 MCP Server 发布包含在应用资源目录中
extraResources:
- from: packages/mcp-server/dist
to: mcp-server/dist
- from: packages/mcp-server/node_modules
to: mcp-server/node_modules

# 哪些文件将不会被压缩,而是解压到构建目录
asarUnpack:
- resources/**
Expand Down
Loading