关于 MCP Notes Server
MCP Notes Server 用于访问存储在 `~/DocumentationGenerator/notes/` 中的 JSON 笔记,供需要列出、读取或搜索笔记的 MCP 客户端使用。
主要功能
- 01列出所有笔记
- 02按名称读取笔记
- 03按查询内容搜索
- 04在指定笔记中搜索
适用场景
- 01查看现有笔记
- 02读取指定笔记
- 03查找匹配查询的笔记
- 04在单篇笔记中查找相关内容
MCP 相关
通过 HTTP 向 MCP 客户端提供笔记列表、读取和搜索命令。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
http://localhost:8000一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http notes http://localhost:8000Cursor.cursor/mcp.json
{"mcpServers":{"notes":{"type":"http","url":"http://localhost:8000"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"notes":{"type":"http","url":"http://localhost:8000"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"notes":{"type":"http","url":"http://localhost:8000"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"notes":{"serverUrl":"http://localhost:8000"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
MCP 笔记服务
一个简单的 MCP(消息协调协议)服务,可访问存储在 ~/DocumentationGenerator/notes/ 中的笔记。
设置
- 确保已安装 Python 3.7+
- 创建虚拟环境:
python -m venv venv - 激活虚拟环境:
- 在 macOS/Linux 上:
source venv/bin/activate - 在 Windows 上:
venv\Scripts\activate
- 在 macOS/Linux 上:
- 安装依赖项:
pip install -r requirements.txt
运行服务
启动 MCP 服务:
python notes.py
这将在 http://0.0.0.0:8000 上启动服务。
API 端点
该服务提供以下 MCP 命令:
list_notes()- 获取所有笔记get_note(note_name)- 按名称获取特定笔记search(query, note_name=None)- 按查询字符串搜索笔记
笔记格式
笔记以 JSON 文件的形式存储在指定目录中,格式如下:
{
"category": "category",
"summary": "summary of the notes",
"tags": [
{
"tag": "tag of the sub detail",
"summary": "high level business logic of the sub details",
"messages": [
{
"timestamp": "timestamp of the message",
"message": "message content"
},
{
"timestamp": "timestamp of the message",
"message": "message content"
},
...
]
}
]
}
客户端用法示例
以下是一个简单的 Python 示例,演示如何从客户端连接到 MCP 服务:
from mcp.client import MCPClient
# Connect to the MCP server
client = MCPClient("http://localhost:8000")
# List all notes
notes = client.call("notes.list_notes")
# Get a specific note
note = client.call("notes.get_note", note_name="your-note-name")
# Search for notes
search_results = client.call("notes.search", query="important")
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。