# FlowNoter MCP 服务器
一个用于将对话记录保存为 Markdown 笔记的 Model Context Protocol (MCP) 服务器。
## ✨ 功能特性
- 📝 将 AI 对话历史保存为 Markdown 笔记
- 🗂️ 自动在 `notes` 文件夹中组织笔记
- 🧹 过滤掉思考过程和工具执行细节
- ⏰ 为每个笔记添加时间戳
- 🎯 从助手消息中提取干净的回答
- 🔧 可配置保存的对话轮数
## 🚀 安装
### 通过 npm 安装
```bash
# 全局安装
npm install -g @tricrepe/flownoter
# 或使用 npx(无需安装)
npx @tricrepe/flownoter
```
### 本地开发
```bash
git clone https://github.com/tricrepe/flownoter.git
cd flownoter
npm install
npm run build
```
## ⚙️ 配置
将以下配置添加到你的 MCP 设置配置文件中:
### Claude Desktop 配置
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
### 方式 1: 使用 npx(推荐)
```json
{
"mcpServers": {
"flownoter": {
"command": "npx",
"args": ["-y", "@tricrepe/flownoter"]
}
}
}
```
### 方式 2: 全局安装
```bash
npm install -g @tricrepe/flownoter
```
```json
{
"mcpServers": {
"flownoter": {
"command": "flownoter"
}
}
}
```
### 方式 3: 本地开发
"flownoter": {
"command": "node",
"args": ["/path/to/flownoter/dist/index.js"]
}
}
}
```
## 🛠️ 可用工具
### save_conversation_note
将最近的对话消息保存为 Markdown 笔记。
**参数:**
- `messages` (必需): 对话消息数组
- 每条消息应包含:
- `role`: "user" 或 "assistant"
- `content`: 消息内容
- `user_question` (必需): 用户的问题,用作笔记标题
- `num_messages` (可选): 包含最近多少轮对话 (默认: 所有消息)
**示例:**
```json
{
"messages": [
{
"role": "user",
"content": "如何创建一个 MCP 服务器?"
},
{
"role": "assistant",
"content": "要创建 MCP 服务器,你需要..."
}
],
"user_question": "创建 MCP 服务器",
"num_messages": 1
}
```
## 📄 输出格式
笔记保存在 `notes/` 文件夹中,格式如下:
```markdown
# [用户问题]
**Created:** [ISO 8601 时间戳]
---
## Question
[用户的问题]
## Answer
[助手的干净回答,不包含思考过程或工具调用]
```
## 📁 文件命名
笔记文件命名规则:
- 基于用户问题的净化版本(只保留字母数字和中文字符)
- 添加时间戳以保证唯一性
- `.md` 扩展名
示例: `创建MCP服务器_1696348800000.md`
## 🔧 开发
### 构建
```bash
npm run build
```
### 本地运行
```bash
npm start
```
## 🧹 自动清理内容
FlowNoter 会自动过滤以下内容:
- `<thinking>...</thinking>` - AI 的思考过程
- `<function_calls>...</function_calls>` - 函数调用
- `<function_results>...</function_results>` - 工具执行结果
- `<system_warning>...</system_warning>` - 系统警告
只保留给用户看的最终回答。
## 📚 文档
- **README.md** - 英文项目说明
- **README_CN.md** - 本文件 (中文说明)
- **USAGE.md** - 详细使用指南
- **EXAMPLE.md** - 完整使用示例
- **PROJECT_SUMMARY.md** - 项目总结
- **CHECKLIST.md** - 功能清单
## 🎯 使用场景
1. **学习笔记** - 将与 AI 的技术讨论保存为学习资料
2. **项目文档** - 记录项目相关的问答和解决方案
3. **知识库** - 构建个人知识库和问题解答集
4. **回顾总结** - 方便回顾之前的对话内容
## 🔐 许可证
ISC
## 👨💻 技术栈
- **TypeScript** - 类型安全的开发
- **MCP SDK** - Model Context Protocol 支持
- **Zod** - 运行时参数验证
- **Node.js** - 运行时环境
## 🙏 贡献
欢迎提交 Issue 和 Pull Request!
---
**享受你的笔记之旅!** 📝✨