This lean MCP server provides direct Microsoft Graph API access with multi-tenant account management, designed to minimize context bloat while enabling comprehensive Microsoft 365 integration.
Core Capabilities:
Multi-tenant authentication - Log in to multiple Microsoft 365 accounts simultaneously using device code flow, ideal for headless/SSH environments
Universal Graph API access - Execute any Graph API request through a single
graph-requesttool supporting all HTTP methods (GET, POST, PUT, PATCH, DELETE), custom headers, and request bodiesCross-tenant querying - Target specific accounts via
accountIdparameter to query different tenants in the same conversation without switchingFull Microsoft 365 coverage - Access all services including Outlook, Calendar, OneDrive, Users, Groups, Teams, and SharePoint
Advanced OData queries - Use
$select,$filter,$top,$orderby,$expand,$count, and$searchfor precise data retrievalAPI version control - Choose between stable (v1.0) and preview (beta) endpoints
Account lifecycle management - List, select, verify status, and remove cached accounts
Context-efficient design - Only 7 tools (~1KB context) replace 30-40 specialized tools (~12KB), reducing AI model overhead
PnP CLI complement - Works alongside PnP CLI for specialized SharePoint, Teams, and Power Platform operations
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ForIT Microsoft Graphshow my upcoming calendar events for this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ForIT Microsoft Graph
A lean MCP (Model Context Protocol) server for raw Microsoft Graph API access with multi-tenant account management.
The Problem
AI assistants using Microsoft Graph face two challenges:
Context bloat - Existing MCPs expose 30-40 specialized tools, consuming ~12KB of context per conversation
Multi-tenant friction - Managing multiple Microsoft 365 accounts requires constant switching
The Solution
7 tools. ~1KB context. Direct tenant access.
Tool | Description |
| Authenticate with Microsoft (device code flow) |
| Log out from Microsoft account |
| Check authentication status |
| List all cached Microsoft accounts |
| Switch default account |
| Remove an account from cache |
| Execute any Graph API request |
Why This Approach?
Instead of 30+ specialized tools like list-mail-messages, create-calendar-event, get-user, etc., we expose one flexible tool that can call any Graph API endpoint. The AI already knows the Graph API - it doesn't need hand-holding.
Before (Softeria, 37 tools):
After (ForIT, 1 tool):
Multi-Tenant Without Switching
The killer feature: reference any account directly without switching.
Query both tenants in the same conversation. No select-account dance required.
Installation
Quick Start
With Claude Desktop / MCP Client
Authentication (Device Code)
Device code authentication is used, which is the most reliable method for:
SSH sessions where browser auth isn't available
Headless servers
Remote development environments
AI agent automation
The device code is displayed prominently in a box format for visibility.
Login to Multiple Tenants
Multi-Account Requirement
When multiple accounts exist, you must specify which account to use:
Without accountId, requests will error showing available accounts. Use list-accounts tool to see account IDs.
The graph-request Tool
Parameters
Parameter | Type | Description |
| string | Graph API path (e.g., |
| enum |
|
| object | Request body for POST/PUT/PATCH |
| object | OData params ( |
| object | Additional HTTP headers |
| enum |
|
| string | Target specific tenant without switching |
Examples
Get current user:
List unread emails:
Create calendar event:
Use beta API:
Cross-tenant query:
Use With PnP CLI
This MCP complements PnP CLI for Microsoft 365:
Use Case | Tool |
Raw Graph API calls | ForIT Microsoft Graph |
SharePoint, Teams, Power Platform | PnP CLI |
Multi-tenant management | ForIT Microsoft Graph |
Specialized admin commands | PnP CLI |
Environment Variables
Variable | Description |
| Azure AD app client ID (optional) |
| Client secret for confidential apps |
| Azure AD tenant ID (default: |
Credits
Fork of @softeria/ms-365-mcp-server, rebuilt with a different philosophy: less is more.
License
MIT - See LICENSE