# Msgraph Mcp

> Microsoft Graph MCP server for Claude Code - Read-only access to M365 services (SharePoint, OneDrive, Outlook, Teams, Calendar)

- **Type:** MCP server
- **Install:** `agentstack add mcp-eesb99-msgraph-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [eesb99](https://agentstack.voostack.com/s/eesb99)
- **Installs:** 0
- **Category:** [Productivity](https://agentstack.voostack.com/c/productivity)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [eesb99](https://github.com/eesb99)
- **Source:** https://github.com/eesb99/msgraph-mcp

## Install

```sh
agentstack add mcp-eesb99-msgraph-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Microsoft Graph MCP Server

Read-only access to Microsoft 365 suite via Model Context Protocol.

## Architecture

The diagram shows the complete system architecture including Claude Code integration, MCP server components, Azure AD authentication, Microsoft Graph API gateway, and M365 services (SharePoint, OneDrive, Outlook, Teams, Calendar).

## Features

- **SharePoint**: Search sites, list files, get content
- **OneDrive**: Browse user files, search
- **Outlook**: Search emails, read messages
- **Teams**: List teams/channels, read messages
- **Calendar**: View events, search calendar

## Setup

**📖 For detailed setup instructions, see [SETUP.md](SETUP.md)**

### Quick Start

1. **Azure AD App Registration**: Register app with Application permissions
2. **Install**: `pip install -r requirements.txt`
3. **Configure**: Add credentials to `~/.claude.json`
4. **Test**: `msgraph.test_connection()`

### Required Azure AD Permissions

Register an Azure AD app with these **Application** permissions:
- `Sites.Read.All` - SharePoint
- `Files.Read.All` - OneDrive/SharePoint files
- `Mail.Read` - Outlook
- `ChannelMessage.Read.All` - Teams messages
- `Chat.Read.All` - Teams chats
- `Calendars.Read` - Calendar
- `User.Read.All` - User directory
- `Group.Read.All` - Teams/Groups

Grant admin consent for all permissions.

### 2. Install Dependencies

```bash
cd ~/.claude/mcp-servers/msgraph-mcp
pip install -r requirements.txt
```

### 3. Configure Claude

Add to `~/.claude.json`:

```json
{
  "mcpServers": {
    "msgraph-mcp": {
      "type": "stdio",
      "command": "python3",
      "args": ["/Users/thianseongyee/.claude/mcp-servers/msgraph-mcp/server.py"],
      "env": {
        "AZURE_CLIENT_ID": "your-client-id",
        "AZURE_TENANT_ID": "your-tenant-id",
        "AZURE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
```

## Usage

Access via `msgraph` module in code execution:

```python
# Test connection
result = msgraph.test_connection()

# Search SharePoint files
result = msgraph.search_files("formulation xlsx", limit=10)

# List recent emails
result = msgraph.list_recent_emails("user@company.com", limit=20)

# Get Teams channels
teams = msgraph.list_teams()
channels = msgraph.list_channels(teams['items'][0]['id'])

# View calendar
result = msgraph.list_events("user@company.com", days_ahead=7)
```

## Available Functions

### Connection
- `test_connection()` - Test API connectivity
- `list_users(query, limit)` - Search users
- `get_user(email)` - User details

### SharePoint
- `search_sites(query, limit)` - Find sites
- `list_site_contents(site_id, path)` - Browse folders
- `search_files(query, site_id, limit)` - Search files
- `get_file_content(site_id, item_id)` - Read file
- `get_file_metadata(site_id, item_id)` - File info

### OneDrive
- `list_user_files(email, path)` - Browse OneDrive
- `search_user_files(email, query, limit)` - Search files

### Outlook
- `search_emails(query, email, limit)` - Search mail
- `list_recent_emails(email, limit, folder)` - Recent mail
- `get_email(email, message_id)` - Full email

### Teams
- `list_teams(limit)` - List teams
- `list_channels(team_id)` - Team channels
- `get_channel_messages(team_id, channel_id, limit)` - Messages
- `search_channel_messages(team_id, channel_id, query)` - Search

### Calendar
- `list_events(email, days_ahead)` - Upcoming events
- `search_events(email, query, limit)` - Search calendar
- `get_event(email, event_id)` - Event details

## Security

- **Read-only**: No write permissions
- **Sandboxed**: Limited Python builtins
- **App-only auth**: No user credentials stored
- **Token managed**: Automatic refresh, never exposed

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [eesb99](https://github.com/eesb99)
- **Source:** [eesb99/msgraph-mcp](https://github.com/eesb99/msgraph-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-eesb99-msgraph-mcp
- Seller: https://agentstack.voostack.com/s/eesb99
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
