笔记管理协议服务器

一个用于管理笔记和记忆的模型上下文协议(MCP)服务器,内置网页浏览器查看器。

  • by harsh2204
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 harsh2204/notes-mcp

使用说明

注释mcp

一种用于管理笔记和记忆的模型上下文协议(MCP)服务器,具有内置的web查看器。

安装

bun install

MCP服务器

启动MCP服务器(stdio传输,用于AI代理):

bun run start

添加到您的应用程序

将您的AI应用程序配置为将notes-mcp作为mcp服务器运行。服务器使用 标准 并且必须将其工作目录设置为项目根目录(其中 package.json 是)。

应用程序 配置位置 注释
光标 ~/.cursor/mcp.json (macOS/Linux)或 %USERPROFILE%\.cursor\config\mcp.json (Windows) 设置→ MCP或编辑JSON
克劳德桌面版 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows) 设置→ 开发者→ 编辑配置
克劳德代码 (CLI) claude mcp add / ~/.claude.json 或 .mcp.json 使用 claude mcp add --transport stdio … 或 claude mcp add-json
VS代码副本 .vscode/mcp.json (工作空间)或用户 mcp.json 通过 MCP:打开用户配置 用途 servers 密钥;stdio与 command/args
帆板运动 风帆设置→ 高级→ 级联或编辑 mcp_config.json 路径因安装而异
继续 (VS代码) .continue/config.yaml 在工作空间中,或 ~/.continue/config.yaml 使用 mcpServers 在YAML中

在应用程序中使用此块 mcpServers 部分(替换 /path/to/notes-mcp 使用克隆的绝对路径):

"notes-mcp": {
  "command": "bun",
  "args": ["run", "start"],
  "cwd": "/path/to/notes-mcp",
  "env": {}
}

光标已到达: 某些MCP客户端(包括Cursor)可能未设置 cwd 当开始该过程时。如果你看到 Module not found "src/index.ts",使用 入口脚本的绝对路径 在 args 而不是 ["run", "start"]例如。 "args": ["/path/to/notes-mcp/src/index.ts"],并保持 cwd 设置为Bun可以解析 node_modules.

可选:设置 NOTES_MCP_DIR 在 env 覆盖notes目录(默认 ~/.notes).

TUI安装程序

从 注释mcp repo root,运行交互式安装程序设置Cursor(技能、规则、MCP)、Claude Code(技能、MCP),Claude Desktop,VS Code Copilot,Windsurf,并一次性继续:

bun run install-tui

通过多选选择要安装的内容;该脚本写入配置并复制文件。安装后重新启动每个应用程序。从当前目录中检测到项目根目录,以便MCP cwd 条目指向此repo。

光标

  1. 打开 设置 → 主控程序,或创建/编辑 ~/.cursor/mcp.json (macOS/Linux)或 %USERPROFILE%\.cursor\config\mcp.json (Windows)。
  2. 在下面添加服务器 mcpServers.使用 入口脚本的绝对路径 在 args 因此,即使未设置Cursor,服务器也会启动 cwd (否则您可能会看到 Module not found "src/index.ts"):
{
  "mcpServers": {
    "notes-mcp": {
      "command": "bun",
      "args": ["/absolute/path/to/notes-mcp/src/index.ts"],
      "cwd": "/absolute/path/to/notes-mcp",
      "env": {}
    }
  }
}
  1. 重新启动游标。服务器出现在MCP和代理工具列表中。

克劳德桌面版

  1. 打开 克劳德 menu → 设置… → 开发者 → 编辑配置 (创建/打开 claude_desktop_config.json).
  2. 添加服务器:
{
  "mcpServers": {
    "notes-mcp": {
      "command": "bun",
      "args": ["run", "start"],
      "env": {
        "NOTES_MCP_DIR": "/optional/path/to/notes"
      }
    }
  }
}

使用绝对路径 cwd 如果你的客户支持它(例如。 "cwd": "/Users/you/notes-mcp").在Windows上,确保Bun在PATH上或使用完整路径 bun.cmd. 3.退出并重新启动Claude Desktop。检查输入区域中的MCP(锤子)图标。

克劳德代码(CLI)

从 注释mcp 项目目录,添加服务器(选项必须在服务器名称之前; -- 将名称与命令分隔开):

# From the notes-mcp repo root. Use --scope user to make it available in all projects.
claude mcp add --transport stdio --scope user notes-mcp -- bun run start

或者通过JSON添加,使工作目录显式(替换 /absolute/path/to/notes-mcp):

claude mcp add-json notes-mcp '{"type":"stdio","command":"bun","args":["run","start"],"cwd":"/absolute/path/to/notes-mcp"}' --scope user

第一个表单的可选env(例如自定义notes dir):

claude mcp add --transport stdio --scope user --env NOTES_MCP_DIR=/path/to/notes notes-mcp -- bun run start

证实 claude mcp list 和 claude mcp get notes-mcp.在克劳德代码中,使用 /mcp 查看连接的服务器。

Claude Code也支持 技能 (如光标)。要安装Claude Code的notes mcp技能,请将该技能复制到您的个人技能目录中,以便在所有项目中都可以使用:

# macOS / Linux
mkdir -p ~/.claude/skills/notes-mcp-usage
cp .cursor/skills/notes-mcp-usage/SKILL.md ~/.claude/skills/notes-mcp-usage/

# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\skills\notes-mcp-usage"
Copy-Item ".cursor\skills\notes-mcp-usage\SKILL.md" "$env:USERPROFILE\.claude\skills\notes-mcp-usage\"

重新启动Claude Code,然后运行 claude skills list 或者问“你有什么技能?”来确认。

VS代码副本

工作区:创建或编辑 .vscode/mcp.json 在您的项目中,将服务器添加到 servers (不是 mcpServers).使用绝对路径 cwd 或 ${workspaceFolder} 如果你的配置支持它:

{
  "servers": {
    "notes-mcp": {
      "type": "stdio",
      "command": "bun",
      "args": ["run", "start"],
      "cwd": "/absolute/path/to/notes-mcp"
    }
  }
}

用户(所有工作区):运行 MCP:打开用户配置 从命令面板(Ctrl+Shift+P/Cmd+Shift+P)打开您的配置文件 mcp.json,然后添加相同的内容 servers.notes-mcp 进入。路径:macOS ~/Library/Application Support/Code/User/mcp.json,Windows %APPDATA%\Code\User\mcp.json,Linux ~/.config/Code/User/mcp.json.

重新启动VS代码或运行 MCP:列出服务器 以验证。

帆板运动

  1. 打开 风帆设置 (例如Cmd/Ctrl+Shift+P→ “打开风帆设置”)→ 高级 → 级联.
  2. 编辑MCP配置(或 mcp_config.json 在UI中所示的路径中)。添加:
"notes-mcp": {
  "command": "bun",
  "args": ["run", "start"],
  "cwd": "/absolute/path/to/notes-mcp",
  "disabled": false
}
  1. 如果需要,重新启动Windsurf。

继续(VS代码)

  1. 在项目中或全局范围内,编辑 .continue/config.yaml (或 ~/.continue/config.yaml).
  2. 添加到下面 mcpServers (YAML,不是JSON):
mcpServers:
  notes-mcp:
    command: bun
    args:
      - run
      - start
    cwd: /absolute/path/to/notes-mcp
  1. 重新加载Continue/VS代码,以便启动新服务器。

网络观众

启动web UI,在浏览器中浏览笔记和回忆:

bun run web

开放时间: http://localhost:3000.使用配置端口 PORT 环境变量:

PORT=8080 bun run web

特性

  • 仪表盘 --统计数据和最新项目概述
  • 回忆 --带标签过滤和实时搜索的表视图
  • 备注 --带文件夹/标签过滤器的列表视图,带语法突出显示的完整markdown渲染
  • 搜索 --对所有笔记和记忆进行统一搜索
  • 深色模式 --自动(跟随操作系统),带手动切换

光标集成

mcp附带了Cursor技能和规则,教AI代理如何有效地使用mcp工具。安装后,将它们复制到用户级的Cursor目录中,以便在每个项目中都可以使用:

技能 (完整的工具参考和使用模式):

# macOS / Linux
mkdir -p ~/.cursor/skills/notes-mcp-usage
cp .cursor/skills/notes-mcp-usage/SKILL.md ~/.cursor/skills/notes-mcp-usage/

# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.cursor\skills\notes-mcp-usage"
Copy-Item ".cursor\skills\notes-mcp-usage\SKILL.md" "$env:USERPROFILE\.cursor\skills\notes-mcp-usage\"

光标规则 (始终在代理指导下):

# macOS / Linux
mkdir -p ~/.cursor/rules
cp .cursor/rules/notes-mcp-agent-context.mdc ~/.cursor/rules/

# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.cursor\rules"
Copy-Item ".cursor\rules\notes-mcp-agent-context.mdc" "$env:USERPROFILE\.cursor\rules\"

该技能提供了完整的工具参考(所有10个工具、参数、约定、工作流)。该规则确保代理自动保存用户偏好和会话上下文,并指向技能以供更深入的参考。

配置

设置 NOTES_MCP_DIR 用于更改存储目录的环境变量(默认值: ~/.notes).

堆栈