PollyHub

Microsoft 365 Connector

Clean

Access Microsoft 365 services (Outlook email, Calendar, OneDrive, SharePoint) using Microsoft Graph API. Authentication is managed automatically via Polly's OAuth2 system with automatic token refresh.

SKILL.md

---
name: microsoft365-connector
description: >
  Access Microsoft 365 services (Outlook email, Calendar, OneDrive, SharePoint) using Microsoft Graph API.
  Use when the user wants to check emails, manage calendar, access files, or interact with Microsoft 365 data.
  Keywords: microsoft, office, outlook, email, calendar, onedrive, sharepoint, teams.
metadata:
  polly:
    polly_managed_connector: true
    auth:
      - env: MS365_ACCESS_TOKEN
        type: oauth2
        integration_id: microsoft
        description: Microsoft 365 OAuth access via Microsoft Graph API
        scopes:
          - Mail.ReadWrite
          - Mail.Send
          - Calendars.ReadWrite
          - Files.ReadWrite.All
          - offline_access
    primaryEnv: MS365_ACCESS_TOKEN
---

# Microsoft 365 Connector

Access Microsoft 365 services through the Microsoft Graph API with Polly-managed OAuth authentication.

---

## Prerequisites

### Authentication

This skill uses **Polly-managed OAuth2 authentication**. The access token is automatically managed and refreshed by Polly's auth system via the `MS365_ACCESS_TOKEN` environment variable.

**No manual token refresh is needed** — Polly handles token refresh automatically when needed.

On first use, if not connected, call:
```
manage_auth(action="connect", integration_id="microsoft", auth_env="MS365_ACCESS_TOKEN")
```

---

## Script

All API calls go through `scripts/ms365_api.py`:

```bash
python3 /home/polly/skills/installed/microsoft365-connector/scripts/ms365_api.py <command> [args]
```

---

## Commands

### Email (Outlook)

**List recent emails:**
```bash
python3 scripts/ms365_api.py mail list --top 10
```

**Read email:**
```bash
python3 scripts/ms365_api.py mail read <message_id>
```

**Send email:**
```bash
python3 scripts/ms365_api.py mail send --to "user@example.com" --subject "Subject" --body "Message"
```

**Search emails:**
```bash
python3 scripts/ms365_api.py mail search --query "subject:urgent"
```

### Calendar

**List upcoming events:**
```bash
python3 scripts/ms365_api.py calendar list --top 5
```

**Get event details:**
```bash
python3 scripts/ms365_api.py calendar get <event_id>
```

**Create event:**
```bash
python3 scripts/ms365_api.py calendar create --subject "Meeting" --start "2026-04-10T10:00:00" --end "2026-04-10T11:00:00"
```

### Files (OneDrive)

**List files:**
```bash
python3 scripts/ms365_api.py files list --top 10
```

**Get user info:**
```bash
python3 scripts/ms365_api.py user me
```

---

## Notes

- Access tokens are valid for ~1 hour and are **automatically refreshed by Polly's auth system**
- The LLM never directly accesses refresh tokens — they are managed securely by Polly
- The `MS365_ACCESS_TOKEN` environment variable is injected automatically when the skill runs
- Uses Microsoft Graph API v1.0 endpoints
Authorstella
Downloads4
Versions2
Published1d ago
Auth Requirements
MS365_ACCESS_TOKENoauth2

integration: microsoft

Version History

v1.1.0latest

Fixed OAuth scopes to correct Microsoft Graph API permissions (Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, Files.ReadWrite.All, offline_access). Integration ID confirmed as 'microsoft'.

Apr 9, 2026

Clean.zip
v1.0.0

Initial release of Microsoft 365 connector with Polly-managed OAuth2 authentication using Microsoft Graph API. No MCP server dependency.

Apr 9, 2026

Clean.zip

SHA-256 (latest)

83675f10ef2634b32980e7986f195d70ba35c4649c7e3c2b1cf27851a6d53c49