o365-Admin MCP
A skill-based Microsoft 365 admin MCP server that exposes 4 base tools to execute Graph and Power Platform API calls, enabling administrative tasks via natural language.
README
o365-Admin MCP
A skill-based Microsoft 365 admin MCP server organized around APIs rather than applications. Capabilities are lazy-loaded from instruction files rather than exposed as a large tool manifest.
Architecture
This MCP exposes only 4 base tools:
| Tool | Purpose |
|---|---|
list_skills |
Returns available skills and resource references |
read_skill |
Loads a skill or resource reference into context |
graph_api_call |
Generic Graph API executor |
powerplatform_api_call |
Generic Power Platform API executor |
No domain-specific tools. Claude reads skills/resources to learn what API calls to construct, then executes via the generic tools.
Directory Structure
o365-Admin/
├── src/
│ └── index.ts # MCP server with 4 base tools
├── skills/
│ ├── graph-api.md # Core: auth, request patterns, pagination, errors
│ └── powerplatform-api.md # Core: auth, environments, request patterns
├── resources/
│ ├── graph/
│ │ ├── sites.md # SharePoint: sites, drives, lists, permissions
│ │ ├── teams.md # Teams: teams, channels, tabs, apps
│ │ ├── users.md # Entra: users, groups, directory roles
│ │ └── mail.md # Exchange: messages, folders, rules, calendars
│ └── powerplatform/
│ ├── flows.md # Flow definitions, runs, connections
│ └── environments.md # Environment management, DLP policies
├── README.md
├── package.json
└── tsconfig.json
Prerequisites
- Node.js 18+
- Azure AD App Registration with appropriate permissions
- Access to Microsoft 365 tenant
Azure AD App Registration
Step 1: Create App Registration
- Go to Azure Portal > Azure Active Directory > App registrations
- Click "New registration"
- Name:
o365-Admin-MCP - Supported account types: Single tenant (or multi-tenant if needed)
- Click "Register"
Step 2: Create Client Secret
- In your app registration, go to "Certificates & secrets"
- Click "New client secret"
- Add description and expiry
- Copy the secret value immediately (shown only once)
Step 3: Add API Permissions
Go to "API permissions" > "Add a permission" > "Microsoft Graph" > "Application permissions"
Add the following permissions based on your needs:
SharePoint/OneDrive:
Sites.ReadWrite.AllSites.Manage.All
Teams:
Team.CreateTeamSettings.ReadWrite.AllChannel.CreateChannelSettings.ReadWrite.AllTeamsApp.ReadWrite.All
Users/Directory:
Directory.Read.AllDirectory.ReadWrite.AllUser.ReadWrite.AllGroup.ReadWrite.AllRoleManagement.ReadWrite.Directory
Mail/Calendar:
Mail.ReadWriteMail.SendCalendars.ReadWriteMailboxSettings.ReadWrite
Step 4: Grant Admin Consent
Click "Grant admin consent for [Your Tenant]" and confirm.
Step 5: Note Your IDs
From the app registration "Overview" page, copy:
- Application (client) ID
- Directory (tenant) ID
Environment Configuration
Set the following environment variables:
export AZURE_CLIENT_ID="your-client-id"
export AZURE_CLIENT_SECRET="your-client-secret"
export AZURE_TENANT_ID="your-tenant-id"
Or create a .env file (remember to add to .gitignore):
AZURE_CLIENT_ID=your-client-id
AZURE_CLIENT_SECRET=your-client-secret
AZURE_TENANT_ID=your-tenant-id
Installation
# Clone the repository
git clone https://github.com/yourusername/o365-Admin.git
cd o365-Admin
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run the server
npm start
Development
# Run in development mode (no build step)
npm run dev
Usage with Claude
MCP Configuration
Add to your Claude MCP settings:
{
"mcpServers": {
"o365-admin": {
"command": "node",
"args": ["path/to/o365-Admin/dist/index.js"],
"env": {
"AZURE_CLIENT_ID": "your-client-id",
"AZURE_CLIENT_SECRET": "your-client-secret",
"AZURE_TENANT_ID": "your-tenant-id"
}
}
}
}
Example Workflow
-
List available resources:
Use list_skills to see what's available -
Load relevant documentation:
Use read_skill with type="resource" and name="graph/sites" -
Execute API calls:
Use graph_api_call with method="GET" and endpoint="/sites/root"
Example Conversation
User: Create a new SharePoint document library called "Project Files" in the IT site
Claude:
1. [Uses read_skill to load graph/sites resource]
2. [Uses graph_api_call GET /sites/contoso.sharepoint.com:/sites/IT to get site ID]
3. [Uses graph_api_call POST /sites/{site-id}/lists with library config]
Result: Document library "Project Files" created successfully.
Adding New Resources
To extend the MCP with new capabilities:
-
Create a new
.mdfile in the appropriate directory:skills/for core API patternsresources/graph/for Graph API endpointsresources/powerplatform/for Power Platform endpoints
-
Follow the existing format:
- Start with "# Title"
- Include "## Required Permissions" section
- Document each endpoint with method, URL, and example body
- Mark incomplete sections with TODO:
-
The new file will automatically appear in
list_skillsoutput
Resource Template
# Resource Name
Brief description of what this resource covers.
## Required Permissions
| Permission | Type | Description |
|------------|------|-------------|
| Permission.Name | Application | What it allows |
## Operation Name
Description of the operation.
\`\`\`
METHOD /endpoint/path
Content-Type: application/json
{
"property": "value"
}
\`\`\`
Security Considerations
- Never commit credentials to version control
- Use environment variables or secure secret management
- Apply principle of least privilege when assigning permissions
- Regularly rotate client secrets
- Monitor API usage for anomalies
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。