跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 OneNote (Microsoft 365),然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 OneNote 中工作:浏览笔记本、分区和页面,阅读页面,创建笔记本、分区和页面,并在现有页面中添加笔记。通过 Microsoft Graph 支持工作或学校版 OneNote 和个人版 OneNote,使用你的 Microsoft 账户登录。
试试这样问
OneNote (Microsoft 365) 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → OneNote (Microsoft 365)、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Microsoft OneNote
让你的 AI 在 OneNote 中工作:浏览笔记本、分区和页面,阅读页面,创建笔记本、分区和页面,并在现有页面中添加笔记。通过 Microsoft Graph 支持工作或学校版 OneNote 和个人版 OneNote,使用你的 Microsoft 账户登录。
设置
-
打开 Microsoft Entra 管理中心(entra.microsoft.com)或 Azure 门户,进入 Applications → App registrations → New registration。
-
为应用命名(例如 "AnythingMCP Microsoft 365"),并选择 Supported account types。这一选择决定
MICROSOFT_TENANT_ID填什么:- Accounts in this organizational directory only(单租户):只有你组织内的用户可以登录。填写应用 Overview 页面上的 Directory (tenant) ID(一个 GUID),或你的域名,例如
contoso.onmicrosoft.com。 - Accounts in any organizational directory(多租户):填写
organizations。 - Accounts in any organizational directory and personal Microsoft accounts:填写
common(工作、学校和个人账户)或consumers(仅个人账户)。
如果该值与账户类型不符,Microsoft 会拒绝登录(AADSTS50194 或 AADSTS50020)。
- Accounts in this organizational directory only(单租户):只有你组织内的用户可以登录。填写应用 Overview 页面上的 Directory (tenant) ID(一个 GUID),或你的域名,例如
-
在 Redirect URI 下选择平台 Web,填写
https://cloud.anythingmcp.com/api/mcp-oauth/callback。如果你自行托管 AnythingMCP,则改为填写https://your-anythingmcp-host/api/mcp-oauth/callback。URI 必须逐字符一致,否则 Microsoft 会返回 AADSTS50011。 -
打开 API permissions → Add a permission → Microsoft Graph → Delegated permissions,添加
offline_access、User.Read和Notes.ReadWrite。offline_access让 Microsoft 签发刷新令牌;缺少它,连接器会在授权一小时后停止工作。 -
打开 Certificates & secrets → New client secret。复制密钥的 Value,而不是 Secret ID;它只显示一次。记下到期日期:密钥过期后,连接器会停止工作,直到你创建新密钥并填入。
-
将 Overview 页面上的 Application (client) ID 填入
MICROSOFT_CLIENT_ID,将密钥值填入MICROSOFT_CLIENT_SECRET,将第 2 步中的租户值填入MICROSOFT_TENANT_ID,然后安装连接器。 -
在连接器页面点击 Authorize with Provider,用 AI 要使用其笔记本的账户登录。刷新令牌会加密保存,访问令牌(有效期约一小时)会自动续期。
-
先运行
microsoft_onenote_list_notebooks:它会列出连接器能打开的笔记本,以及你在每个笔记本中的角色(所有者、参与者或读者)。
一个 Entra 应用服务所有 Microsoft 连接器:你为 Outlook、OneDrive、SharePoint 或 Excel 连接器创建的应用注册在这里同样适用。打开它,在 API permissions 下添加第 4 步中的权限,保留相同的重定向 URI,并复用同一个客户端 ID、密钥和租户。每个连接器在授权时只请求它自己需要的权限:
- Outlook:
Mail.ReadWrite、Mail.Send、Calendars.ReadWrite - OneDrive:
Files.ReadWrite - Excel:
Files.ReadWrite(工作簿位于 SharePoint 中或由他人共享给你时,还需要Files.ReadWrite.All) - SharePoint:
Sites.ReadWrite.All和Files.ReadWrite.All - OneNote:
Notes.ReadWrite - Microsoft To Do:
Tasks.ReadWrite - Planner:
Tasks.ReadWrite
它们都还需要 offline_access 和 User.Read。
管理员同意:这些委托权限通常不需要管理员,但许多组织关闭了用户同意。如果登录时显示 "Need admin approval"(AADSTS65001 或 AADSTS90094),需要租户管理员打开一次应用注册,点击 API permissions → Grant admin consent 为整个组织授予同意。之后每个用户都可以授权。每个连接器仍然只能处理登录账户有权查看的内容。
共享给你的笔记本:Notes.ReadWrite 涵盖你自己的笔记本。要在同事共享给你的笔记本中工作(工作或学校账户),请在应用注册中添加 Notes.ReadWrite.All,在连接器的 OAuth 设置中用它替换 Notes.ReadWrite,然后重新授权。
只读设置:在连接器的 OAuth 设置中将 scopes 替换为 offline_access User.Read Notes.Read,重新授权,并停用 microsoft_onenote_create_notebook、microsoft_onenote_create_section、microsoft_onenote_create_page、microsoft_onenote_append_to_page 和 microsoft_onenote_update_page。
改动要等你确认:在创建笔记本、分区或页面,或修改页面之前,AI 会告诉你它要写什么、写在哪里,并等你确认。
安装时默认关闭:microsoft_onenote_delete_page。连接器无法撤销删除,所以只有在确实需要 AI 删除页面时才打开它。
查找和阅读页面:笔记本里有分区(可以放进分区组),每个分区里有页面。AI 可以搜索页面标题,并按最后修改日期筛选,但 Microsoft Graph 不搜索页面里的正文,所以 AI 会打开可能相关的页面来阅读。页面中的图片只能用你的登录身份打开,手写墨迹不包括在内,非常长的页面会在约 200 KB 处被截断。如果你的 OneNote 内容非常多,跨所有笔记本的页面列表可能因错误 10008 失败;这时 AI 会逐个分区查看。
写入页面:新页面支持简单格式:标题、列表、表格、链接、待办复选框,以及来自公开网址的图片。要在页面末尾添加笔记,用 microsoft_onenote_append_to_page 最方便。新页面需要几秒钟后 OneNote 才接受对它的修改:如果刚创建就追加内容返回 404,AI 会稍等片刻再试。
常见错误:401 InvalidAuthenticationToken 表示授权已被撤销或客户端密钥已过期;如有需要填入新密钥,然后再次点击 Authorize with Provider。403(代码 40004 或 40002)表示缺少 Notes.ReadWrite 或该权限未获同意,或者笔记本只以只读方式共享给你。404(或代码 20102、20112)表示 id 错误或项目已被删除。20117 表示那里已有同名的笔记本或分区;20115、20153 或 20155 表示名称含有不允许的字符或过长(笔记本最多 128 个字符,分区最多 50 个)。30105 或 30108 表示你的 OneDrive for Business 还没有设置好:打开一次 OneDrive,或请管理员检查你的许可证。429 表示 Microsoft Graph 正在限制该账户的请求:稍等片刻后重试。
连接器不会向页面上传图片或文件,不处理手写墨迹,不复制页面或分区,也不打开 Microsoft 365 组或 SharePoint 网站的笔记本。
前提条件: MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID
本地安装连接器
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
打开 http://localhost:3000/connectors/store,选择 OneNote (Microsoft 365) 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
microsoft_onenote_list_notebooks | List the OneNote notebooks the user can open: id, displayName, isDefault, isShared, userRole (Owner, Contributor, Reader), dates and links… |
microsoft_onenote_list_sections | List all sections in all of the user's notebooks, including sections inside section groups |
microsoft_onenote_list_notebook_sections | List the sections directly inside one notebook (not those inside its section groups; see microsoft_onenote_list_notebook_section_groups) |
microsoft_onenote_list_section_groups | List all section groups (folders of sections) in the user's notebooks, including nested ones |
microsoft_onenote_list_notebook_section_groups | List the section groups directly inside one notebook: id, displayName, dates and links |
microsoft_onenote_list_section_group_sections | List the sections directly inside one section group: id, displayName, isDefault, dates and links |
microsoft_onenote_list_pages | List pages across all of the user's notebooks, most recently changed first: id, title, createdDateTime, lastModifiedDateTime, links… |
microsoft_onenote_list_section_pages | List the pages of one section: id, title, dates, links |
microsoft_onenote_get_page | Get one page's metadata: title, dates, links, contentUrl, and the parentSection and parentNotebook it belongs to |
microsoft_onenote_get_page_content | Read a page: OneNote returns the page as HTML (title in <title>, text in <p>, <li>, <table> elements inside absolutely positioned <div>s… |
microsoft_onenote_create_notebook | Create a new notebook in the user's OneDrive |
microsoft_onenote_create_section | Create a section in a notebook |
microsoft_onenote_create_page | Create a page in a section from a title and HTML content |
microsoft_onenote_append_to_page | Add HTML at the end of a page (inside its first div), e.g. "<p>Follow-up: call Anna on Friday</p>" |
microsoft_onenote_update_page | Change a page with a list of commands, each {target, action, position?, content}. target: "title" (only action replace, content = new title… |
microsoft_onenote_delete_page | Delete a page |
示例提示
- “我有哪些 OneNote 笔记本?“工作”笔记本里有哪些分区?”
- “找出上个月标题里带“预算”的页面,并概括它们的内容。”
- “在“会议”分区新建一个“Acme 启动会”页面,放入这些笔记,并给每个待办事项加一个待办复选框。”
- “在“供应商通话”页面末尾加一句:周五就交货日期再跟 Anna 确认一下。”
下一步
这份指南对你有帮助吗?