A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Connect Claude Code to Microsoft Agent 365 MCP servers — giving Claude direct access to Outlook Mail, Calendar, Word, Ex
Connect Claude Code to Microsoft Agent 365 MCP servers — giving Claude direct access to Outlook Mail, Calendar, Word, Excel, PowerPoint, Teams, SharePoint, OneDrive, Copilot Search, Knowledge, and User Profile data through the enterprise-grade MCP tooling gateway.
┌─────────────┐ stdio ┌──────────────────┐ HTTPS + Auth ┌─────────────────────────┐
│ Claude Code │ ◄──────────────► │ MCP Proxy Bridge │ ◄──────────────────► │ Agent 365 MCP Servers │
│ (CLI / IDE) │ MCP protocol │ (this project) │ StreamableHTTP │ (Mail, Calendar, Word, │
└─────────────┘ └──────────────────┘ │ Teams, SharePoint...) │
└─────────────────────────┘
The bridge runs as a local stdio MCP server that Claude Code connects to. When Claude calls a tool (e.g. createMessage, getEvents), the bridge authenticates with Azure Entra ID using delegated permissions and forwards the call to the appropriate Agent 365 MCP server — acting on behalf of the signed-in user.
Claude Desktop enforces a 5-second timeout on tools/list requests. Since discovering 14 Agent 365 servers takes ~20 seconds, the bridge uses a two-layer caching strategy to serve tools instantly:
sequenceDiagram
participant User
participant Login as npm run login
participant Disk as ~/.agent365-bridge/
participant Bridge as Bridge Process
participant Claude as Claude Desktop
Note over User,Login: One-time setup
User->>Login: npm run login
Login->>Login: Device code auth
Login->>Disk: auth-record.json
Login->>Login: Discover 14 servers (56 tools)
Login->>Disk: tools-cache.json
Note over Bridge,Claude: Every subsequent launch
Claude->>Bridge: initialize
Bridge->>Disk: Load tools-cache.json
Bridge-->>Claude: initialize response
Claude->>Bridge: tools/list
Bridge-->>Claude: 56 tools (instant, <1ms)
Note over Bridge: Discovery runs in background (~20s)
Claude->>Bridge: tools/call SearchMessages
Note over Bridge: Waits for live discovery if needed
Bridge-->>Claude: Email results
The bridge automatically fixes common MCP compatibility issues:
oneOf, allOf, and anyOf from tool schemas (which Anthropic API rejects), merging properties where possible.GetDocumentContent in both Word and Excel) and automatically namespaces them (e.g. GetDocumentContent_Word) to prevent collisions.While Microsoft provides a rich set of tools for building and managing AI agents, there is currently a "protocol gap" for 3rd-party coding agents like Claude Code:
✅ Production-tested and working — Successfully authenticated and discovered 20+ tools from Microsoft Agent 365 MCP servers (Mail, Excel, Knowledge, and more confirmed).
| Requirement | Purpose |
|---|---|
| Node.js ≥ 18 | Runtime |
| Claude Code CLI | MCP client |
| Frontier Preview | Required for Agent 365 access (enroll here) |
| Azure AD App Registration | Authentication (see setup guide below) |
| A365 CLI (optional) | Agent registration & mock server — requires .NET 8+ |
git clone https://github.com/ITSpecialist111/Agent365-Bridge.git
cd Agent365-Bridge
npm install
npm run build
You need an Azure AD app registration to authenticate with the Agent 365 platform. Follow these steps in the Azure Portal:
Agent365-Claude-Bridge (or any name you prefer)From the app registration Overview page, copy these two values:
| Field | Where to find it | .env variable |
|---|---|---|
| Directory (tenant) ID | Overview page, top section | AZURE_TENANT_ID |
| Application (client) ID | Overview page, top section | AZURE_CLIENT_ID |
Note: If you're only using Claude Code / Claude Desktop with the default Device Code sign-in flow, you can skip this step entirely. The Device Code flow is a public client flow and does not require a client secret.
A client secret is only needed if you plan to:
- Deploy the bridge as an HTTP server with On-Behalf-Of (OBO) auth (
AUTH_MODE=obo)- Use Application permissions with Client Credentials (
AUTH_MODE=client_credentials)
Agent365 Bridge) and choose an expiry periodAZURE_CLIENT_SECRET⚠️ The secret value is only shown once. If you lose it, you'll need to create a new one.
ea9ffc3e-8a23-4a7d-836d-234d7c7565c1)| Permission | Description |
|---|---|
McpServers.Calendar.All | Calendar MCP Server |
McpServers.CopilotMCP.All | Copilot MCP Server |
McpServers.DASearch.All | M365 Copilot Agent Directory |
McpServers.Dataverse.All | Dataverse MCP Server |
McpServers.Excel.All | Excel MCP Server |
McpServers.Files.All | ODSP Files Tool MCP Server |
McpServers.Knowledge.All | Knowledge MCP Server |
McpServers.Mail.All | Mail MCP Server |
McpServers.Me.All | Me MCP Server (User Profile) |
McpServers.OneDriveSharePoint.All | OneDrive & SharePoint MCP Server |
McpServers.PowerPoint.All | PowerPoint MCP Server |
McpServers.SharepointLists.All | SharePoint Lists MCP Server |
McpServers.Teams.All | Teams MCP Server |
McpServers.Word.All | Word MCP Server |
This is required for the device code sign-in flow:
.env fileCreate a .env file in the project root with your credentials:
# Azure Entra ID Authentication
AZURE_TENANT_ID=your-directory-tenant-id
AZURE_CLIENT_ID=your-application-client-id
# Client secret — only needed for OBO (server) or client_credentials mode.
# For the default Device Code flow (Claude Code / Claude Desktop), leave this blank or omit it.
# AZURE_CLIENT_SECRET=your-client-secret-value
# Agent 365 Configuration
MCP_PLATFORM_ENDPOINT=https://agent365.svc.cloud.microsoft
MCP_PLATFORM_AUTHENTICATION_SCOPE=ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default
# Runtime
NODE_ENV=development
Sign in to Microsoft 365 and cache your credentials:
npm run login
You'll be prompted to visit a URL, then tools will be discovered and cached:
Agent 365 Bridge — Sign In & Setup
Step 1: Sign in to Microsoft 365
[agent365-bridge] SIGN IN REQUIRED
[agent365-bridge] Go to: https://microsoft.com/devicelogin
[agent365-bridge] Enter code: XXXXXXXX
✅ Authentication successful!
Credentials cached at: ~/.agent365-bridge/auth-record.json
Step 2: Discovering Agent 365 MCP servers...
✅ Discovered 56 tools across 14 servers
🎉 Setup complete!
Claude Desktop will now load all tools instantly.
To complete sign-in:
Note: This only needs to be done once. Both credentials and the tool list are cached to disk. Tokens refresh automatically on subsequent launches. Run
npm run logoutto clear cached credentials.
For Claude Code (CLI):
npm run register
This registers the bridge as a global MCP server in Claude Code. After this, Agent 365 tools are available in any Claude Code session.
For Claude Desktop, add the bridge to your config file (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"agent365-bridge": {
"command": "node",
"args": ["C:/path/to/your/Agent365/dist/index.js"]
}
}
}
Open Claude Code — Agent 365 tools will appear automatically. Try:
> Search my Outlook inbox for emails about the Q4 report
> Create a new Word document summarizing the project status
> List my upcoming calendar events for this week
> Post a message in the Engineering team channel
> Find files in SharePoint related to the budget
> Create an Excel workbook with monthly revenue data
This bridge complies with the Model Context Protocol (MCP) specification, meaning it can be used with any MCP-compatible client, not just Claude Code CLI.
To use Agent 365 tools inside the Claude Desktop app:
Open your config file:
%APPDATA%\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the bridge configuration:
{
"mcpServers": {
"agent365-bridge": {
"command": "node",
"args": [
"C:/path/to/your/Agent365/dist/index.js"
]
}
}
}
Note: Update the path to match where you cloned this repository.
The bridge connects to all 13 Agent 365 MCP servers:
| Server | Scope | Description |
|---|---|---|
| Outlook Mail | McpServers.Mail.All | Read, compose, send, search, and manage emails |
| Outlook Calendar | McpServers.Calendar.All | Create, view, update, and manage calendar events |
| Word | McpServers.Word.All | Create and read Word documents, add comments |
| Excel | McpServers.Excel.All | Create workbooks, manage spreadsheets |
| PowerPoint | McpServers.PowerPoint.All | Create and modify presentations |
| Teams | McpServers.Teams.All | Chat, channels, and messaging operations |
| OneDrive & SharePoint | McpServers.OneDriveSharePoint.All | File upload, search, and metadata |
| SharePoint Lists | McpServers.SharepointLists.All | List and item CRUD operations |
| Copilot Search | McpServers.CopilotMCP.All | AI-powered search across M365 data |
| Knowledge | McpServers.Knowledge.All | Federated knowledge retrieval |
| User Profile | McpServers.Me.All | Profile, manager, direct reports, user search |
| Files | McpServers.Files.All | ODSP Files tool operations |
| Agent Directory | McpServers.DASearch.All | Copilot Agent Directory search |
| Dataverse | McpServers.Dataverse.All | CRUD operations, FetchXML, and Web API for Dataverse |
| Files | McpServers.Files.All | ODSP Files tool operations |
While this bridge connects Claude to the core Agent 365 infrastructure for action and orchestration, Microsoft also provides WorkIQ, an "intelligence layer" for M365.
| Feature | Agent 365 Bridge (This Project) | Microsoft WorkIQ |
|---|---|---|
| Primary Goal | Action & Automation: Send mail, create docs, update calendar. | Context & Intelligence: "Summarize my meetings regarding X", "What did Sarah say?" |
| Data Scope | 13+ Granular M365 Services (Word, Excel, Teams, etc.) | Federated search across Mail, Teams, and SharePoint. |
| Authentication | Custom App Registration (Device Code by default — no client secret needed). | Microsoft-managed App (requires one-time Tenant Admin consent). |
| Setup Mode | Local Proxy to Remote HTTP Gateway. | Native Local stdio Server. |
For the best experience, we recommend running both servers side-by-side in Claude. This gives Claude "hands" (the bridge) and a "brain" (WorkIQ).
Claude Desktop Configuration (%APPDATA%/Claude/claude_desktop_config.json):
{
"mcpServers": {
"agent365-bridge": {
"command": "node",
"args": ["C:/Path/To/Agent365-Bridge/dist/index.js"]
},
"workiq": {
"command": "npx",
"args": ["-y", "@microsoft/workiq", "mcp"]
}
}
}
[!NOTE] WorkIQ is currently in Public Preview. For setup instructions and admin consent details, visit the official WorkIQ repository.
| Mode | When to use | Config | Client Secret? |
|---|---|---|---|
| Device Code (default) | Claude Code / Desktop with Delegated permissions | Set AZURE_TENANT_ID + AZURE_CLIENT_ID | No — public client flow |
| Client Credentials | Application-type permissions (headless) | Add AUTH_MODE=client_credentials + AZURE_CLIENT_SECRET | Yes |
| OBO (On-Behalf-Of) | HTTP server deployment (Copilot Studio) | Add AUTH_MODE=obo + AZURE_CLIENT_SECRET | Yes |
| Bearer Token | Testing with a pre-acquired token | Set BEARER_TOKEN in .env | No |
| Mock | Local development without Azure | Endpoint set to localhost | No |
├── src/
│ ├── index.ts # Entry point
│ ├── auth/
│ │ ├── token-provider.ts # Device Code / Client Secret / Bearer auth
│ │ └── token-cache.ts # JWT token caching with auto-refresh
│ ├── config/
│ │ ├── configuration.ts # Loads .env + ToolingManifest.json
│ │ └── types.ts # TypeScript interfaces
│ ├── discovery/
│ │ └── server-discovery.ts # Discovers MCP servers (manifest or gateway)
│ └── proxy/
│ ├── mcp-proxy-server.ts # stdio MCP server for Claude Code
│ └── tool-forwarder.ts # Forwards tool calls to remote servers
├── scripts/
│ ├── setup.ts # Interactive setup wizard
│ ├── register-claude.ts # Registers bridge with Claude Code CLI
│ └── start-mock.ts # Starts mock server for development
├── ToolingManifest.json # Declares 13 available MCP servers
├── .mcp.json # Claude Code project-level MCP config
├── .env.example # Environment variable template
├── package.json
└── tsconfig.json
| Script | Description |
|---|---|
npm run build | Compile TypeScript to dist/ |
npm run dev | Run with ts-node (development) |
npm run start | Run compiled output |
npm run setup | Interactive setup wizard |
npm run login | Sign in to M365 and cache credentials (one-time) |
npm run logout | Clear cached credentials |
npm run register | Register bridge with Claude Code CLI |
npm run mock | Start mock server + register |
npm run clean | Remove dist/ directory |
| Error | Cause | Fix |
|---|---|---|
Access denied by Frontier access control | Tenant not enrolled in Frontier preview | Enroll here |
Scope 'McpServers.X.All' is not present | API permissions not added or not consented | Add permissions in Azure Portal → Grant admin consent |
Application not found in directory | Wrong Tenant ID for the app registration | Check the Directory (tenant) ID on the app's Overview page |
AADSTS7000218: request body must contain client_assertion | Public client flows not enabled | Set "Allow public client flows" to Yes in Authentication settings |
Scope doesn't exist on the resource | Manifest scope names don't match Azure API | Update ToolingManifest.json scope names or use /.default |
No authentication configured | Missing credentials in .env | Add AZURE_TENANT_ID and AZURE_CLIENT_ID to .env |
| Tools don't appear in Claude Desktop | Token not cached / timeout | Run npm run login first, then restart Claude Desktop |
Request timed out in MCP logs | Device code sign-in took too long | Run npm run login in terminal first for one-time setup |
dotnet tool install --global Microsoft.Agents.A365.DevTools.Cli --prerelease)Authentication & Liability: This project is an open-source bridge and is not an official Microsoft product. It uses your own Azure AD App Registration and operates under the context of the signed-in user. You are responsible for managing the security of your client secrets and tokens. The maintainers of this repository accept no liability for any data loss, security breaches, or unexpected charges incurred by using this software. Use at your own risk.
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots