MCP Microsoft Office 桥接器のロゴ

MCP Microsoft Office 桥接器

コミュニティ
Aanerud

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

公開者Aanerud
リポジトリMCP-Microsoft-Office
言語JavaScript
フォーク
10
スター
55
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    MCP Microsoft Office 桥接器は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには55件のスターと10件のフォークがあります。

MseeP.ai Security Assessment Badge

MCP Microsoft Office

One MCP server. Multiple users. Real Microsoft 365 traffic on your test tenant.


The Problem

Test tenants sit empty. Static test data does not exercise real workflows. When you need agents that send real emails, schedule real meetings, and collaborate in real Teams channels, mocks and stubs fall short.

What This Solves

This project connects any MCP-compatible AI client to Microsoft 365 through the Graph API. Each agent authenticates as a distinct tenant user and performs real operations against real data.

  • 117 tools across 12 modules: Mail, Calendar, Files, Excel, Word, PowerPoint, Teams, Contacts, To-Do, Groups, People, Search
  • Multi-user: one server supports your entire team, each with isolated data
  • Real Graph API calls: every operation hits the actual tenant, not a mock
  • Secure: tokens encrypted at rest, no credentials stored on third-party servers

Architecture

                    ┌──────────────────┐
                    │  MCP Client      │
                    │  (Claude, etc.)  │
                    └────────┬─────────┘
                             │ JSON-RPC (stdin/stdout)
                    ┌────────▼─────────┐
                    │  MCP Adapter     │
                    │  (runs locally)  │
                    └────────┬─────────┘
                             │ HTTP + Bearer Token
                    ┌────────▼─────────┐
                    │  MCP Server      │
                    │  (local or       │
                    │   remote)        │
                    └────────┬─────────┘
                             │ Microsoft Graph API
                    ┌────────▼─────────┐
                    │  Microsoft 365   │
                    │  (your tenant)   │
                    └──────────────────┘

Three parts:

  1. MCP Client -- the AI you interact with
  2. MCP Adapter -- a Node.js process that translates MCP protocol to HTTP requests (runs on the same machine as the client)
  3. MCP Server -- handles authentication and calls the Microsoft Graph API (runs locally or on a remote server)

Permissions

The server requires 18 Microsoft Graph delegated permissions. Twelve work without admin consent. Six require a tenant administrator to grant consent.

No Admin Consent Required

PermissionTools Unlocked
User.ReadAuthentication, user profile
Mail.ReadWritereadMail, readMailDetails, markEmailRead, flagMail, getMailAttachments, addMailAttachment, removeMailAttachment
Mail.SendsendMail, replyToMail
Calendars.ReadWritegetEvents, createEvent, updateEvent, cancelEvent, acceptEvent, tentativelyAcceptEvent, declineEvent, getAvailability, findMeetingTimes, getRooms, getCalendars, addAttachment, removeAttachment
Files.ReadWrite.AlllistFiles, uploadFile, downloadFile, getFileMetadata, getFileContent, setFileContent, updateFileContent, createSharingLink, getSharingLinks, removeSharingPermission, listChannelFiles, uploadFileToChannel, readChannelFile, all Excel workbook tools, all Word/PowerPoint tools
Contacts.ReadWritelistContacts, getContact, createContact, updateContact, deleteContact, searchContacts
Tasks.ReadWritelistTaskLists, getTaskList, createTaskList, updateTaskList, deleteTaskList, listTasks, getTask, createTask, updateTask, deleteTask, completeTask
Chat.ReadWritelistChats, createChat, getChatMessages, sendChatMessage
Channel.ReadBasic.AlllistTeamChannels, getChannelMessages
ChannelMessage.SendsendChannelMessage, replyToMessage
Channel.CreatecreateTeamChannel
OnlineMeetings.ReadWritecreateOnlineMeeting, getOnlineMeeting, listOnlineMeetings, getMeetingByJoinUrl

Requires Admin Consent

PermissionAdditional Tools Unlocked
User.Read.AllResolve user IDs across Teams, People search
People.Read.AllfindPeople, getRelevantPeople, getPersonById
Group.Read.AlllistGroups, getGroup, listGroupMembers, listMyGroups
ChannelMember.ReadWrite.AlladdChannelMember
ChannelMessage.Read.AllRead channel message history
OnlineMeetingTranscript.Read.AllgetMeetingTranscripts, getMeetingTranscriptContent

Without admin consent, you get Mail, Calendar, Files, Excel workbooks, Word documents, PowerPoint presentations, Contacts, To-Do, Chat, and basic Teams channel operations. With admin consent, you add People directory search, Groups, channel member management, and meeting transcripts.


Quick Start

Prerequisites

  • Node.js 18+ (download)
  • Claude Desktop (download) or another MCP client
  • Microsoft 365 account (work, school, or personal)

Step 1: Azure App Registration

  1. Go to Azure Portal > Microsoft Entra ID > App registrations > New registration
  2. Name it MCP-Microsoft-Office, register with your preferred account type
  3. Copy the Application (client) ID and Directory (tenant) ID
  4. Go to API permissions > Add a permission > Microsoft Graph > Delegated permissions
  5. Add the 18 permissions listed above
  6. If you are a tenant admin, click Grant admin consent
  7. Go to Authentication > Add a platform > Web
    • Redirect URI: http://localhost:3000/api/auth/callback
    • Enable Allow public client flows

Step 2: Clone and Configure

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

Copy .env.example to .env and fill in your Azure app details:

MICROSOFT_CLIENT_ID=your-client-id
MICROSOFT_TENANT_ID=your-tenant-id

Step 3: Start the Server and Authenticate

bash
npm run dev:web

Open http://localhost:3000 in your browser. Click Login with Microsoft, sign in, and grant permissions. Then click Generate MCP Token and copy the token.

Step 4: Configure Claude Desktop

Edit your Claude Desktop config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Claude Desktop has a practical limit of ~55 tools per MCP server. This project exposes 117 tools, so we split them across three servers that share the same adapter and backend:

json
{
  "mcpServers": {
    "microsoft-365": {
      "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",
        "MCP_MODULES": "search,mail,calendar,files,people,contacts,groups,query"
      }
    },
    "microsoft-365-teams": {
      "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",
        "MCP_MODULES": "teams,todo"
      }
    },
    "microsoft-365-office": {
      "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",
        "MCP_MODULES": "excel,word,powerpoint,files"
      }
    }
  }
}

MCP_MODULES filters which modules the adapter exposes. Omit it to expose all 117 tools (works with clients that have no tool cap).

Set MCP_DEBUG=1 in the env block to enable diagnostic logging to stderr — useful for troubleshooting tool dispatch issues.

Restart Claude Desktop. Ask: "What's on my calendar today?" or "Create an Excel workbook with a budget table."


Tools (117)

Mail (9)

ToolDescription
readMailRead inbox messages
sendMailSend an email
replyToMailReply to an email
readMailDetailsGet full email content
markEmailReadMark email as read/unread
flagMailFlag or unflag an email
getMailAttachmentsList email attachments
addMailAttachmentAdd attachment to email
removeMailAttachmentRemove attachment from email

Calendar (13)

ToolDescription
getEventsGet calendar events
createEventCreate a meeting or event
updateEventModify an existing event
cancelEventCancel an event
acceptEventAccept a meeting invitation
tentativelyAcceptEventTentatively accept
declineEventDecline a meeting invitation
getAvailabilityCheck free/busy times
findMeetingTimesFind optimal meeting slots
getRoomsFind meeting rooms
getCalendarsList all calendars
addAttachmentAdd attachment to event
removeAttachmentRemove event attachment

Files (10)

ToolDescription
listFilesList OneDrive files
uploadFileUpload a file
downloadFileDownload a file
getFileMetadataGet file info
getFileContentRead file contents
setFileContentWrite file contents
updateFileContentUpdate existing file
createSharingLinkCreate a sharing link
getSharingLinksList sharing links
removeSharingPermissionRemove sharing access

Excel (30)

Work directly with Excel workbooks stored in OneDrive or SharePoint — no file download needed. All operations go through Microsoft Graph's workbook API with transparent session management.

ToolDescription
createWorkbookSessionOpen a workbook session (persistent or temporary)
closeWorkbookSessionClose an active workbook session
listWorksheetsList all worksheets in a workbook
addWorksheetAdd a new worksheet
getWorksheetGet a worksheet by name or ID
updateWorksheetRename, reposition, or hide a worksheet
deleteWorksheetDelete a worksheet
getRangeRead cell values, formulas, and formatting
updateRangeWrite values to a cell range
getRangeFormatGet formatting (font, fill, borders)
updateRangeFormatSet formatting (bold, colors, number formats)
sortRangeSort cells in a range
mergeRangeMerge cells
unmergeRangeUnmerge cells
listTablesList all tables in a worksheet
createTableCreate a table from a range
updateTableRename or restyle a table
deleteTableDelete a table
listTableRowsList all rows in a table
addTableRowAdd a row to a table
deleteTableRowDelete a row by index
listTableColumnsList all columns in a table
addTableColumnAdd a column to a table
deleteTableColumnDelete a column
sortTableSort a table by column
filterTableApply a filter to a table column
clearTableFilterClear a column filter
convertTableToRangeConvert a table back to a plain range
callWorkbookFunctionCall any of 300+ Excel functions (SUM, VLOOKUP, PMT, etc.)
calculateWorkbookRecalculate all formulas

Word (5)

Create, read, and convert Word documents. Documents are created from structured JSON and stored in OneDrive. Reading uses a multi-library fallback chain: mammoth (best HTML for .docx) → word-extractor (handles both .doc and .docx) → webUrl fallback. Binary downloads use the Graph beta /contentStream endpoint for reliable binary transfer.

ToolDescription
createWordDocumentCreate a .docx from structured content (headings, paragraphs, tables, lists, images)
readWordDocumentRead a document as HTML and plain text
getWordDocumentMetadataGet title, author, dates, keywords
getWordDocumentAsHtmlConvert document content to HTML
convertDocumentToPdfConvert a Word document to PDF

Note: Some SharePoint tenants convert uploaded .docx files to OLE2 binary format within seconds of upload. When this happens, client-side parsing libraries cannot read the file. The server gracefully falls back to returning the webUrl so the user can open the document in the browser.

PowerPoint (4)

Create, read, and convert PowerPoint presentations. Presentations are built from structured slide data and stored in OneDrive. Reading uses Graph HTML conversion with jszip fallback for slide-level text extraction.

ToolDescription
createPresentationCreate a .pptx with title, content, and blank slides
readPresentationRead slide content (text elements per slide)
getPresentationMetadataGet title, author, slide count, dates
convertPresentationToPdfConvert a presentation to PDF

Teams (21)

ToolDescription
listChatsList Teams chats
createChatCreate a new chat
getChatMessagesRead chat messages
sendChatMessageSend a chat message
listJoinedTeamsList your teams
listTeamChannelsList team channels
createTeamChannelCreate a channel
addChannelMemberAdd member to channel
getChannelMessagesRead channel messages
sendChannelMessagePost to a channel
replyToMessageReply to a channel message
listChannelFilesList files in a channel
uploadFileToChannelUpload file to channel
readChannelFileRead a channel file
createOnlineMeetingCreate a Teams meeting
getOnlineMeetingGet meeting details
listOnlineMeetingsList online meetings
getMeetingByJoinUrlFind meeting by join URL
getMeetingTranscriptsGet meeting transcripts
getMeetingTranscriptContentRead transcript content

(Note: addChannelMember applies to private channels only. Standard channels auto-include all team members.)

Contacts (6)

ToolDescription
listContactsList contacts
getContactGet contact details
createContactCreate a contact
updateContactUpdate contact info
deleteContactDelete a contact
searchContactsSearch contacts

To-Do (11)

ToolDescription
listTaskListsList task lists
getTaskListGet a task list
createTaskListCreate a task list
updateTaskListRename a task list
deleteTaskListDelete a task list
listTasksList tasks
getTaskGet task details
createTaskCreate a task
updateTaskUpdate a task
deleteTaskDelete a task
completeTaskMark task complete

Groups (4)

ToolDescription
listGroupsList Microsoft 365 groups
getGroupGet group details
listGroupMembersList group members
listMyGroupsList your groups

People (3)

ToolDescription
findPeopleSearch the directory
getRelevantPeopleGet frequent contacts
getPersonByIdGet person details

Search (1)

ToolDescription
searchUnified search across emails, files, events, and chat messages

Multi-User

Each user authenticates independently. The server isolates all data by user identity.

  Alice (alice@contoso.com)          Bob (bob@contoso.com)
  ├─ Her own Microsoft tokens        ├─ His own Microsoft tokens
  ├─ Her own session                  ├─ His own session
  └─ Claude Desktop (her laptop)     └─ Claude Desktop (his PC)

              Complete data isolation.
         Alice never sees Bob's data.

For automated testing with multiple agents, use the ROPC (Resource Owner Password Credentials) flow to authenticate programmatically:

bash
# Start the server
npm run dev:web

# Run the E2E test suite (authenticates 3 users via ROPC)
node tests/run-all.cjs

The test suite authenticates multiple users, then exercises all 117 tools across 12 modules plus 5 cross-module workflows. See tests/ for the full implementation.


E2E Test Suite

The project includes a comprehensive test suite covering all 117 tools.

bash
# Run all tests (requires server running)
node tests/run-all.cjs

# Run a single module
node tests/run-all.cjs --bucket mail --buckets-only

# Run only workflows
node tests/run-all.cjs --workflows-only

Test structure:

tests/
  lib/           Shared auth, HTTP client, reporter
  buckets/       One file per module (12 files, 117 tools)
  workflows/     Cross-module tests (5 files)
  run-all.cjs    Master runner

Tests authenticate via ROPC (no manual token management) and run in ~100 seconds.


Environment Variables

Copy .env.example to .env and configure:

VariableRequiredDescription
MICROSOFT_CLIENT_IDYesAzure App Client ID
MICROSOFT_TENANT_IDYesAzure Tenant ID
MICROSOFT_REDIRECT_URINoOAuth callback URL (default: http://localhost:3000/api/auth/callback)
DEVICE_REGISTRY_ENCRYPTION_KEYProduction32-byte encryption key for token storage
JWT_SECRETProductionSecret for signing JWT tokens
CORS_ALLOWED_ORIGINSProductionComma-separated allowed origins
PORTNoServer port (default: 3000)
NODE_ENVNodevelopment or production

Deployment

Local (Recommended for Getting Started)

bash
npm install
npm run dev:web

Azure App Service

See docs/azure-deployment.md for CI/CD deployment with GitHub Actions.


Security

  • Encrypted storage: all Microsoft tokens encrypted at rest with AES-256
  • No client secrets: uses public client flow (PKCE) for desktop authentication
  • Token isolation: each user's tokens stored separately with different encryption keys
  • Rate limiting: built-in rate limiting protects against abuse
  • CORS protection: origin allowlist in production
  • Session expiry: sessions expire after 24 hours

Production Checklist

  • Set NODE_ENV=production
  • Set DEVICE_REGISTRY_ENCRYPTION_KEY (32 bytes)
  • Set JWT_SECRET (strong random string)
  • Set CORS_ALLOWED_ORIGINS
  • Use HTTPS with a valid certificate

Project Structure

MCP-Microsoft-Office/
├── mcp-adapter.cjs          MCP protocol adapter (runs locally with Claude Desktop)
├── src/
│   ├── api/                 Express routes and controllers
│   ├── auth/                MSAL authentication (OAuth2, ROPC, token exchange)
│   ├── core/                Services (cache, storage, tools, error handling)
│   ├── graph/               Microsoft Graph API services
│   │   ├── graph-client.cjs   HTTP client with retry, binary support, sessions
│   │   ├── files-service.cjs  OneDrive file operations
│   │   ├── excel-service.cjs  Workbook API (sessions, ranges, tables, functions)
│   │   ├── word-service.cjs   Word create/read (docx + mammoth + word-extractor)
│   │   └── powerpoint-service.cjs  PPT create/read (pptxgenjs + jszip)
│   └── modules/             Feature modules (mail, calendar, excel, word, powerpoint, etc.)
├── public/                  Web UI for authentication
└── tests/                   E2E test suite (gitignored)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License -- see LICENSE file.

インストール

TypingMind
{
  "mcpServers": {
    "mcp-microsoft-office": {
      "command": "node",
      "args": [
        "/path/to/mcp-adapter.cjs"
      ]
    }
  }
}

MCP Microsoft Office 桥接器のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度MCP Microsoft Office 桥接器に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

MCP Microsoft Office 桥接器をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. MCP Microsoft Office 桥接器のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "mcp-microsoft-office": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-web"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMCP Microsoft Office 桥接器のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. MCP Microsoft Office 桥接器のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
MCP Microsoft Office 桥接器を使ってこのタスクを手伝ってもらえますか?
MCP Microsoft Office 桥接器
はい、読みました。
MCP Microsoft Office 桥接器で調べた結果をお伝えします。

よくある質問

MCP Microsoft Office 桥接器 MCPサーバーは何に使いますか?

MCP Microsoft Office 桥接器は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMCP Microsoft Office 桥接器 MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMCP Microsoft Office 桥接器を利用できます。

TypingMindでMCP Microsoft Office 桥接器 MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。MCP Microsoft Office 桥接器を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

MCP Microsoft Office 桥接器 MCPをTypingMindに接続するにはどうすればよいですか?

MCP Microsoft Office 桥接器はTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMCP Microsoft Office 桥接器 MCPのどのようなツールを利用できますか?

MCP Microsoft Office 桥接器はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

MCP Microsoft Office 桥接器 MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。MCP Microsoft Office 桥接器で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇