A Claude Code plugin for Microsoft Graph API integration, focused on Outlook/Hotmail email access.
Add this plugin to Claude Code:
claude mcp add-plugin /path/to/microsoft-skillOr add to your Claude Code configuration.
- OAuth 2.0 Authentication with PKCE
- Email Operations: List messages, download as
.eml - Secure Storage: 1Password or local file credentials
- Per-project Tokens: Different Microsoft accounts per project
Once installed, the skill triggers when you ask about emails:
- "Check my outlook inbox"
- "Read my emails"
- "Download recent messages from hotmail"
- "List my microsoft mail"
-
Configure credentials:
pnpm tsx skills/microsoft-outlook/scripts/microsoft.ts setup
-
Authenticate:
pnpm tsx skills/microsoft-outlook/scripts/microsoft.ts auth
-
Verify:
pnpm tsx skills/microsoft-outlook/scripts/microsoft.ts me
microsoft-skill/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── skills/
│ └── microsoft-outlook/
│ ├── SKILL.md # Skill instructions
│ ├── scripts/ # CLI implementation
│ │ ├── microsoft.ts
│ │ └── lib/
│ └── references/ # Detailed documentation
│ ├── setup-guide.md
│ └── api-reference.md
├── package.json
└── README.md
| Command | Description |
|---|---|
setup |
Configure API credentials |
auth |
Run OAuth flow |
check |
Verify auth status |
me |
Get user profile |
messages |
List recent messages |
download <id> |
Download message as .eml |
download-all |
Download recent messages |
Register an app in Microsoft Entra admin center or the Azure Portal:
- Sign in: Use your Microsoft account. If you see an error about not being in a directory, follow the prompt to "Sign up for Azure" (free) to create a default directory.
- App registrations > New registration
- Name:
microsoft-skill-cli - Supported account types: Select "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)".
- Note: This is required if you want to use a personal @outlook.com or @hotmail.com account.
- Redirect URI: Select Web and enter
http://localhost:3000/callback. - Register: Click the button.
- Client ID: Copy the Application (client) ID from the Overview page.
- Client Secret:
- Go to Certificates & secrets > New client secret.
- Add a description and click Add.
- Copy the Value (not the Secret ID) immediately.
- API permissions:
- Go to API permissions > Add a permission.
- Select Microsoft Graph > Delegated permissions.
- Add
Mail.ReadandUser.Read. - (Optional) Click Grant admin consent if you are the tenant admin.
1Password (recommended): The script looks for Secure Notes in your Personal vault:
op://Personal/Microsoft Client ID/notesPlainop://Personal/Microsoft Client Secret/notesPlain
Local file: ~/.config/microsoft-skill/credentials.json
Run pnpm tsx scripts/microsoft.ts setup and choose "Enter manually".
- Per-project:
.claude/microsoft-skill.local.json - Global:
~/.config/microsoft-skill/tokens.json
Add .claude/*.local.* to .gitignore.
MIT