跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Outlook (Microsoft 365 Mail and Calendar),然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 Outlook 中工作:搜索和阅读邮件、将邮件归入文件夹、起草、发送和回复邮件、查看日历、创建和改期会议,以及查找同事的空闲时间。通过 Microsoft Graph 支持 Microsoft 365 和 Outlook.com,使用你的 Microsoft 账户登录。
试试这样问
Outlook (Microsoft 365 Mail and Calendar) 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Outlook (Microsoft 365 Mail and Calendar)、粘贴凭证、生成 MCP API key — 完成。无 Docker、无
git clone、无本地服务器。
Outlook (Microsoft 365 Mail and Calendar)
让你的 AI 在 Outlook 中工作:搜索和阅读邮件、将邮件归入文件夹、起草、发送和回复邮件、查看日历、创建和改期会议,以及查找同事的空闲时间。通过 Microsoft Graph 支持 Microsoft 365 和 Outlook.com,使用你的 Microsoft 账户登录。
设置
-
打开 Microsoft Entra 管理中心(entra.microsoft.com)或 Azure 门户,进入 Applications → App registrations → New registration。
-
为应用命名(例如 "AnythingMCP Outlook"),并选择 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(工作、学校和 Outlook.com 账户)或consumers(仅 Outlook.com)。
如果该值与账户类型不符,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、Mail.ReadWrite、Mail.Send和Calendars.ReadWrite。不要把它们添加为 Application permissions:应用权限会让该应用无需任何人登录即可访问租户中的每一个邮箱。连接器不需要这些权限,它以登录用户的身份工作。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 要处理的邮箱登录。刷新令牌会加密保存,访问令牌(有效期约一小时)会自动续期。
-
先运行
outlook_get_me:它会显示连接器登录的是哪个邮箱。
管理员同意:这些委托权限通常不需要管理员,但许多组织关闭了用户同意。如果登录时显示 "Need admin approval"(AADSTS65001 或 AADSTS90094),需要租户管理员(例如 Global Administrator 或 Cloud Application Administrator)打开一次应用注册,点击 API permissions → Grant admin consent 为整个组织授予同意。之后每个用户都可以授权。由管理员授权的连接器仍然只读取管理员自己的邮箱:每个连接器只为登录的那个账户工作。
只读设置:在连接器的 OAuth 设置中将 scopes 替换为 offline_access User.Read Mail.Read Calendars.Read,重新授权,并停用发送或写入的工具。
常见错误:401 InvalidAuthenticationToken 表示授权已被撤销或客户端密钥已过期;如有需要填入新密钥,然后再次点击 Authorize with Provider。403 ErrorAccessDenied 表示缺少第 4 步中的某个权限,或该权限未获同意。MailboxNotEnabledForRESTAPI 表示该账户没有 Exchange Online 邮箱(例如本地部署的邮箱或没有许可证的用户)。outlook_get_free_busy 不支持个人 Outlook.com 账户。
连接器不会删除邮件或日历事件,也不处理附件、联系人、邮箱规则、其他用户的邮箱或共享邮箱。
前提条件: 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,选择 Outlook (Microsoft 365 Mail and Calendar) 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
outlook_get_me | Return the signed-in Microsoft 365 or Outlook.com user: id, display name, email address (mail) and user principal name |
outlook_list_mail_folders | List the top-level mail folders of the mailbox (Inbox, Sent Items, Drafts, Archive and the user's own folders) with id, displayName… |
outlook_list_child_folders | List the subfolders of one mail folder, with the same fields as outlook_list_mail_folders |
outlook_list_messages | List the messages of one mail folder, newest first unless orderby says otherwise |
outlook_search_messages | Search or filter messages across the whole mailbox, all folders included (Deleted Items too) |
outlook_get_message | Get one message in full: subject, sender, all recipients, dates, flags, conversationId, internetMessageId, attachments flag and the body as… |
outlook_create_draft | Create a draft message in the Drafts folder without sending it |
outlook_send_draft | Send an existing draft (from outlook_create_draft or one written in Outlook) |
outlook_send_mail | Compose and send a new email in one step, from the signed-in mailbox |
outlook_reply_to_message | Reply to the sender of a message (or to its Reply-To addresses) and send the reply at once, quoting the original below the comment |
outlook_reply_all_to_message | Reply to the sender and every other recipient of a message and send the reply at once, quoting the original below the comment |
outlook_move_message | Move a message to another mail folder (for example to archive it or file it in a project folder) |
outlook_list_calendars | List the user's calendars with id, name, color, owner, whether it is the default calendar and whether the user can edit it |
outlook_list_events | List the events of the default calendar that fall within a time range, with recurring meetings expanded into their single occurrences |
outlook_list_calendar_events | List the events of one specific calendar (a shared, secondary or team calendar) within a time range, with recurring meetings expanded |
outlook_get_event | Get one calendar event in full: subject, body (HTML), start and end, location, organizer, attendees with their responses, recurrence… |
outlook_create_event | Create an event in the user's default calendar |
outlook_update_event | Change an existing event: only the fields given are changed, the others stay as they are |
outlook_get_free_busy | Get free/busy availability of up to several people, rooms or distribution lists in the same organisation for a time window, to find a slot… |
下一步
这份指南对你有帮助吗?