This commit is contained in:
Sarv
2025-04-16 18:19:41 +08:00
committed by GitHub
parent 25d0b394e2
commit b64a3a1caa
4 changed files with 477 additions and 102 deletions

151
docs/mcp.md Normal file
View File

@@ -0,0 +1,151 @@
# MCP 集成指南
## 目录
- [MCP 集成指南](#mcp-集成指南)
- [目录](#目录)
- [前期准备](#前期准备)
- [mcp-proxy](#mcp-proxy)
- [ChatWise](#chatwise)
- [Cherry Studio](#cherry-studio)
- [Claude Desktop](#claude-desktop)
- [Monica Code](#monica-code)
## 前期准备
运行 `chatlog`,完成数据解密并开启 HTTP 服务
### mcp-proxy
如果遇到不支持 `SSE` 的客户端,可以尝试使用 `mcp-proxy``stdio` 的请求转换为 `SSE`
项目地址https://github.com/sparfenyuk/mcp-proxy
安装方式:
```shell
# 使用 uv 工具安装,也可参考项目文档的其他安装方式
uv tool install mcp-proxy
# 查询 mcp-proxy 的路径,后续可直接使用该路径
which mcp-proxy
/Users/sarv/.local/bin/mcp-proxy
```
## ChatWise
- 官网https://chatwise.app/
- 使用方式MCP SSE
- 注意事项:使用 ChatWise 的 MCP 功能需要 Pro 权限
1.`设置 - 工具` 下新建 `SSE 请求` 工具
![chatwise-1](https://github.com/user-attachments/assets/87e40f39-9fbc-4ff1-954a-d95548cde4c2)
1. 在 URL 中填写 `http://127.0.0.1:5030/sse`,并勾选 `自动执行工具`,点击 `查看工具` 即可检查连接 `chatlog` 是否正常
![chatwise-2](https://github.com/user-attachments/assets/8f98ef18-8e6c-40e6-ae78-8cd13e411c36)
3. 返回主页,选择支持 MCP 调用的模型,打开 `chatlog` 工具选项
![chatwise-3](https://github.com/user-attachments/assets/ea2aa178-5439-492b-a92f-4f4fc08828e7)
4. 测试功能是否正常
![chatwise-4](https://github.com/user-attachments/assets/8f82cb53-8372-40ee-a299-c02d3399403a)
## Cherry Studio
- 官网https://cherry-ai.com/
- 使用方式MCP SSE
1.`设置 - MCP 服务器` 下点击 `添加服务器`,输入名称为 `chatlog`,选择类型为 `服务器发送事件(sse)`,填写 URL 为 `http://127.0.0.1:5030/sse`,点击 `保存`。(注意:点击保存前不要先点击左侧的开启按钮)
![cherry-1](https://github.com/user-attachments/assets/93fc8b0a-9d95-499e-ab6c-e22b0c96fd6a)
2. 选择支持 MCP 调用的模型,打开 `chatlog` 工具选项
![cherry-2](https://github.com/user-attachments/assets/4e5bf752-2eab-4e7c-b73b-1b759d4a5f29)
3. 测试功能是否正常
![cherry-3](https://github.com/user-attachments/assets/c58a019f-fd5f-4fa3-830a-e81a60f2aa6f)
## Claude Desktop
- 官网https://claude.ai/download
- 使用方式mcp-proxy
- 参考资料https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server
1. 请先参考 [mcp-proxy](#mcp-proxy) 安装 `mcp-proxy`
2. 进入 Claude Desktop `Settings - Developer`,点击 `Edit Config` 按钮,这样会创建一个 `claude_desktop_config.json` 配置文件,并引导你编辑该文件
3. 编辑 `claude_desktop_config.json` 文件,配置名称为 `chatlog`command 为 `mcp-proxy` 的路径args 为 `http://127.0.0.1:5030/sse`,如下所示:
```json
{
"mcpServers": {
"chatlog": {
"command": "/Users/sarv/.local/bin/mcp-proxy",
"args": [
"http://localhost:5030/sse"
]
}
},
"globalShortcut": ""
}
```
4. 保存 `claude_desktop_config.json` 文件,重启 Claude Desktop可以看到 `chatlog` 已经添加成功
![claude-1](https://github.com/user-attachments/assets/f4e872cc-e6c1-4e24-97da-266466949cdf)
5. 测试功能是否正常
![claude-2](https://github.com/user-attachments/assets/832bb4d2-3639-4cbc-8b17-f4b812ea3637)
## Monica Code
- 官网https://monica.im/en/code
- 使用方式mcp-proxy
- 参考资料https://github.com/Monica-IM/Monica-Code/blob/main/Reference/config.md#modelcontextprotocolserver
1. 请先参考 [mcp-proxy](#mcp-proxy) 安装 `mcp-proxy`
2. 在 vscode 插件文件夹(`~/.vscode/extensions`)下找到 Monica Code 的目录,编辑 `config_schema.json` 文件。将 `experimental - modelContextProtocolServer``transport` 设置为如下内容:
```json
{
"experimental": {
"type": "object",
"title": "Experimental",
"description": "Experimental properties are subject to change.",
"properties": {
"modelContextProtocolServer": {
"type": "object",
"properties": {
"transport": {
"type": "stdio",
"command": "/Users/sarv/.local/bin/mcp-proxy",
"args": [
"http://localhost:5030/sse"
]
}
},
"required": [
"transport"
]
}
}
}
}
```
3. 重启 vscode可以看到 `chatlog` 已经添加成功
![monica-1](https://github.com/user-attachments/assets/8d0a96f2-ed05-48aa-a99a-06648ae1c500)
4. 测试功能是否正常
![monica-2](https://github.com/user-attachments/assets/054e0a30-428a-48a6-9f31-d2596fb8f743)

70
docs/prompt.md Normal file
View File

@@ -0,0 +1,70 @@
# Prompt 指南
## 概述
优秀的 `prompt` 可以极大的提高 `chatlog` 使用体验,收集了部分群友分享的 `prompt`,供大家参考。
在处理聊天记录时,尽量选择上下文长度足够的 LLM例如 `Gemini 2.5 Pro``Claude 3.5 Sonnet` 等。
欢迎大家在 [Discussions](https://github.com/sjzar/chatlog/discussions/47) 中分享自己的使用方式,共同进步。
## 群聊总结
作者:@eyaeya
```md
你是一个中文的群聊总结的助手,你可以为一个微信的群聊记录,提取并总结每个时间段大家在重点讨论的话题内容。
请帮我将 "<talker>" 在 <Time> 的群聊内容总结成一个群聊报告包含不多于5个的话题的总结如果还有更多话题可以在后面简单补充。每个话题包含以下内容
- 话题名(50字以内带序号1⃣2⃣3同时附带热度以🔥数量表示
- 参与者(不超过5个人将重复的人名去重)
- 时间段(从几点到几点)
- 过程(50到200字左右
- 评价(50字以下)
- 分割线: ------------
另外有以下要求:
1. 每个话题结束使用 ------------ 分割
2. 使用中文冒号
3. 无需大标题
4. 开始给出本群讨论风格的整体评价,例如活跃、太水、太黄、太暴力、话题不集中、无聊诸如此类
最后总结下最活跃的前五个发言者。
```
## 微信聊天记录可视化
作者:@数字声明卡兹克
原文地址https://mp.weixin.qq.com/s/Z66YRjY1EnC_hMgXE9_nnw
Prompt[微信聊天记录可视化prompt.txt](https://github.com/user-attachments/files/19773263/prompt.txt)
这份 prompt 可以使用聊天记录生成 HTML 网页,再使用 [YOURWARE](https://www.yourware.so/) 部署为可分享的静态网页。
### 技术讨论分析
作者:@eyaeya
```md
你作为一个专业的技术讨论分析者,请对以下聊天记录进行分析和结构化总结:
1. 基础信息提取:
- 将每个主题分成独立的问答对
- 保持原始对话的时间顺序
1. 问题分析要点:
- 提取问题的具体场景和背景
- 识别问题的核心技术难点
- 突出问题的实际影响
1. 解决方案总结:
- 列出具体的解决步骤
- 提取关键工具和资源
- 包含实践经验和注意事项
- 保留重要的链接和参考资料
1. 输出格式:
- 不要输出"日期:YYYY-MM-DD"这一行直接从问题1开始
- 问题1<简明扼要的问题描述>
- 回答1<完整的解决方案>
- 补充:<额外的讨论要点或注意事项>
1. 额外要求(严格执行)
- 如果有多个相关问题,保持逻辑顺序
- 标记重要的警告和建议、突出经验性的分享内容、保留有价值的专业术语解释、移除"我来分析"等过渡语确保链接的完整性
- 直接以日期开始,不要添加任何开场白
```