Microsoft 365 MCP Server — Teams, SharePoint, Exchange
Deploy an MCP server for Microsoft 365 to manage Teams, SharePoint, Exchange, OneDrive, Entra and Intune with centralized control.
Overview
The Microsoft 365 MCP Server is an open-source implementation of the Model Context Protocol (MCP) tailored for Microsoft 365 workloads. It provides a centralized, API-driven gateway that surfaces Teams, SharePoint, Exchange (Outlook), OneDrive, Entra ID (Azure AD) and Intune capabilities behind a uniform MCP-compatible interface. The server is designed to make Microsoft 365 resources accessible to agent frameworks, LLMs, and automation tools while centralizing authentication, caching, and policy controls.
For developers building AI assistants or automation layers that need structured, context-aware access to Microsoft 365, the MCP server simplifies integration. Rather than wiring multiple Microsoft Graph calls and handling token flows in each agent, you run a single MCP server that consolidates permissions, rate-limits, and transforms Data into the MCP shape expected by downstream models or tools.
Features
- Centralized access to Microsoft 365 services: Teams, SharePoint, Exchange (mail), OneDrive, Entra (Azure AD), Intune
- OAuth2 / Azure AD authentication and token management
- MCP-compatible endpoints to serve model-context data for agents and LLMs
- Configurable scopes and permission filtering per tenant / application
- Optional Docker deployment for portable hosting
- Audit logging and request tracing for governance and debugging
- Extensible architecture: add custom resource adapters or transforms
Installation / Configuration
Below are common steps to get the server running locally or in a container. Adjust variables for your environment and Azure tenant.
- Clone the repository and install dependencies (Node/npm or equivalent — replace with the repo’s specific instructions if different):
# install dependencies (example)
Create a Microsoft Entra (Azure AD) app registration and grant the required Graph permissions. Note the Client (Application) ID, Tenant ID and Client Secret.
Add environment variables (example .env):
# .env
PORT=8080
AZURE_TENANT_ID=your-tenant-id
AZURE_CLIENT_ID=your-client-id
AZURE_CLIENT_SECRET=your-client-secret
MCP_SERVER_BASE_URL=http://localhost:8080
LOG_LEVEL=info
- Run locally:
# or, if the repo provides a binary:
# ./lokka-server
- Run with Docker (example):
- Verify the server is up:
# expected: {"status":"ok"}
Replace the commands with the exact scripts/binaries from the repository if they differ.
Available Resources
Below are the common resource surfaces the MCP server exposes. Endpoint paths are examples; consult the server’s OpenAPI spec or README for exact routes.
| Service | Example MCP Endpoint | Typical Operations |
|---|---|---|
| Teams | /mcp/teams/conversations | list channels, read messages, post messages |
| SharePoint | /mcp/sharepoint/sites/{id}/drive | list files, fetch metadata |
| Exchange (Mail) | /mcp/exchange/mailfolders/{id}/messages | search mail, read/send messages |
| OneDrive | /mcp/onedrive/drive/items/{id} | file download/upload, metadata |
| Entra (Azure AD) | /mcp/entra/users | list/create/update users, groups |
| Intune | /mcp/intune/devices | device inventory, policy assignments |
The server can optionally return model-friendly context payloads (JSON with summarization, indexing data, or embeddings) that are useful for retrieval-augmented generation (RAG) use cases.
Use Cases
AI Assistant for Microsoft Teams: an LLM-driven chatbot that can read recent team messages, summarize threads, and post replies without the assistant needing direct Graph integration. The agent queries the MCP server for a “conversation context” payload and issues commands via MCP endpoints.
Document-aware workflows: automation that scans SharePoint libraries, extracts metadata and text, and provides a contextual summary to a model. The server can handle pagination and caching, presenting a normalized view to the model.
Mail triage and automation: build an assistant that searches mailboxes for items matching policies (e.g., expense receipts), marks them or forwards them. The MCP server encapsulates mailbox access and permission scope.
User provisioning: an admin workflow that creates or updates users and groups in Entra/Azure AD through a single, auditable MCP call instead of multiple Graph operations.
Device compliance orchestration: a management tool that reads Intune device states, applies configurations, and rolls out policies using MCP endpoints with centralized logging and RBAC.
Examples
Fetch a Teams conversation context (example curl):
Search a SharePoint site for documents containing “Q1 report”:
Next Steps
- Review the repository’s OpenAPI or API documentation to learn exact routes, request/response schemas, and authentication modes.
- Configure least-privilege Graph scopes for production use.
- Add monitoring and rate-limiting when exposing the server to public or multi-tenant environments.
This MCP server can simplify integrations between Microsoft 365 and agents or LLM-based applications by centralizing common concerns such as auth, shaping context for models, and consistent access patterns across services.