Back to MCP directory
publicPublicdnsLocal runtime

onenote-mcp

一个实现Model Context Protocol (MCP)的服务,允许AI语言模型如Claude等与Microsoft OneNote交互,支持访问、创建、搜索和总结笔记内容。

article

README

🚀 OneNote与Node.js集成工具

该工具借助Node.js实现与OneNote的交互操作,可对OneNote的笔记本、章节和页面进行读取、写入和搜索等操作,为用户提供便捷的笔记管理体验。

🚀 快速开始

若要使用本工具,可按以下步骤进行安装和启动:

  1. 克隆项目仓库:
git clone https://github.com/yourusername/onenote-node.git
cd onenote-node
  1. 安装依赖项:
npm install
  1. 启动开发服务器:
npm start

✨ 主要特性

  • 读取数据:获取OneNote笔记本、章节和页面内容。
  • 写入数据:创建新页面,更新现有内容。
  • 搜索功能:在笔记中进行全文搜索。

📦 安装指南

克隆仓库

git clone https://github.com/yourusername/onenote-node.git
cd onenote-node

安装依赖

npm install

启动服务

npm start

💻 使用示例

基础用法

获取所有笔记本

const { OneNoteClient } = require('onenote-node');
const client = new OneNoteClient();

async function listNotebooks() {
    const notebooks = await client.listNotebooks();
    console.log(notebooks);
}

listNotebooks(); // 输出所有OneNote笔记本信息

创建新页面

async function createPage(notebookId, sectionId) {
    const pageContent = `# 新页面标题\n## 内容`;
    await client.createPage(notebookId, sectionId, pageContent);
    console.log("页面创建成功");
}

高级用法

查询操作

// 获取所有笔记文件夹
client.listNotebooks().then(notebooks => {
    console.log("检测到以下笔记本:", notebooks);
});

// 读取指定页面内容
client.getPage(notebookId, sectionId, pageId).then(pageContent => {
    console.log("页面内容:", pageContent);
});

更新操作

// 创建新章节
const newSectionName = "任务清单";
client.createSection(notebookId, newSectionName);

// 更新页面内容
const newPageContent = `# 今日任务\n1. 完成项目报告\n2. 参加会议`;
client.updatePage(pageId, newPageContent);

📚 详细文档

工具列表

| 工具名称 | 描述 | |----------|------| | listNotebooks | 获取所有OneNote笔记本 | | getNotebook | 获取指定笔记本详细信息 | | listSections | 列出笔记本中的章节 | | listPages | 显示章节内的页面 | | getPage | 获取特定页面的完整内容 | | createPage | 创建带有HTML格式的新页面 |

兼容性说明

  • 支持Node.js版本:14.x及以上
  • 已测试的OneNote版本:Windows和网页版

配置文件

项目根目录下包含配置文件config.json,用于存储API连接信息。请根据实际情况进行修改。

📄 许可证

本项目遵循MIT许可证,具体条款见LICENSE文件。


更多详细内容请参考项目文档或直接运行示例脚本体验功能。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client