MCP 注释服务器
这是一个 MCP(模型上下文协议)服务器实现,用于管理指定目录中的 Markdown 笔记。该服务器提供使用 stdio 传输创建、读取和更新 Markdown 笔记的功能。
特征
创建新的 Markdown 笔记
阅读现有的 Markdown 笔记
更新现有的 Markdown 笔记
列出保管库中的所有笔记
指定目录下的自动文件管理
正确的错误处理和日志记录
笔记创建和修改的时间戳跟踪
所有操作的 JSON Schema 验证
服务器功能
该服务器实现了以下功能:
版本:1.0.0
名称:Notes MCP 服务器
描述:用于管理给定目录中的 Markdown 笔记的服务器
支持的传输:stdio
资源
服务器提供以下资源:
特性:
path:保险库的路径note_count:保险库中的票据总数
工具
该服务器实现了以下 MCP 工具:
创建注释
创建一个新的 Markdown 笔记。
参数:
title:笔记的标题(必填)content:注释的内容(可选,默认为空字符串)
返回:
filename:创建的文件的名称path:创建文件的完整路径created_at:创建的 ISO 时间戳
阅读笔记
读取现有的 markdown 注释。
参数:
title:要阅读的笔记的标题(必需)
返回:
title:笔记的标题content:笔记的内容path:文件的完整路径created_at:创建的 ISO 时间戳modified_at:最后修改的 ISO 时间戳
更新说明
更新现有的 Markdown 注释。
参数:
title:要更新的注释的标题(必需)content:注释的新内容(可选,默认为空字符串)
返回:
filename:更新文件的名称path:文件的完整路径updated_at:更新的 ISO 时间戳
列表注释
列出保险库中的所有 Markdown 注释。
参数:无
返回:
notes:注释对象数组,每个注释对象包含:title:笔记的标题path:文件的完整路径created_at:创建的 ISO 时间戳modified_at:最后修改的 ISO 时间戳
total:笔记总数
设置
安装所需的依赖项:
通过编辑 notes_dir 属性,将服务器配置为在 main.py 第 110 行的给定目录中工作:
配置 Cursor 以使用 MCP 服务器:
配置文件位于
.cursor/mcp.jsonCursor 将自动检测并使用此配置
服务器配置为使用 Python 和正确的 UTF-8 编码运行
运行服务器
当 Cursor 加载项目时,服务器将自动启动。您也可以手动运行它:
服务器将启动并通过 stdin/stdout 监听 MCP 请求。所有操作都会以相应的级别 (info/error) 记录,以便调试和监控。
错误处理
服务器针对各种场景实现了适当的错误处理:
缺少必需参数
文件已存在
未找到文件
一般例外
所有错误都会被记录下来并返回相应的错误代码和消息。
配置详细信息
MCP 服务器在.cursor/mcp.json中配置如下:
要将 MCP 添加为全局使用,请将其添加到用户目录中的 .cursor 文件夹,或者转到“Cursor 设置”->“MCP”->“添加新的全局 MCP 服务器”-> 将此项目中的 mcp.json 复制/粘贴到新文件 -> 更新 args 以指向 main.py
此配置:
将服务器命名为“notes-server”
使用 Python 运行服务器
设置 UTF-8 编码以便正确处理字符
This server cannot be installed
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server for managing and persisting notes, offering CRUD operations, note summarization, and resource-based access via a note:// URI scheme.Last updated -47MIT License
- -securityFlicense-qualityA TypeScript-based MCP server that enables users to manage text notes with features like note creation and summary generation using a Model Context Protocol.Last updated -1
- -securityAlicense-qualityA Model Context Protocol server that synchronizes Markdown files with Notion pages without using LLM tokens, enabling direct interaction with Notion databases and pages through API calls.Last updated -50MIT License
- AsecurityFlicenseAqualityA local development server that provides an interface for managing and accessing markdown documents using the Model Context Protocol (MCP).Last updated -2