Microsoft Graph API Integration

Pro v1.0.0

Access Microsoft 365 services including Mail, Calendar, Teams, OneDrive, and user management through Microsoft Graph API

Requires Claude Code CLI

This skill integrates with Microsoft Graph through Claude Code. Install Claude Code and add this skill to use it.

Available Actions

Get User Profile

Retrieve the authenticated user's profile information including name, email, job title, and office location

Returns

object User profile object with id, displayName, mail, userPrincipalName, jobTitle, and officeLocation

Try saying...

  • "Get my Microsoft 365 profile"
  • "Show my user information"
  • "What's my email address in Microsoft 365?"

List Mail

List recent messages from a user's inbox with details like subject, sender, and read status

Parameters

Name Type Required Description
limit integer Optional Number of messages to retrieve

Returns

array Array of message objects with id, subject, from, receivedDateTime, isRead, and hasAttachments

Try saying...

  • "Show me my recent emails"
  • "List the last 20 emails in my inbox"
  • "What are my unread messages?"

Send Email

Send an email message to a specified recipient

Parameters

Name Type Required Description
to string Required Recipient email address
subject string Required Email subject line
body string Required Email body text

Returns

string Success confirmation message

Try saying...

  • "Send an email to alice@contoso.com about the meeting"
  • "Email bob@contoso.com with the project update"
  • "Send a message to team@contoso.com"

List Calendar Events

List upcoming calendar events for the next N days with details like subject, time, location, and organizer

Parameters

Name Type Required Description
days integer Optional Number of days to look ahead

Returns

array Array of event objects with id, subject, start, end, location, organizer, and isOnlineMeeting

Try saying...

  • "Show my calendar for the next week"
  • "What meetings do I have in the next 3 days?"
  • "List my upcoming calendar events"

List Users

List users in the organization (requires User.Read.All permission and admin consent)

Parameters

Name Type Required Description
limit integer Optional Number of users to retrieve

Returns

array Array of user objects with id, displayName, mail, and userPrincipalName

Try saying...

  • "List users in my organization"
  • "Show me the first 20 users"
  • "Get all company users"

Getting Started

OAuth 2.0 Advanced Setup
  1. 1 Go to Microsoft Entra admin center (https://entra.microsoft.com)
  2. 2 Navigate to Microsoft Entra ID > Applications > App registrations
  3. 3 Create new registration and save the Application (client) ID
  4. 4 Create a client secret under Certificates & secrets
  5. 5 Configure API permissions (e.g., User.Read.All, Mail.Read, Calendars.Read)
  6. 6 Grant admin consent for the permissions
  7. 7 Get your Tenant ID from Microsoft Entra ID > Overview
  8. 8 Add credentials to shell config: MSGRAPH_CLIENT_ID, MSGRAPH_CLIENT_SECRET, MSGRAPH_TENANT_ID
  9. 9 Run setup script: ./scripts/setup-env.sh

Verify Setup

source ~/.config/claude-skills/microsoft-graph-api/.venv/bin/activate && python scripts/client.py get-user

Success: Returns JSON with user profile information

Security & Access

Access Scope

Full access to Microsoft 365 tenant data based on configured permissions. Can include reading/sending emails, accessing calendars, managing users, and accessing files across the organization.

  • Client credentials grant broad access - use least privilege principle
  • Never commit client secrets to version control
  • Rotate client secrets regularly (every 6-12 months)
  • Monitor Azure audit logs for suspicious activity
  • Permissions like Mail.Send or User.ReadWrite.All are extremely powerful
  • Consider using separate app registrations for dev/test/prod environments

Limitations

  • App registration requires Microsoft Entra admin access
  • Admin consent needed for most useful permissions
  • Client secrets expire and must be rotated
  • Some APIs only available in beta version (not recommended for production)

Get This Skill

Requires Pro subscription ($9/month)

Quick Reference

Type
PYTHON_SDK
Auth
OAuth 2.0
Setup
Advanced Setup
Tools Required
Bash
Python Dependencies
msgraph-sdk>=1.0.0 azure-identity>=1.15.0

Have Feedback?

Help us improve this skill by sharing your ideas and suggestions.

Request Improvements