jpskill.com
💬 コミュニケーション コミュニティ

microsoft-graph-api

Microsoft Graph API を利用して、メールの読み込みや送信、予定の確認や作成など、OutlookやOffice 365のメールやカレンダーに関する様々な操作を可能にするSkill。

📜 元の英語説明(参考)

This skill should be used when the user asks to "read my emails", "send an email", "compose email", "check my calendar", "get calendar events", "create a meeting", "schedule an event", "add calendar event", "search emails", "list mail folders", "show unread messages", "what meetings do I have", "fetch emails from Microsoft", "access Outlook", or mentions Microsoft Graph, Office 365 email, or Outlook calendar integration.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Microsoft Graph API を利用して、メールの読み込みや送信、予定の確認や作成など、OutlookやOffice 365のメールやカレンダーに関する様々な操作を可能にするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o microsoft-graph-api.zip https://jpskill.com/download/17552.zip && unzip -o microsoft-graph-api.zip && rm microsoft-graph-api.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17552.zip -OutFile "$d\microsoft-graph-api.zip"; Expand-Archive "$d\microsoft-graph-api.zip" -DestinationPath $d -Force; ri "$d\microsoft-graph-api.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して microsoft-graph-api.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → microsoft-graph-api フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
11

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Microsoft Graph API 連携

Bun 経由で実行される TypeScript スクリプトを通じて、Microsoft 365 のメールとカレンダーにアクセスします。

概要

このスキルは、Microsoft Graph API へのアクセスを提供し、以下の操作を可能にします。

  • メール: メールの一覧表示、読み取り、検索、および送信
  • カレンダー: カレンダーイベントの表示、検索、および作成

すべてのスクリプトは JSON を返し、認証を自動的に処理します。

レスポンス形式

すべてのスクリプトは、一貫した構造を持つ JSON を出力します。

成功

{"status": "success", "data": [...]}

認証が必要

{
  "status": "auth_required",
  "userCode": "ABC123",
  "verificationUri": "https://microsoft.com/devicelogin",
  "expiresAt": "2024-01-15T10:30:00.000Z",
  "message": "To sign in, use a web browser..."
}

auth_required を受信した場合、ユーザーに以下を表示します。

To access your email, please authenticate:
1. Go to: https://microsoft.com/devicelogin
2. Enter code: ABC123

Let me know when you've completed authentication.

その後、同じコマンドを再試行してください。スクリプトは自動的に認証を完了します。

認証保留中

{
  "status": "auth_pending",
  "userCode": "ABC123",
  "verificationUri": "https://microsoft.com/devicelogin",
  "expiresAt": "...",
  "message": "..."
}

ユーザーにはコードが表示されていますが、まだログインが完了していません。認証を完了するように促してください。

エラー

{"status": "error", "error": "Error description"}

メールアクセス

すべてのスクリプトは ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/ にあります。

メールの一覧表示

bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/emails.ts list
bun run emails.ts list --folder "Sent Items" --top 5
bun run emails.ts list --profile work

特定のメールの読み取り

bun run emails.ts read --id AAMkAG...

ID は list コマンドの出力から取得します。

メールの検索

bun run emails.ts search --query "from:boss@company.com"
bun run emails.ts search --query "subject:quarterly report"
bun run emails.ts search --query "hasAttachments:true"

メールフォルダの一覧表示

bun run emails.ts folders

メールの送信

# Simple email
bun run emails.ts send --to "user@example.com" --subject "Hello" --body "Hi there!"

# Multiple recipients with CC
bun run emails.ts send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Team Update" --body "Here's the update..."

# HTML email
bun run emails.ts send --to "user@example.com" --subject "Report" --body "<h1>Monthly Report</h1><p>Details...</p>" --html

# With BCC
bun run emails.ts send --to "team@example.com" --bcc "manager@example.com" --subject "Announcement" --body "..."

カレンダーアクセス

今後のイベントの一覧表示

bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/calendar.ts list
bun run calendar.ts today
bun run calendar.ts week
bun run calendar.ts list --start tomorrow --end +7d

特定のイベントの表示

bun run calendar.ts view --id AAMkAG...

イベントの検索

bun run calendar.ts search --query "team standup"

日付形式

  • 相対: today, tomorrow, +7d, +1m, +1y
  • 絶対: ISO 形式 2024-01-15 または 2024-01-15T14:00:00

カレンダーイベントの作成

# Basic event (1 hour default duration)
bun run calendar.ts create --subject "Team Meeting" --start "2024-01-15T14:00:00"

# Event with end time
bun run calendar.ts create --subject "Workshop" --start "2024-01-15T09:00:00" --end "2024-01-15T12:00:00"

# Event with location and description
bun run calendar.ts create --subject "Lunch" --start "2024-01-15T12:00:00" --location "Cafe" --body "Team lunch"

# Event with attendees
bun run calendar.ts create --subject "1:1" --start tomorrow --end +1d --attendees "colleague@example.com"

# Multiple attendees
bun run calendar.ts create --subject "Review" --start "2024-01-15T10:00:00" --attendees "a@ex.com,b@ex.com,c@ex.com"

# All-day event
bun run calendar.ts create --subject "Holiday" --start "2024-12-25" --all-day

# Using relative dates
bun run calendar.ts create --subject "Follow-up" --start tomorrow --end +1d

複数プロファイルのサポート

プロファイルを使用して複数のアカウントを保存します。

# Use work profile
bun run emails.ts list --profile work
bun run calendar.ts today --profile work

# Use personal profile
bun run emails.ts list --profile personal

手動認証

明示的な認証管理(プロファイルのリスト表示/削除)の場合:

# List all profiles
bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/auth.ts --list

# Delete a profile
bun run auth.ts --delete --profile old-account

# Authenticate with custom Azure AD app
bun run auth.ts --client-id your-app-id --tenant-id your-tenant-id

トークンライフサイクル

トークンタイプ ライフタイム 処理
Access Token 約 1 時間 自動的に更新
Refresh Token 約 90 日 期限切れの場合、スクリプトは auth_required を返します

ユーザーが再認証する必要があるのは、リフレッシュトークンが期限切れになった場合のみです(約 90 日)。

認証情報の保存

認証情報は ~/.config/api-skills/credentials.json に保存されます。

スクリプトリファレンス

スクリプト 目的
emails.ts メールのリスト表示、読み取り、検索、送信、およびフォルダ操作
calendar.ts カレンダーの表示、検索、および作成操作
auth.ts 手動による認証情報の管理(プロファイルのリスト表示、削除)

追加リソース

詳細な API リファレンスについては、以下を参照してください。

  • references/graph-api.md - Microsoft Graph API のエンドポイントとパラメータ
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Microsoft Graph API Integration

Access Microsoft 365 emails and calendar through TypeScript scripts executed via Bun.

Overview

This skill provides access to Microsoft Graph API for:

  • Email: List, read, search, and send emails
  • Calendar: View, search, and create calendar events

All scripts return JSON and handle authentication automatically.

Response Format

All scripts output JSON with a consistent structure:

Success

{"status": "success", "data": [...]}

Authentication Required

{
  "status": "auth_required",
  "userCode": "ABC123",
  "verificationUri": "https://microsoft.com/devicelogin",
  "expiresAt": "2024-01-15T10:30:00.000Z",
  "message": "To sign in, use a web browser..."
}

When you receive auth_required, display to the user:

To access your email, please authenticate:
1. Go to: https://microsoft.com/devicelogin
2. Enter code: ABC123

Let me know when you've completed authentication.

Then retry the same command - the script will automatically complete authentication.

Authentication Pending

{
  "status": "auth_pending",
  "userCode": "ABC123",
  "verificationUri": "https://microsoft.com/devicelogin",
  "expiresAt": "...",
  "message": "..."
}

User has been shown the code but hasn't completed login yet. Remind them to complete authentication.

Error

{"status": "error", "error": "Error description"}

Email Access

All scripts are located at ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/.

List Emails

bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/emails.ts list
bun run emails.ts list --folder "Sent Items" --top 5
bun run emails.ts list --profile work

Read Specific Email

bun run emails.ts read --id AAMkAG...

Get the ID from the list command output.

Search Emails

bun run emails.ts search --query "from:boss@company.com"
bun run emails.ts search --query "subject:quarterly report"
bun run emails.ts search --query "hasAttachments:true"

List Mail Folders

bun run emails.ts folders

Send Email

# Simple email
bun run emails.ts send --to "user@example.com" --subject "Hello" --body "Hi there!"

# Multiple recipients with CC
bun run emails.ts send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Team Update" --body "Here's the update..."

# HTML email
bun run emails.ts send --to "user@example.com" --subject "Report" --body "<h1>Monthly Report</h1><p>Details...</p>" --html

# With BCC
bun run emails.ts send --to "team@example.com" --bcc "manager@example.com" --subject "Announcement" --body "..."

Calendar Access

List Upcoming Events

bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/calendar.ts list
bun run calendar.ts today
bun run calendar.ts week
bun run calendar.ts list --start tomorrow --end +7d

View Specific Event

bun run calendar.ts view --id AAMkAG...

Search Events

bun run calendar.ts search --query "team standup"

Date Formats

  • Relative: today, tomorrow, +7d, +1m, +1y
  • Absolute: ISO format 2024-01-15 or 2024-01-15T14:00:00

Create Calendar Event

# Basic event (1 hour default duration)
bun run calendar.ts create --subject "Team Meeting" --start "2024-01-15T14:00:00"

# Event with end time
bun run calendar.ts create --subject "Workshop" --start "2024-01-15T09:00:00" --end "2024-01-15T12:00:00"

# Event with location and description
bun run calendar.ts create --subject "Lunch" --start "2024-01-15T12:00:00" --location "Cafe" --body "Team lunch"

# Event with attendees
bun run calendar.ts create --subject "1:1" --start tomorrow --end +1d --attendees "colleague@example.com"

# Multiple attendees
bun run calendar.ts create --subject "Review" --start "2024-01-15T10:00:00" --attendees "a@ex.com,b@ex.com,c@ex.com"

# All-day event
bun run calendar.ts create --subject "Holiday" --start "2024-12-25" --all-day

# Using relative dates
bun run calendar.ts create --subject "Follow-up" --start tomorrow --end +1d

Multi-Profile Support

Store multiple accounts using profiles:

# Use work profile
bun run emails.ts list --profile work
bun run calendar.ts today --profile work

# Use personal profile
bun run emails.ts list --profile personal

Manual Authentication

For explicit auth management (listing/deleting profiles):

# List all profiles
bun run ${CLAUDE_PLUGIN_ROOT}/skills/microsoft-graph/scripts/auth.ts --list

# Delete a profile
bun run auth.ts --delete --profile old-account

# Authenticate with custom Azure AD app
bun run auth.ts --client-id your-app-id --tenant-id your-tenant-id

Token Lifecycle

Token Type Lifetime Handling
Access Token ~1 hour Automatically refreshed
Refresh Token ~90 days When expired, scripts return auth_required

Users only need to re-authenticate when the refresh token expires (~90 days).

Credential Storage

Credentials are stored at ~/.config/api-skills/credentials.json.

Script Reference

Script Purpose
emails.ts Email list, read, search, send, and folder operations
calendar.ts Calendar view, search, and create operations
auth.ts Manual credential management (list, delete profiles)

Additional Resources

For detailed API reference, see:

  • references/graph-api.md - Microsoft Graph API endpoints and parameters

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。