Token导航 LogoToken导航TokenDH.com
Outlook Calendar MCP Server logo
日程管理未说明官方级别未说明来源级核验

Outlook Calendar MCP Server

MCP Server

一个用于与Microsoft Outlook日历集成的Model Context Protocol (MCP)服务器,支持OAuth 2.0认证和Microsoft Graph API。

工具数

5

提示词数

0

GitHub Stars

0

资源数

0
日程管理服务器部署TypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

EmilyThaHuman

提供方

EmilyThaHuman

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Outlook日历MCP服务器

用于Microsoft Outlook日历的模型上下文协议(MCP)服务器,通过Microsoft Graph API与OAuth 2.0身份验证集成。

特性

  • OAuth 2.0身份验证:通过自动令牌刷新保护Microsoft OAuth流
  • MCP协议支持:全面实施模型上下文协议
  • Outlook日历操作:

- 使用高级筛选器搜索事件 - 获取单个事件详细信息 - 批量获取多个事件 - 列出日期范围内的事件 - 获取用户配置文件信息

  • 会话管理:具有自动令牌刷新功能的持久会话
  • TypeScript:完全使用TypeScript类型,以获得更好的开发体验
  • Cloudflare员工:可以部署为Cloudflare Worker进行无服务器操作

先决条件

  • Node.js 18+
  • 启用Microsoft Graph API的Microsoft Azure应用程序注册
  • OAuth 2.0凭据(客户端ID和客户端密钥)

设置

1.Microsoft Azure配置

  1. 首选 Azure门户
  2. 导航至 Azure Active Directory应用程序注册
  3. 点击 新注册
  4. 配置您的应用程序:

- 姓名: Outlook Calendar MCP Server - 支持的帐户类型:根据您的需求进行选择 - 重定向URI: http://localhost:3003/oauth/callback (网络)

  1. 创建后,请注意您的 应用程序(客户端)ID目录(租户)ID
  2. 首选 证书和秘密新客户机密

- 添加描述和过期时间 - 立即复制机密值(您将不会再看到它)

  1. 首选 API权限添加权限

- 选择 Microsoft Graph委托权限 - 添加这些权限: - Calendars.Read - User.Read - 点击 授予管理员同意 (如果您有管理员权限)

2.安装

# Clone or navigate to the project directory
cd outlook-calendar-mcp-server

# Install dependencies
npm install

3.配置

创建一个 .env 根目录中的文件:

cp env.example .env

编辑 .env 根据您的配置:

# Server Configuration
PORT=3003
NODE_ENV=development

# Microsoft OAuth Configuration
MICROSOFT_CLIENT_ID=your_microsoft_client_id_here
MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret_here
MICROSOFT_TENANT_ID=common
MICROSOFT_REDIRECT_URI=http://localhost:3003/oauth/callback

# Frontend URL (where to redirect after OAuth)
FRONTEND_URL=http://localhost:5173

# MCP Server Configuration
MCP_SERVER_NAME=outlook-calendar-mcp-server
MCP_SERVER_VERSION=1.0.0

注: 使用 common 对于多租户应用,或者对于单租户应用,您的特定租户ID。

用法

发展模式

npm run dev

生产模式

# Build
npm run build

# Start
npm start

Cloudflare员工部署

# Create KV namespace for sessions
npm run kv:create

# Update wrangler.toml with the KV namespace ID

# Deploy
npm run deploy

API终点

健康检查

GET /health

OAuth流

1.启动授权

GET /oauth/authorize?userId={userId}&state={state}

答复:

{
  "authorizationUrl": "https://login.microsoftonline.com/...",
  "state": "your-state-value"
}

2.OAuth回调(自动处理)

GET /oauth/callback?code={code}&state={state}

3.刷新令牌

POST /oauth/refresh
Content-Type: application/json

{
  "userId": "user123",
  "refreshToken": "refresh_token_here"
}

4.断开连接

POST /oauth/disconnect
Content-Type: application/json

{
  "userId": "user123"
}

MCP端点

POST /mcp
GET /mcp
DELETE /mcp

MCP端点遵循工具执行的模型上下文协议规范。

MCP工具

1.展望_日历_搜索_事件

使用日期筛选器和其他条件搜索Outlook日历事件。

输入:

{
  "userId": "user123",
  "startDateTime": "2024-01-01T00:00:00",
  "endDateTime": "2024-12-31T23:59:59",
  "subject": "Meeting",
  "location": "Conference Room",
  "category": "Work",
  "top": 20,
  "skip": 0,
  "orderBy": "start/dateTime"
}

输出:

{
  "events": [
    {
      "id": "event123",
      "subject": "Team Meeting",
      "startDateTime": "2024-01-15T10:00:00",
      "endDateTime": "2024-01-15T11:00:00",
      "timeZone": "Pacific Standard Time",
      "location": "Conference Room A",
      "organizer": "organizer@example.com",
      "attendees": [
        {
          "email": "attendee@example.com",
          "name": "John Doe",
          "response": "accepted"
        }
      ],
      "isAllDay": false,
      "webLink": "https://outlook.office365.com/...",
      "onlineMeetingUrl": "https://teams.microsoft.com/..."
    }
  ],
  "count": 1
}

所需范围: Calendars.Read

2.展望_日历_蚀刻_事件

按ID检索单个日历事件的详细信息。

输入:

{
  "userId": "user123",
  "eventId": "event123"
}

输出:

{
  "event": {
    "id": "event123",
    "subject": "Team Meeting",
    "bodyPreview": "Discuss Q4 goals...",
    "startDateTime": "2024-01-15T10:00:00",
    "endDateTime": "2024-01-15T11:00:00",
    "location": "Conference Room A",
    "organizer": "organizer@example.com"
  }
}

所需范围: Calendars.Read

3.展望_日历_蚀刻_事件_批处理

通过ID在一次呼叫中检索多个事件。

输入:

{
  "userId": "user123",
  "eventIds": ["event123", "event456", "event789"]
}

输出:

{
  "events": [
    {
      "id": "event123",
      "subject": "Team Meeting",
      "startDateTime": "2024-01-15T10:00:00",
      "endDateTime": "2024-01-15T11:00:00"
    },
    {
      "id": "event456",
      "subject": "Client Call",
      "startDateTime": "2024-01-16T14:00:00",
      "endDateTime": "2024-01-16T15:00:00"
    }
  ],
  "count": 2
}

所需范围: Calendars.Read

4.展望日历列表事件

列出特定日期范围内的日历事件。

输入:

{
  "userId": "user123",
  "startDateTime": "2024-01-01T00:00:00",
  "endDateTime": "2024-01-31T23:59:59",
  "top": 50,
  "skip": 0
}

输出:

{
  "events": [
    {
      "id": "event123",
      "subject": "Team Meeting",
      "startDateTime": "2024-01-15T10:00:00",
      "endDateTime": "2024-01-15T11:00:00",
      "location": "Conference Room A"
    }
  ],
  "count": 1
}

所需范围: Calendars.Read

5.展望_日历_get.profile

检索当前用户的Microsoft配置文件信息。

输入:

{
  "userId": "user123"
}

输出:

{
  "profile": {
    "id": "user-uuid",
    "displayName": "John Doe",
    "givenName": "John",
    "surname": "Doe",
    "mail": "john.doe@example.com",
    "userPrincipalName": "john.doe@company.com",
    "jobTitle": "Software Engineer",
    "officeLocation": "Building 1",
    "mobilePhone": "+1234567890",
    "businessPhones": ["+0987654321"]
  }
}

所需范围: User.Read

建筑

┌─────────────────┐
│   Frontend      │
│   (ZeroTwo)     │
└────────┬────────┘
         │
         │ OAuth Flow
         ▼
┌─────────────────┐      ┌──────────────────┐
│  Outlook        │◄────►│  Microsoft OAuth │
│  Calendar MCP   │      │  & Graph API     │
│  Server         │      └──────────────────┘
└────────┬────────┘
         │
         │ MCP Protocol
         ▼
┌─────────────────┐
│   Backend       │
│   (ZeroTwoApi)  │
└─────────────────┘

发展

项目结构

outlook-calendar-mcp-server/
├── src/
│   ├── auth/
│   │   └── oauth-manager.ts    # OAuth token management
│   ├── config/
│   │   └── index.ts            # Configuration management
│   ├── outlook/
│   │   └── client.ts           # Microsoft Graph API wrapper
│   ├── mcp/
│   │   ├── server.ts           # MCP server implementation
│   │   └── tools.ts            # MCP tool definitions
│   ├── types/
│   │   └── index.ts            # TypeScript type definitions
│   ├── utils/
│   │   └── logger.ts           # Logging utility
│   ├── index.ts                # Entry point
│   └── worker.ts               # Cloudflare Worker entry point
├── package.json
├── tsconfig.json
├── wrangler.toml
├── env.example
└── README.md

脚本

  • npm run dev -使用热重新加载启动开发服务器
  • npm run dev:worker -启动Cloudflare Workers开发模式
  • npm run build -将TypeScript构建为JavaScript
  • npm run start -启动生产服务器
  • npm run deploy -部署到Cloudflare Workers
  • npm run lint -运行ESLint
  • npm run format -使用Prettier格式化代码

Microsoft Graph API参考

此服务器使用以下Microsoft Graph API终结点:

  • 事件: GET /me/events
  • 单一事件: GET /me/events/{eventId}
  • 批量请求: POST /$batch
  • 用户档案: GET /me

有关更多信息,请参见 Microsoft Graph Calendar API文档.

安全考虑

  1. OAuth令牌:令牌存储在内存(Node.js)或KV(Cloudflare Workers)中。对于生产,考虑加密存储。
  2. 跨域资源共享:为生产适当配置CORS源。
  3. 超文本传输安全协议:在生产环境中始终使用HTTPS进行安全通信。
  4. 环境变量:从不承诺 .env 文件夹。在生产中使用安全的秘密管理。
  5. 速率限制:对生产部署实施速率限制。
  6. 租户ID:使用特定的租户ID,而不是 common 对于单租户应用程序。

故障排除

OAuth错误

  • “缺少必需的环境变量”:检查您的 .env 文件包含所有必需的变量
  • “交换授权码失败”:在Azure门户中验证您的重定向URI是否完全匹配
  • “令牌已过期”:如果刷新令牌可用,服务器会自动刷新令牌
  • “AADST50011:请求中指定的回复URL不匹配”:确保Azure中的重定向URI与您的配置匹配

MCP连接问题

  • “没有有效的会话ID”:确保MCP客户端发送正确的会话标头
  • “需要身份验证”:用户需要先完成OAuth流程

Microsoft Graph API错误

  • “401未经授权”:令牌可能已过期或无效。尝试重新验证。
  • “403禁止”:检查是否授予了所有必需的权限,并提供了管理员同意。
  • “404未找到”:验证事件ID或资源是否存在。

Microsoft Graph API范围

此服务器需要以下Microsoft Graph作用域:

范围类型描述需要管理员同意
Calendars.Read委派读取用户日历
User.Read委派读取用户配置文件

与ZeroTwo集成

要将此Outlook日历MCP服务器与ZeroTwo应用程序集成,请执行以下操作:

1.添加OAuth提供程序配置

为Outlook日历创建新的OAuth提供程序配置:

// In your OAuth providers configuration
outlook_calendar: {
  provider: "outlook_calendar",
  clientId: import.meta.env.VITE_MICROSOFT_CLIENT_ID,
  flowType: OAuthFlowType.REDIRECT,
  scopes: [
    "https://graph.microsoft.com/Calendars.Read",
    "https://graph.microsoft.com/User.Read",
  ],
  authEndpoint: "http://localhost:3003/oauth/authorize",
  backendExchangeEndpoint: "/api/auth/outlook/callback",
  backendRefreshEndpoint: "/api/auth/outlook/refresh",
  mcpEnabled: true,
  mcpEndpoint: "http://localhost:3003/mcp",
}

2.更新MCP客户端

将Outlook日历支持添加到MCP客户端配置中。

3.后端集成

创建后端端点来处理OAuth回调和令牌管理,将令牌存储在用户配置文件中。

许可证

麻省理工学院

贡献

欢迎投稿!请随时提交拉取请求。

支持

对于问题和疑问:

______________________________________________________________________

由ZeroTwo提供技术支持

此Outlook日历MCP连接器是 ZeroTwo人工智能平台 --一体化的人工智能工作区,让您通过GPT-5、Claude和Gemini安排会议、管理事件并自动化您的Microsoft日历。

🌐 ZeroTwo——一个应用程序中的所有AI模型使用GPT-5、Claude和Gemini管理您的Outlook日历,所有这些都在一个AI工作区中。
零两个功能人工智能日程安排、电子邮件起草、网络搜索和MCP支持的Microsoft 365工具。
🤖 人工智能模型——GPT-5、克劳德和双子座使用世界上最好的人工智能预订会议、查找可用性和管理时间。
🔌 ZeroTwo连接器和集成将Outlook日历、Gmail、团队、SharePoint等连接到您的AI工作流程。
💰 零二定价一个替代ChatGPT Plus、Claude Pro和Gemini Advanced的订阅。
📝 ZeroTwo博客AI生产力提示、Microsoft 365指南和ZeroTwo产品更新。
🚀 免费试用ZeroTwo让AI管理您的Outlook日程安排——立即免费开始。
专为ZeroTwo打造 --使用此Outlook日历MCP服务器 ZeroTwo的AI连接器系统 通过人工智能助手中的自然语言创建事件、检查日程安排和管理会议。

目录标签

目录标签

日程管理服务器部署TypeScriptClaude日历管理本地部署OAuth认证MicrosoftGraph

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明oauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP