Get the FREE Ultimate OpenClaw Setup Guide →

MCP-Microsoft-Office

an local MCP server you can run on your env, connecting you to Microsoft Graph, and the complete M365 eco system.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio aanerud-mcp-microsoft-office node /path/to/MCP-Microsoft-Office/mcp-adapter.cjs \
  --env MCP_SERVER_URL="http://localhost:3000" \
  --env MCP_BEARER_TOKEN="<paste-your-token-here>"

How to use

MCP-Microsoft-Office is an MCP server that bridges an AI MCP client to real Microsoft 365 data via the Graph API. Each authenticated user operates as a distinct tenant user, enabling real-world operations such as sending emails, scheduling meetings, sharing files, and collaborating in Teams channels. The server exposes a set of 78 tools across 9 modules (Mail, Calendar, Files, Teams, Contacts, To-Do, Groups, People, and Search). Clients talk to the MCP Server through the MCP Adapter, which translates the MCP protocol into Graph API requests. This setup lets your team run realistic workflows against your own Microsoft 365 tenant while keeping data isolated per user.

To use it, configure an MCP client to connect to the local MCP Server (or a remote server) and authenticate via an OAuth flow set up in the Azure App Registration. The Claude Desktop integration (or any compatible MCP client) communicates with the MCP Adapter over JSON-RPC, then the Adapter makes HTTP calls to Graph API with bearer tokens managed by the server. You’ll supply a bearer token per session, enabling per-user isolation while using real Graph API operations such as reading and sending mail, creating events, reading and writing files, and managing Teams activities.

Common usage flows include starting the server, authenticating a user via the provided web flow, capturing a token, and then configuring your MCP client (e.g., Claude Desktop) to point at the MCP Server URL with the token. Tools you’ll interact with range from readMail and sendMail to getEvents, createEvent, listFiles, uploadFile, and addChannelMessage, among others. Be mindful of permission scopes in Azure AD—the server relies on delegated permissions, some of which require admin consent.

How to install

Prerequisites

  • Node.js 18+ installed on your machine
  • npm or pnpm for package installation
  • A Microsoft 365 account and an Azure App Registration configured for Graph API permissions (as described in the README)

Step 1: Clone the repository

git clone https://github.com/Aanerud/MCP-Microsoft-Office.git
cd MCP-Microsoft-Office

Step 2: Install dependencies

npm install

Step 3: Create and populate environment file

  • Copy the example env file and fill in your Azure app details as described in the Quick Start
cp .env.example .env

Step 4: Start the server (adapter/Node layer)

npm run dev:web

Step 5: Authenticate and obtain a token (as described in the README), then configure your MCP client to use the server URL and token.

Step 6: Configure Claude Desktop (example)

  • In Claude Desktop config, set the mcpServers entry to point to your local server:
{
  "mcpServers": {
    "microsoft365": {
      "command": "node",
      "args": ["/path/to/MCP-Microsoft-Office/mcp-adapter.cjs"],
      "env": {
        "MCP_SERVER_URL": "http://localhost:3000",
        "MCP_BEARER_TOKEN": "paste-your-token-here"
      }
    }
  }
}

Step 7: Restart Claude Desktop and start issuing MCP commands.

Additional notes

Tips and considerations:

  • The server requires 18 Microsoft Graph delegated permissions; some do not require admin consent, while others do. Plan Azure admin consent accordingly.
  • Tokens are stored securely; ensure you configure your environment with strong secrets and use per-user tokens.
  • The MCP Adapter script path (mcp-adapter.cjs) must be accessible by the client configuration; adjust paths in the mcp_config accordingly.
  • If you encounter authentication issues, verify the Azure app registration redirect URI matches your local server setup and that the correct permissions are granted.
  • For multi-user setups, each user should supply a distinct bearer token tied to their own tenant/user to ensure isolation of data.
  • When moving to a remote MCP Server, ensure network security (HTTPS, proper bearer token handling) and consider revocation mechanisms for tokens.

Related MCP Servers

Sponsor this space

Reach thousands of developers