Labsco
JustStas logo

Graph MCP

β˜… 2

from JustStas

An MCP to interact with Office 365 - Teams, mail, calendar.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys

Graph MCP

An MCP server that connects Claude to Microsoft Teams, Outlook Calendar, and Mail through the Microsoft Graph API.

What it does

Gives Claude access to 41 tools:

CategoryTools
AuthCheck status, login (browser OAuth), logout
ChatsList chats, read/send messages, create chats, list members
Teams & ChannelsList teams, list channels, read/send messages, list members, read/send replies
CalendarList calendars, list/get events, create/update/delete events
MailList emails, read email, search emails, send email, reply, list/get attachments
MeetingsFind meeting by Join URL, list/get transcripts, list recordings, get recording URL
FilesBrowse OneDrive folders, search files, get content, upload files, create sharing links
UsersSearch organization directory
PresenceGet/set your presence, get another user's presence
SearchSearch messages across all chats and channels

Message and email formatting

The Teams message tools (graph_send_chat_message, graph_send_channel_message, and graph_reply_to_channel_message) and outbound mail tools (graph_send_mail, graph_reply_mail) now default to HTML mode and convert markdown to HTML automatically using Python-Markdown.

Examples:

  • **bold** β†’ <strong>bold</strong>
  • - item lists β†’ <ul><li>...</li></ul>
  • `code` β†’ <code>...</code>

If you already have raw HTML, pass it directly and it will be sent as-is.

For email, this means normal LLM-written markdown like **bold**, bullet lists, or inline code renders properly instead of showing raw markdown characters.

These tools also support optional top-level Graph API mentions, either in raw Graph format or a simplified shape such as:

[
  {
    "name": "Jane Smith",
    "user_id": "ef1c916a-3135-4417-ba27-8eb7bd084193"
  }
]

Use the corresponding <at id="0">Jane Smith</at> tag in the HTML body to trigger a real Teams mention.

How it works

Claude Code  ──stdio──>  graph-mcp  ──HTTPS──>  Microsoft Graph API
                              β”‚
                         ~/.graph-mcp/
                           tokens.enc  (encrypted)
                           .key        (auto-generated)
  • Auth: OAuth2 Authorization Code flow with PKCE. Login opens your browser, a local callback server captures the token. No secrets stored in config.
  • Token persistence: Tokens are encrypted with Fernet and stored in ~/.graph-mcp/tokens.enc. The encryption key is auto-generated on first use. Logins survive server restarts.
  • Token refresh: Access tokens are refreshed automatically before they expire. You only need to log in again if the refresh token itself expires.
  • Rate limiting: Sliding window counter with exponential backoff. Respects Retry-After headers on 429 responses.

Disclaimer

This project is an independent open-source effort and is not affiliated with, endorsed by, or sponsored by Microsoft Corporation. Microsoft, Microsoft Teams, Outlook, Microsoft 365, Microsoft Graph, and Azure are trademarks of the Microsoft group of companies.

This software is provided "as is", without warranty of any kind. Use it at your own risk. The authors accept no liability for any damages, data loss, or security issues arising from the use of this software. You are responsible for complying with your organization's policies and Microsoft's API Terms of Use when using this tool.

This software accesses Microsoft services on your behalf using your own credentials and Azure app registration. Data retrieved from Microsoft Graph (emails, messages, calendar events, etc.) is passed to the LLM that invoked the tool. Be mindful of your organization's data handling policies when using this with cloud-hosted AI models.

License

MIT β€” see LICENSE.