io.github.sapientsai/microsoft365-mcp-server

Official registry Productivity

Microsoft 365 via Graph — mail, calendar, contacts, files, Teams, Planner, OneNote, To Do.

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NPM package microsoft365-mcp-server
Claude Code
claude mcp add microsoft365-mcp-server -e 'MS365_CLIENT_ID=<MS365_CLIENT_ID>' -e 'MS365_TENANT_ID=<MS365_TENANT_ID>' -e 'MS365_CLIENT_SECRET=<your ms365_client_secret>' -e 'MS365_CERT_PATH=<MS365_CERT_PATH>' -e 'MS365_CERT_PASSWORD=<your ms365_cert_password>' -e 'MS365_ACCESS_TOKEN=<your ms365_access_token>' -e 'MS365_AUTH_MODE=<MS365_AUTH_MODE>' -e 'MS365_OAUTH_BASE_URL=<MS365_OAUTH_BASE_URL>' -e 'MS365_READ_ONLY=<MS365_READ_ONLY>' -e 'MS365_ENABLED_TOOLS=<MS365_ENABLED_TOOLS>' -e 'MS365_PRESETS=<MS365_PRESETS>' -e 'MS365_ORG_MODE=<MS365_ORG_MODE>' -e 'TRANSPORT_TYPE=<TRANSPORT_TYPE>' -- npx -y microsoft365-mcp-server@1.2.20
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "microsoft365-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "microsoft365-mcp-server@1.2.20"
            ],
            "env": {
                "MS365_CLIENT_ID": "<MS365_CLIENT_ID>",
                "MS365_TENANT_ID": "<MS365_TENANT_ID>",
                "MS365_CLIENT_SECRET": "<your ms365_client_secret>",
                "MS365_CERT_PATH": "<MS365_CERT_PATH>",
                "MS365_CERT_PASSWORD": "<your ms365_cert_password>",
                "MS365_ACCESS_TOKEN": "<your ms365_access_token>",
                "MS365_AUTH_MODE": "<MS365_AUTH_MODE>",
                "MS365_OAUTH_BASE_URL": "<MS365_OAUTH_BASE_URL>",
                "MS365_READ_ONLY": "<MS365_READ_ONLY>",
                "MS365_ENABLED_TOOLS": "<MS365_ENABLED_TOOLS>",
                "MS365_PRESETS": "<MS365_PRESETS>",
                "MS365_ORG_MODE": "<MS365_ORG_MODE>",
                "TRANSPORT_TYPE": "<TRANSPORT_TYPE>"
            }
        }
    }
}

Environment variables

  • MS365_CLIENT_ID required Azure AD application (client) ID. Every mode except client-token needs it.
  • MS365_TENANT_ID Azure AD tenant ID, or 'common'/'organizations'/'consumers'. Read by certificate, client-secret and oauth-proxy modes.
  • MS365_CLIENT_SECRET secret Azure AD client secret (client-secret mode).
  • MS365_CERT_PATH Path to the certificate used by certificate mode.
  • MS365_CERT_PASSWORD secret Password for the certificate at MS365_CERT_PATH, if it has one.
  • MS365_ACCESS_TOKEN secret A Graph access token supplied directly (client-token mode).
  • MS365_AUTH_MODE Auth mode: interactive (default), certificate, client-secret, client-token or oauth-proxy.
  • MS365_OAUTH_BASE_URL Base URL of the OAuth proxy (oauth-proxy mode).
  • MS365_READ_ONLY Set to 'true' to expose read-only tools and refuse every write.
  • MS365_ENABLED_TOOLS Case-insensitive regular expression matched against tool names; only matching tools are registered. Not a comma-separated list.
  • MS365_PRESETS Comma-separated tool presets to enable instead of naming tools individually.
  • MS365_ORG_MODE Set to 'true' for organisation-wide (application-permission) behaviour.
  • TRANSPORT_TYPE Transport: 'stdio' (the default, and what this npm package is listed as) or 'httpStream' for remote/Docker deployments.

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. microsoft365-mcp monorepo
  2. Packages
  3. Development
  4. History

microsoft365-mcp monorepo

pnpm workspace for the Microsoft Graph MCP servers. Descends from the archived sapientsai/microsoft-mcp-server — split into two focused servers over a shared core. The app-only server keeps the original microsoft-mcp-server name; the delegated server is microsoft365-mcp-server.

Packages

  • packages/microsoft365 — microsoft365-mcp-server, the delegated (OAuth-proxy) MS365 gateway: 40+ tools across mail, calendar, contacts, files, Teams, Planner, OneNote, To Do, and more via Microsoft Graph. Published to npm. See its README and the monorepo DEPLOYMENT.md.
  • packages/graph — microsoft-mcp-server (the original name), a lean app-only (client_credentials) server purpose-built for headless document-RAG: microsoft_graph passthrough + microsoft_graph_batch + read_document + sharepoint_search + optional azure_ai_search + a /upload relay. Ships as a Docker image at ghcr.io/sapientsai/microsoft-mcp-server. See its README.
  • packages/core — @sapientsai/ms-graph-core, the shared plumbing (upload helpers, ticket tokens, OData/pagination, error and auth-strategy types) used by both servers. Internal workspace package, not published.

Pick by auth model: use packages/microsoft365 when a user is present to consent (interactive OAuth); use packages/graph for tenant-wide, headless, app-only deployments.

Development

pnpm install
pnpm validate   # format + lint + test + build across all packages
pnpm build      # build all packages
pnpm test       # test all packages

Per-package commands run inside the package dir, e.g.:

pnpm --filter microsoft365-mcp-server build
pnpm --filter microsoft-mcp-server dev

History

Design context for the split lives in SAI_PLAN_ms-graph-monorepo_2026-06-20.md.

Frequently asked questions

What is io.github.sapientsai/microsoft365-mcp-server?

Microsoft 365 via Graph — mail, calendar, contacts, files, Teams, Planner, OneNote, To Do.

How do I install io.github.sapientsai/microsoft365-mcp-server?

It runs on your machine. In Claude Code: claude mcp add microsoft365-mcp-server -e 'MS365_CLIENT_ID=<MS365_CLIENT_ID>' -e 'MS365_TENANT_ID=<MS365_TENANT_ID>' -e 'MS365_CLIENT_SECRET=<your ms365_client_secret>' -e 'MS365_CERT_PATH=<MS365_CERT_PATH>' -e 'MS365_CERT_PASSWORD=<your ms365_cert_password>' -e 'MS365_ACCESS_TOKEN=<your ms365_access_token>' -e 'MS365_AUTH_MODE=<MS365_AUTH_MODE>' -e 'MS365_OAUTH_BASE_URL=<MS365_OAUTH_BASE_URL>' -e 'MS365_READ_ONLY=<MS365_READ_ONLY>' -e 'MS365_ENABLED_TOOLS=<MS365_ENABLED_TOOLS>' -e 'MS365_PRESETS=<MS365_PRESETS>' -e 'MS365_ORG_MODE=<MS365_ORG_MODE>' -e 'TRANSPORT_TYPE=<TRANSPORT_TYPE>' -- npx -y microsoft365-mcp-server@1.2.20. For other clients, paste the JSON configuration from this page into their MCP settings.

Does io.github.sapientsai/microsoft365-mcp-server need an API key?

Yes. It expects MS365_CLIENT_ID, MS365_CLIENT_SECRET, MS365_CERT_PASSWORD, MS365_ACCESS_TOKEN, which you set in its configuration.

Is io.github.sapientsai/microsoft365-mcp-server open source?

Its code is public on GitHub, but the repository does not declare a standard license.

Who maintains io.github.sapientsai/microsoft365-mcp-server?

It is published by sapientsai. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.