Ms Calendar Mcp

io.github.0xka13b由 GitHub 账号 0xka13b 发布v1.0.1更新于 Oct 24, 2026

Microsoft Calendar (Outlook Calendar) MCP server for managing events via Microsoft Graph.

已验证STDIO仅桌面效率与工作流沟通与协作

概览

AI 生成的概览

一个本地 MCP 服务器,让助手通过 Microsoft Graph API 读取和管理 Microsoft Outlook 日历事件。

可以做什么
列出并读取日历事件,包括按 ID 获取单个事件,均通过 Microsoft Graph v1.0 封装实现。创建、更新和删除日历事件,写操作工具会标记为破坏性以便客户端确认。用 Microsoft 账户登录一次后,服务器会自动刷新令牌供后续会话使用。也可选用 Streamable HTTP 传输,以每次请求的 bearer 令牌代替 stdio。
适用场景
当你希望 AI 助手查看、安排或修改你自己的 Microsoft 365 / Outlook 日历事件时使用,例如在桌面 MCP 客户端中起草会议变更或查看近期日程。
运行要求
以 Node.js(>= 20)本地进程运行,通常通过 npx 启动。需要一个 Microsoft Entra ID 应用注册(免费),其客户端 ID 填入 MICROSOFT_CLIENT_ID,并授予委托权限 Calendars.ReadWrite 和 User.Read,还需执行一次登录命令以缓存刷新令牌。可选变量包括 MICROSOFT_TENANT_ID、MICROSOFT_ACCESS_TOKEN、MICROSOFT_MCP_CACHE_DIR、MCP_TRANSPORT 和 PORT。
安装前请注意
服务器以你的身份拥有日历读写权限,工具可创建、修改和删除真实事件。它会在令牌缓存目录中保存刷新令牌,若泄露 MICROSOFT_ACCESS_TOKEN 或 HTTP bearer 令牌即可访问 Graph。只授予所需权限,并在确认写操作前仔细检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ms Calendar Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Outlook]  [Calendar]  [OneDrive]  [SharePoint]  [Contacts]

Microsoft MCP

Model Context Protocol servers for Microsoft 365.
Calendar · Contacts · OneDrive · Outlook · SharePoint — on the official @modelcontextprotocol/sdk, over stdio or Streamable HTTP.

[CI] [coverage] [license: MIT] [node] [MCP SDK]

Each server speaks the real MCP protocol and runs over either transport:

  • stdio — for local MCP clients that launch the server as a subprocess (Claude Desktop, IDEs, the MCP Inspector).
  • Streamable HTTP — for remote/hosted use, with the Microsoft Graph access token supplied per request via Authorization: Bearer.

Servers

Servernpm package (and binary)Tools
[图片]Calendarms-calendar-mcp9
[图片]Contactsms-contacts-mcp7
[图片]OneDrivems-onedrive-mcp9
[图片]Outlookmicrosoft-outlook-mcp14
[图片]SharePointms-sharepoint-mcp23

All tools are thin wrappers over the Microsoft Graph v1.0 API.

Layout

microsoft-mcp/├── apps/                       # one MCP server per Microsoft 365 product│   ├── calendar/│   ├── contacts/│   ├── onedrive/│   ├── outlook/│   └── sharepoint/│       └── src/│           ├── tools.ts        # declarative tool definitions (schema + handler)│           └── index.ts        # run({ name, version }, tools)└── packages/                   # shared building blocks    ├── core/                   # MCP server bootstrap + dual transport (stdio / HTTP)    ├── graph/                  # Microsoft Graph HTTP client    ├── validation/             # id / path / query sanitizers    └── logger/                 # structured JSON logging (stderr-only — stdio-safe)

A server is just a list of tools handed to run():

ts
// apps/calendar/src/index.tsimport { run } from "@microsoft-mcp/core";import { tools } from "./tools.js";
void run({ name: "microsoft-calendar", version: "1.0.0", title: "Microsoft Calendar" }, tools);
ts
// a single tooldefineTool({  name: "get_event",  description: "Get a single calendar event by ID.",  inputSchema: { event_id: z.string().describe("Event ID") },  confirmationPolicy: "never",  handler: ({ graph }, { event_id }) => {    validateId(event_id, "event_id");    return graph.request("GET", `/me/events/${event_id}`);  },});

confirmationPolicy ("always" for mutating/destructive tools, "never" for read-only) is surfaced to clients as MCP readOnlyHint / destructiveHint annotations.

Requirements

  • Node.js >= 20
  • pnpm 10 (corepack enable)

Setup

bash
pnpm installpnpm build        # build all servers (turbo) -> apps/*/dist/index.jspnpm check-types  # typecheck everything

Tests & CI

bash
pnpm test            # run the vitest suite oncepnpm test:watch      # watch modepnpm test:coverage   # run with a v8 coverage report (-> coverage/)

Tests live next to the code as *.test.ts and run on TypeScript source directly (no build step). The shared packages/* are covered by unit and integration tests — including a full Streamable-HTTP round-trip against a live server — and CI enforces a coverage floor on them. Each apps/* server ships an invariant suite that locks its tool surface (unique snake_case names, valid schemas and confirmation policies).

Every push and pull request to master runs CI: typecheck → build → tests with coverage. The coverage badge is regenerated from the run.

Authentication

You sign in once with your Microsoft account; the server then caches a refresh token and acquires access tokens silently from then on — no pasting, no 1-hour expiry. Sign-in uses your own Microsoft Entra ID app registration (free) so the servers act on your behalf.

1. Register an Entra ID app (one time)

  1. Azure Portal → Microsoft Entra ID → App registrations → New registration. Name it anything; pick the Supported account types that fit (single-tenant, multi-tenant, and/or personal accounts).

  2. Authentication → Add a platform → Mobile and desktop applications → add redirect URI http://localhost, and set Allow public client flows to Yes (enables the --device-code fallback).

  3. API permissions → Add a permission → Microsoft Graph → Delegated permissions → add the scopes for the servers you use (then Grant admin consent if your tenant requires it):

    ServerDelegated scopes
    CalendarCalendars.ReadWrite
    ContactsContacts.ReadWrite
    OneDriveFiles.ReadWrite.All
    OutlookMail.ReadWrite, Mail.Send
    SharePointSites.ReadWrite.All

    All servers also use User.Read. (offline_access is requested automatically for refresh.)

  4. Copy the Application (client) ID.

2. Sign in (one time per machine)

Set MICROSOFT_CLIENT_ID, then run the server's login command. A browser opens; after you consent, the token is cached under ~/.config/microsoft-mcp/:

bash
export MICROSOFT_CLIENT_ID=<your-client-id>
npx -y ms-calendar-mcp login           # opens the browsernpx -y ms-calendar-mcp login --device-code   # headless: shows a code to enter

From then on the server refreshes tokens automatically. Use a non-default tenant with MICROSOFT_TENANT_ID (default common).

Advanced: supply your own token

To bypass the built-in flow, supply a pre-acquired Graph token directly:

  • stdio: set MICROSOFT_ACCESS_TOKEN (takes precedence over the cached sign-in). Good for quick tests — mint one with az account get-access-token --resource https://graph.microsoft.com --query accessToken -o tsv.
  • HTTP: send Authorization: Bearer <token> on each POST /mcp request. Each request is stateless with its own token, so callers never share credentials — this is the model for hosted/remote deployments, which handle their own auth.

Running

stdio (e.g. Claude Desktop)

Each server is published to npm and runnable with npx — no clone or build. Sign in once first (npx -y ms-calendar-mcp login, see Authentication), then:

jsonc
// claude_desktop_config.json{  "mcpServers": {    "microsoft-calendar": {      "command": "npx",      "args": ["-y", "ms-calendar-mcp"],      "env": { "MICROSOFT_CLIENT_ID": "<your-client-id>" }    }  }}

Or point at a local build instead of npm:

jsonc
{  "command": "node",  "args": ["/abs/path/microsoft-mcp/apps/calendar/dist/index.js"],  "env": { "MICROSOFT_CLIENT_ID": "<your-client-id>" }}

During development you can skip the build and run the TypeScript directly:

bash
MICROSOFT_ACCESS_TOKEN=<token> pnpm --filter ms-calendar-mcp dev

Streamable HTTP

bash
# build first, then:PORT=3000 node apps/calendar/dist/index.js --http# or, in dev:pnpm --filter ms-calendar-mcp dev -- --http --port 3000

The server exposes POST /mcp (the MCP endpoint) and GET /healthz. Point any Streamable-HTTP MCP client at http://localhost:3000/mcp with an Authorization: Bearer header.

Transport selection

Resolved in this order: --stdio / --http flag → MCP_TRANSPORT=stdio|http → default stdio. HTTP port: --port <n> → PORT → 3000.

Environment variables

VariableUsed byDescription
MICROSOFT_CLIENT_IDstdioEntra ID app (client) ID for sign-in. Required for the login flow.
MICROSOFT_TENANT_IDstdioTenant for sign-in: common (default), organizations, consumers, or a tenant ID.
MICROSOFT_ACCESS_TOKENstdioPre-acquired Graph token; overrides the cached sign-in when set.
MICROSOFT_MCP_CACHE_DIRstdioOverride the token-cache directory (default ~/.config/microsoft-mcp).
MCP_TRANSPORTbothstdio (default) or http.
PORThttpListen port (default 3000).
MCP_HTTP_BODY_LIMIThttpMax request body size (default 50mb) for base64 uploads.
MCP_DEBUGbothAny non-empty value enables debug logs (to stderr).

来源:README.md,提交 3791c27

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分