io.github.sapientsai/microsoft365-mcp-server
Microsoft 365 via Graph — mail, calendar, contacts, files, Teams, Planner, OneNote, To Do.
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
microsoft365-mcp-serverclaude 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
{
"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>"
}
}
}
}
متغيرات البيئة
MS365_CLIENT_IDإلزامي Azure AD application (client) ID. Every mode except client-token needs it.MS365_TENANT_IDAzure AD tenant ID, or 'common'/'organizations'/'consumers'. Read by certificate, client-secret and oauth-proxy modes.MS365_CLIENT_SECRETسري Azure AD client secret (client-secret mode).MS365_CERT_PATHPath to the certificate used by certificate mode.MS365_CERT_PASSWORDسري Password for the certificate at MS365_CERT_PATH, if it has one.MS365_ACCESS_TOKENسري A Graph access token supplied directly (client-token mode).MS365_AUTH_MODEAuth mode: interactive (default), certificate, client-secret, client-token or oauth-proxy.MS365_OAUTH_BASE_URLBase URL of the OAuth proxy (oauth-proxy mode).MS365_READ_ONLYSet to 'true' to expose read-only tools and refuse every write.MS365_ENABLED_TOOLSCase-insensitive regular expression matched against tool names; only matching tools are registered. Not a comma-separated list.MS365_PRESETSComma-separated tool presets to enable instead of naming tools individually.MS365_ORG_MODESet to 'true' for organisation-wide (application-permission) behaviour.TRANSPORT_TYPETransport: 'stdio' (the default, and what this npm package is listed as) or 'httpStream' for remote/Docker deployments.
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
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_graphpassthrough +microsoft_graph_batch+read_document+sharepoint_search+ optionalazure_ai_search+ a/uploadrelay. Ships as a Docker image atghcr.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.
الأسئلة الشائعة
ما هو io.github.sapientsai/microsoft365-mcp-server؟
Microsoft 365 via Graph — mail, calendar, contacts, files, Teams, Planner, OneNote, To Do.
كيف أثبّت io.github.sapientsai/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 من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج io.github.sapientsai/microsoft365-mcp-server إلى مفتاح API؟
نعم. يتطلب MS365_CLIENT_ID, MS365_CLIENT_SECRET, MS365_CERT_PASSWORD, MS365_ACCESS_TOKEN، وتضبطها في إعداداته.
هل io.github.sapientsai/microsoft365-mcp-server مفتوح المصدر؟
شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.
من يصون io.github.sapientsai/microsoft365-mcp-server؟
ينشره sapientsai. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.