关于 Temp Notes MCP Server
Temp Notes MCP Server 为 AI Agent 提供跨对话保存临时信息的文件存储,适合需要延续上下文的多步骤任务。它通过读取、写入、追加和清空工具管理笔记。
主要功能
- 01跨对话保存笔记
- 02读取、替换、追加和清空笔记
- 03基于文件的本地存储
- 04跟踪多步骤任务
适用场景
- 01保存编码任务清单
- 02在新对话中继续工作
- 03在项目间传递代码片段
MCP 相关
向 MCP 客户端提供读取、写入、追加和清空笔记的工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
4收录的工具列表 · 更新于 2 周前
此工具无需参数。
详细介绍
Temp Notes MCP 服务
一个模型上下文协议(MCP)服务,可让 AI Agent 在不同对话和上下文中存储和检索临时信息。
目录
用途
Temp Notes MCP 服务提供了一种简单而强大的方式,让 AI Agent 能够在多次对话中,或处理超出上下文窗口限制的复杂任务时保持状态和上下文。它充当临时记忆系统,让 Agent 能够存储笔记、清单、代码片段及其他信息,以便稍后检索。
主要功能
- 在不同对话中持久保存临时内容
- 提供简单的 API,用于读取、写入和追加笔记
- 轻量且易于集成到现有工作流中
- 支持将复杂的多步骤任务拆分为易于管理的小块
快速开始
-
使用 npx 将服务添加到 MCP 配置中(无需安装):
{ "mcpServers": { "temp-notes": { "command": "npx", "args": ["-y", "@landicefu/temp-notes-mcp-server"], "disabled": false } } } -
开始在对话中使用:
// Store information await use_mcp_tool({ server_name: "temp-notes", tool_name: "write_note", arguments: { content: "Important information to remember" } }); // Retrieve information later const result = await use_mcp_tool({ server_name: "temp-notes", tool_name: "read_note", arguments: {} });
安装
选项 1:使用 npx(无需安装)
- 将服务添加到 MCP 配置中:
{ "mcpServers": { "temp-notes": { "command": "npx", "args": ["-y", "@landicefu/temp-notes-mcp-server"], "disabled": false } } }
此选项使用 npx 直接运行服务,无需全局安装。
选项 2:从 npm 安装
-
全局安装软件包:
npm install -g @landicefu/temp-notes-mcp-server -
将服务添加到 MCP 配置中:
{ "mcpServers": { "temp-notes": { "command": "temp-notes-mcp-server", "disabled": false } } }
选项 3:从源代码安装
-
克隆代码库:
git clone https://github.com/landicefu/temp-notes-mcp-server.git cd temp-notes-mcp-server -
安装依赖项:
npm install -
构建服务:
npm run build -
将服务添加到 MCP 配置中:
{ "mcpServers": { "temp-notes": { "command": "node", "args": ["/path/to/temp-notes-mcp-server/build/index.js"], "disabled": false } } }
工具
Temp Notes MCP 服务提供以下工具:
clear_note
清除当前笔记,使其变为空。
{
"type": "object",
"properties": {},
"required": []
}
write_note
用新字符串替换当前笔记。
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "The content to write to the note"
}
},
"required": ["content"]
}
read_note
返回当前笔记的内容。
{
"type": "object",
"properties": {},
"required": []
}
append_note
将新文本追加到当前笔记,并从新行开始。可选择包含分隔线。
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "The content to append to the note"
},
"include_separator": {
"type": "boolean",
"description": "Whether to include a separator line (---) before the new content",
"default": true
}
},
"required": ["content"]
}
使用示例
存储任务清单
// Store a checklist for a complex task
await use_mcp_tool({
server_name: "temp-notes",
tool_name: "write_note",
arguments: {
content: "# Project Refactoring Checklist\n\n- [ ] Analyze current architecture\n- [ ] Identify performance bottlenecks\n- [ ] Create new component structure\n- [ ] Implement data layer changes\n- [ ] Update UI components\n- [ ] Write tests\n- [ ] Document changes"
}
});
检索已存储的信息
// In a new conversation, retrieve the checklist
const result = await use_mcp_tool({
server_name: "temp-notes",
tool_name: "read_note",
arguments: {}
});
// Result contains the previously stored checklist
更新进度
// Update the note with progress
await use_mcp_tool({
server_name: "temp-notes",
tool_name: "append_note",
arguments: {
content: "## Architecture Analysis Complete\n\nKey findings:\n- Current structure has circular dependencies\n- Data fetching is inefficient\n- Component reuse is minimal\n\nRecommendation: Implement repository pattern and component composition",
include_separator: true
}
});
完成后清除笔记
// Clear the note when the task is complete
await use_mcp_tool({
server_name: "temp-notes",
tool_name: "clear_note",
arguments: {}
});
使用场景
1. 复杂的编码任务
处理复杂的编码任务时,AI Agent 经常会遇到上下文窗口限制,难以在一次对话中完成所有步骤。Temp Notes MCP 服务允许 Agent:
- 存储待完成任务的清单
- 为每个子任务添加详细说明
- 记录特定子任务需要检查的文件
- 跨多次对话跟踪进度
- 保留原本可能丢失的重要上下文
这样便能将复杂任务拆分为更小、更易管理的部分,同时保留整体上下文和目标。
2. 跨对话保留上下文
随着对话变长,上下文窗口可能会被占满,限制 Agent 保留所有相关信息的能力。借助 Temp Notes MCP 服务,Agent 可以:
- 总结当前任务状态
- 记录已完成的步骤和剩余工作
- 存储关键见解和已作出的决策
- 概述在新对话中继续处理的后续步骤
这样,用户就可以开始新的对话,而无需丢失进度或重复提供信息。
3. 跨仓库信息传递
在多个仓库或项目间工作时,传递相关信息可能颇具挑战。Temp Notes MCP Server 可帮助 Agent:
- 存储来自某个仓库的代码片段
- 保存文件内容以供参考
- 记录某个项目中的模式或方法,以便应用到另一个项目
- 创建临时文档,串联多个项目
这有助于在不同上下文间传递知识,无需复杂的设置。
4. 协作工作流
多个 Agent 或用户可以通过以下方式在彼此的工作基础上继续推进:
- 存储中间结果,供其他 Agent 使用
- 创建可由不同 Agent 更新的共享任务列表
- 记录方法和流程,供他人参考
- 对复杂问题保持共同理解
5. 学习与实验
探索新技术或新方法时,Agent 可以:
- 记录学习资源和参考资料
- 存储示例代码和使用模式
- 跟踪实验及其结果
- 建立技术和解决方案知识库
6. 渐进式文档编写
对于需要编写文档的项目,Agent 可以:
- 在多个会话中逐步收集信息
- 在最终确定文档前整理内容
- 存储可随时间完善的草稿章节
- 从不同交互中收集示例和用例
笔记存储
默认情况下,Temp Notes MCP Server 会将笔记存储在以下位置:
- macOS/Linux:
~/.mcp_config/temp_notes.txt(展开后为/Users/username/.mcp_config/temp_notes.txt) - Windows:
C:\Users\username\.mcp_config\temp_notes.txt
首次写入笔记时会自动创建此文件。如果尝试读取笔记时文件不存在,服务会返回空字符串,并在下次写入时创建文件。
服务会处理以下情况:
- 读取时文件不存在:返回空字符串
- 目录不存在:写入时自动创建目录结构
- 文件损坏或无法访问:返回相应的错误消息
贡献
欢迎贡献!请随时提交 Pull Request。
许可证
本项目采用 MIT License 许可,详情请参阅 LICENSE 文件。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。