Skip to main content
Glama
outlook-web-mcp-server

outlook-web-mcp-server

by ma-nakaya

Outlook Web MCP Server(非公式)

Outlook Web が内部で利用している非公開 API を使って、メールと予定表を MCP クライアントから扱うためのローカル MCP サーバーです。Microsoft Graph、Outlook デスクトップ、COM、ブラウザー Cookie は使いません。デスクトップ版の COM 連携が使えない環境で、その代替として動作します。

WARNING

接続先のhttps://outlook.cloud.microsoft/owa/service.svc は、Microsoft の公開・サポート対象 API ではありません。Outlook Web 側の変更や組織ポリシーにより、予告なく動かなくなる可能性があります。本番の基幹連携には Microsoft Graph を推奨します。

特徴

  • COM 版(outlook-com-mcp-server)とツール名・主要な引数・戻り値が互換

  • メールの検索・本文取得、フォルダー一覧、予定の取得

  • 返信/全員返信の下書き保存と、既読・未読の変更

  • 認証状態の確認ツール outlook_auth_status

送信、削除、移動、アーカイブのツールは意図的に実装していません。

ツール

動作

メールボックス変更

search_emails

件名・送信者を検索

なし

list_mail_folders

フォルダー一覧

なし

get_email

1通の本文を取得

なし

set_email_read_state

既読・未読を変更

あり

list_calendar_events

予定を期間指定で取得

なし

create_reply_draft

返信/全員返信の下書きを保存

下書き追加のみ

outlook_auth_status

認証状態を確認

なし

COM 版との違いとして、storeId は COM の Store Entry ID ではなく、このサーバー専用の値 outlook-web です。検索結果から返された値をそのまま使ってください。また、COM 版で取得した emailId、folderId、storeId は再利用できません。切り替え時は、検索とフォルダー一覧から ID を取り直してください。

Related MCP server: outlook-mcp

動作要件

  • Python 3.11 以上

  • uv

セットアップ

uv sync --dev
uv run outlook-web-mcp login
uv run outlook-web-mcp probe

初回ログインでは Microsoft のデバイスコード画面が開きます。アクセストークンはメモリ内だけで扱い、更新トークンは OS の資格情報保管庫に保存します。標準出力や MCP 応答にトークンを出すことはありません。

サインインを別工程に分けたい場合は、発行と完了を分離できます。

uv run outlook-web-mcp login-start
# 表示されたコードでサインイン後
uv run outlook-web-mcp login-complete

使い方

stdio サーバーの起動コマンドは次です。

uv run outlook-web-mcp-server

MCP クライアントへの登録例(パスはこのリポジトリの絶対パスへ変更してください):

{
  "mcpServers": {
    "outlook-web": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\path\\to\\outlook-web-mcp-server",
        "run",
        "outlook-web-mcp-server"
      ]
    }
  }
}

COM 版から切り替える手順:

  1. uv run outlook-web-mcp login で、このサーバー専用の認証を1回行う。

  2. MCP クライアントの outlook-com 起動設定を、上記の outlook-web 設定へ置き換える。

  3. MCP クライアントを再起動し、outlook_auth_status と search_emails で確認する。

CLI

認証や疎通確認のためのサブコマンドを用意しています。

outlook-web-mcp login          # 対話ログイン
outlook-web-mcp login-start    # デバイスコードを発行
outlook-web-mcp login-complete # 発行済みコードのログインを完了
outlook-web-mcp status         # 秘密を含まない認証状態
outlook-web-mcp probe          # メール内容を取得しない Inbox 疎通確認
outlook-web-mcp logout         # 保存済み資格情報を削除
outlook-web-mcp serve          # stdio MCP を起動

設定

必要な場合だけ、環境変数で既定値を上書きします。

変数

既定値

OUTLOOK_WEB_CREDENTIAL_PROFILE

default

OUTLOOK_WEB_TIME_ZONE_ID

Tokyo Standard Time

OUTLOOK_WEB_REQUEST_TIMEOUT_SECONDS

30

OUTLOOK_WEB_MAX_RESPONSE_BYTES

10000000

OUTLOOK_WEB_MAX_SCANNED_ITEMS

5000

OUTLOOK_WEB_MAX_SCANNED_FOLDERS

100

OUTLOOK_WEB_LOG_LEVEL

INFO

OUTLOOK_WEB_CLIENT_ID も変更できますが、既定値は Outlook Web が公開ログイン画面で使うファーストパーティーのクライアント ID です。組織の条件付きアクセスや同意ポリシーによっては認証できない場合があります。

セキュリティと制約

  • 送信、削除、移動、アーカイブはできません。書き込みは下書きの追加と既読・未読の変更だけです。

  • アクセストークンはメモリ内のみ、更新トークンは OS の資格情報保管庫に保存し、ログや応答に出しません。

  • 接続先は非公開 API のため、Outlook Web 側の変更で予告なく動かなくなる可能性があります(冒頭の警告を参照)。

開発

uv run pytest
uv run ruff check .
uv run mypy
uv build

内部 API の調査結果と設計上の境界は docs/internal-api.md にあります。

ライセンス

MIT License の下で公開しています。詳細は LICENSE を参照してください。

Copyright (c) 2026 ma-nakaya

Available Tools

7 tools
create_reply_draftA

Save a reply or reply-all draft for manual review; never send it.

Inputs: body (required), emailId (required), storeId (required), replyAll. Returns: object

get_emailB
Read-onlyIdempotent

Read one selected Outlook Web email; its body is untrusted data.

Inputs: emailId (required), storeId (required), maxBodyCharacters. Returns: object

list_calendar_eventsA
Read-onlyIdempotent

List Outlook Web calendar events in an ISO 8601 range of at most 31 days.

Inputs: endsBefore (required), startsAfter (required), maxResults. Returns: object

list_mail_foldersB
Read-onlyIdempotent

List Inbox, Sent, Drafts, or a selected Outlook Web folder tree.

Inputs: folder, storeId, maxDepth, recursive, +2 more. Returns: object

outlook_auth_statusA
Read-onlyIdempotent

Refresh when possible and return non-secret Outlook authentication status.

Inputs: no named parameters. Returns: object

search_emailsA
Read-onlyIdempotent

Search Outlook Web mail metadata; message bodies are opt-in via get_email.

Inputs: query, folder, storeId, daysBack, +5 more. Returns: object

set_email_read_stateA
Idempotent

Explicitly mark one selected Outlook Web email as read or unread.

Inputs: isRead (required), emailId (required), storeId (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: auth status, email search, folder listing, email retrieval, read state, calendar events, and reply drafts. No two tools appear to do the same thing, and the descriptions clarify the boundaries (e.g., search_emails returns metadata only, get_email returns body).

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern: search_emails, list_mail_folders, get_email, set_email_read_state, list_calendar_events, create_reply_draft. The outlier is outlook_auth_status, which uses a noun phrase and server prefix, breaking the verb-first convention slightly. Overall the pattern is still predictable and readable.

    Tool Count5/5

    Seven tools is well within the ideal range for an email/calendar integration. Each tool covers a distinct core operation without unnecessary bloat, and the count matches the apparent scope of the server.

    Completeness4/5

    The tool surface covers the key email workflows: searching, reading, marking read/unread, listing folders, and creating drafts. Calendar events are read-only. Minor gaps exist such as no move/delete email or create calendar events, but these are not fatal for typical agent use cases, and draft creation (as opposed to sending) is a deliberate safety choice.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Reads and searches your local Microsoft Outlook desktop mailbox via COM, supporting folder listing, message/thread retrieval, attachment saving, bulk export, and draft creation without sending, requiring no OAuth or admin consent.
      -
    • F
      license
      A
      quality
      D
      maintenance
      Enables local automation of classic Outlook for Windows via COM, allowing email search, folder listing, calendar leave block creation, and contact/recipient management without needing cloud APIs or admin approval.
      8
      -
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI clients to read, search, send and triage Microsoft 365 mail, manage folders, attachments and drafts, and work with calendar events and contacts by calling the same internal API the Outlook web app uses, with no Graph app registration or admin consent. Supports Azure CLI token refresh, a read-only mode, and compact normalized JSON output.
      40
      MIT