mcpField
M
MCP Notes Server

MCP Notes Server

远程服务
github.com/rwelgosh记忆与知识085 周前更新
代码仓库

关于 MCP Notes Server

MCP Notes Server 用于访问存储在 `~/DocumentationGenerator/notes/` 中的 JSON 笔记,供需要列出、读取或搜索笔记的 MCP 客户端使用。

主要功能

  1. 01列出所有笔记
  2. 02按名称读取笔记
  3. 03按查询内容搜索
  4. 04在指定笔记中搜索

适用场景

  1. 01查看现有笔记
  2. 02读取指定笔记
  3. 03查找匹配查询的笔记
  4. 04在单篇笔记中查找相关内容

MCP 相关

通过 HTTP 向 MCP 客户端提供笔记列表、读取和搜索命令。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址http://localhost:8000
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

工具

详细介绍

MCP 笔记服务

一个简单的 MCP(消息协调协议)服务,可访问存储在 ~/DocumentationGenerator/notes/ 中的笔记。

设置

  1. 确保已安装 Python 3.7+
  2. 创建虚拟环境:
    python -m venv venv
    
  3. 激活虚拟环境:
    • 在 macOS/Linux 上:source venv/bin/activate
    • 在 Windows 上:venv\Scripts\activate
  4. 安装依赖项:
    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

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。