claude-nb-mcp

claude-nb-mcp

Integrates nb command-line note-taking with Claude Code, enabling adding, listing, searching, and showing notes organized by project directory.

Category
访问服务器

README

claude-nb-mcp

MCP server for integrating nb (command-line note-taking) with Claude Code.

Features

  • Working Directory-based Notebooks: Automatically organizes notes by project/working directory
  • Claude Folder Organization: Separates Claude-generated notes from manual notes
  • 4 Core Tools: Add, list, search, and show notes
  • Secure: Prevents command injection and provides proper error handling
  • Easy Setup: Simple integration with Claude Code

Folder Structure

Claude-generated notes are automatically organized in a claude/ subfolder within each notebook:

~/.nb/
├── dotfiles/
│   ├── claude/              # Claude-generated notes
│   │   └── 20260101171752.md
│   └── manual-note.md       # Your manual notes
└── my-app/
    ├── claude/              # Claude-generated notes
    └── manual-note.md       # Your manual notes

This separation allows you to:

  • Keep Claude's automatic notes separate from your manual notes
  • Easily filter or search only Claude's notes
  • Maintain a cleaner organization

Prerequisites

  • nb (v7.x recommended)
  • Node.js >= 18.0.0
  • Claude Code

Installing nb

# macOS
brew install nb

# Or using the installer
curl -L https://raw.github.com/xwmx/nb/master/nb -o /usr/local/bin/nb && chmod +x /usr/local/bin/nb

Installation

  1. Clone this repository:
cd ~/workspace  # or your preferred location
git clone https://github.com/lowbridgee/claude-nb-mcp.git
cd claude-nb-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Register with Claude Code:
claude mcp add --transport stdio nb --scope user -- node /absolute/path/to/claude-nb-mcp/dist/index.js

Replace /absolute/path/to/claude-nb-mcp with the actual absolute path.

Usage

Automatic Notebook Selection

When you run Claude Code in a project directory, notes are automatically saved to a notebook named after that directory:

Working Directory Notebook Name
/Users/you/dotfiles dotfiles
/Users/you/projects/my-app my-app

Available Tools

nb_add

Add a new note to the current project's notebook.

Parameters:

  • content (required): Note content
  • title (optional): Note title
  • tags (optional): Array of tags

Example:

nb_add({
  content: "This is a technical note about the authentication bug.",
  title: "Auth Bug Analysis",
  tags: ["bug", "authentication"]
})

nb_list

List notes from the current project's notebook.

Parameters:

  • limit (optional, default: 20): Maximum number of notes
  • type (optional): Filter by type (note, bookmark, todo)

Example:

nb_list({ limit: 10, type: "note" })

nb_search

Search notes in the current project's notebook.

Parameters:

  • query (required): Search query
  • limit (optional, default: 10): Maximum results

Example:

nb_search({ query: "authentication", limit: 5 })

nb_show

Show the full content of a specific note.

Parameters:

  • id (required): Note ID (from nb_list output)

Example:

nb_show({ id: 3 })

Custom Notebook Name

You can override the automatic notebook name by setting the NB_NOTEBOOK environment variable:

{
  "mcpServers": {
    "nb": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/claude-nb-mcp/dist/index.js"],
      "env": {
        "NB_NOTEBOOK": "my-custom-notebook"
      }
    }
  }
}

Development

# Build
npm run build

# Watch mode
npm run dev

How It Works

  1. Notebook Detection: On startup, the server reads PWD or process.cwd() to determine the working directory
  2. Notebook Name: Uses the basename of the working directory (e.g., dotfiles from /Users/you/dotfiles)
  3. nb Commands: Executes nb <notebook>:<command> for all operations

Troubleshooting

"nb command not found"

Install nb:

brew install nb
# or
curl -L https://raw.github.com/xwmx/nb/master/nb -o /usr/local/bin/nb && chmod +x /usr/local/bin/nb

Notes not showing up

Check which notebooks exist:

nb notebooks

Verify the notebook name matches your project directory:

nb dotfiles:list  # Replace 'dotfiles' with your directory name

Permission errors

Ensure the MCP server has execute permissions on nb:

which nb
nb --version

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选