Token导航 LogoToken导航TokenDH.com
Microsoft MCP logo
办公协作stdio官方级别未说明来源级核验

Microsoft MCP

MCP Server

Microsoft MCP 是一个基于 Microsoft Graph API 的 AI 助手工具包,提供邮件管理、日历智能、OneDrive 文件操作、联系人管理等功能,适用于个人、工作和学校账户。

工具数

0

提示词数

0

GitHub Stars

49

资源数

0
邮件管理PythonClaude联系人管理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

elyxlz

提供方

elyxlz

最后核验

2026/5/17 20:21

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run authenticate.py

详细介绍

微软MCP

适用于Microsoft Graph API的强大MCP服务器-适用于Outlook、日历、OneDrive和联系人的完整人工智能助手工具包。

特性

  • 电子邮件管理:读取、发送、回复、管理附件、组织文件夹
  • 日历智能:创建、更新、检查可用性、回复邀请
  • OneDrive文件:上传、下载、分页浏览
  • 联系人:从通讯簿中搜索并列出联系人
  • 多账户:支持多个Microsoft帐户(个人、工作、学校)
  • 统一搜索:在电子邮件、文件、事件和人员中搜索

Claude Desktop快速入门

# Add Microsoft MCP server (replace with your Azure app ID)
claude mcp add microsoft-mcp -e MICROSOFT_MCP_CLIENT_ID=your-app-id-here -- uvx --from git+https://github.com/elyxlz/microsoft-mcp.git microsoft-mcp

# Start Claude Desktop
claude

使用示例

# Email examples
> read my latest emails with full content
> reply to the email from John saying "I'll review this today"
> send an email with attachment to alice@example.com

# Calendar examples  
> show my calendar for next week
> check if I'm free tomorrow at 2pm
> create a meeting with Bob next Monday at 10am

# File examples
> list files in my OneDrive
> upload this report to OneDrive
> search for "project proposal" across all my files

# Multi-account
> list all my Microsoft accounts
> send email from my work account

可用工具

电子邮件工具

  • list_emails -列出包含可选正文内容的电子邮件
  • get_email -获取带有附件的特定电子邮件
  • create_email_draft -创建支持附件的电子邮件草稿
  • send_email -立即发送带有CC/BCC和附件的电子邮件
  • reply_to_email -回复维护线程上下文
  • reply_all_email -回复帖子中的所有收件人
  • update_email -将电子邮件标记为已读/未读
  • move_email -在文件夹之间移动电子邮件
  • delete_email -删除电子邮件
  • get_attachment -获取电子邮件附件内容
  • search_emails -按查询搜索电子邮件

日历工具

  • list_events -列出日历事件及其详细信息
  • get_event -获取特定事件详细信息
  • create_event -创建包含地点和与会者的活动
  • update_event -重新安排或修改活动
  • delete_event -取消活动
  • respond_event -接受/拒绝/初步回应邀请
  • check_availability -检查空闲/繁忙时间以进行日程安排
  • search_events -搜索日历事件

联系工具

  • list_contacts -列出所有联系人
  • get_contact -获取具体联系方式
  • create_contact -创建新联系人
  • update_contact -更新联系信息
  • delete_contact -删除联系人
  • search_contacts -按查询搜索联系人

文件工具

  • list_files -浏览OneDrive文件和文件夹
  • get_file -下载文件内容
  • create_file -将文件上传到OneDrive
  • update_file -更新现有文件内容
  • delete_file -删除文件或文件夹
  • search_files -在OneDrive中搜索文件

实用工具

  • unified_search -在电子邮件、事件和文件中搜索
  • list_accounts -显示经过身份验证的Microsoft帐户
  • authenticate_account -启动新Microsoft帐户的身份验证
  • complete_authentication -输入设备代码后完成身份验证过程

手动设置

1.Azure应用程序注册

  1. 首选 Azure门户 → 微软Entra ID→ 应用程序注册
  2. 新注册→ Name: microsoft-mcp
  3. 支持的帐户类型:个人+工作/学校
  4. 认证→ 允许公共客户端流:是
  5. API权限→ 添加这些委派权限:

- 邮件。读写 - 日历。读写 - 文件夹。读写 - 联络。阅读 - 人。阅读 - 用户。阅读

  1. 复制应用程序ID

2.安装

git clone https://github.com/elyxlz/microsoft-mcp.git
cd microsoft-mcp
uv sync

3.身份验证

# Set your Azure app ID
export MICROSOFT_MCP_CLIENT_ID="your-app-id-here"

# Run authentication script
uv run authenticate.py

# Follow the prompts to authenticate your Microsoft accounts

4.克劳德桌面配置

添加到您的Claude Desktop配置中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json\ 视窗: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "microsoft": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/elyxlz/microsoft-mcp.git", "microsoft-mcp"],
      "env": {
        "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here"
      }
    }
  }
}

或者为了当地发展:

{
  "mcpServers": {
    "microsoft": {
      "command": "uv",
      "args": ["--directory", "/path/to/microsoft-mcp", "run", "microsoft-mcp"],
      "env": {
        "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here"
      }
    }
  }
}

多账户支持

所有工具都需要 account_id 参数作为第一个参数:

# List accounts to get IDs
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# Use account for operations
send_email(account_id, "user@example.com", "Subject", "Body")
list_emails(account_id, limit=10, include_body=True)
create_event(account_id, "Meeting", "2024-01-15T10:00:00Z", "2024-01-15T11:00:00Z")

发展

# Run tests
uv run pytest tests/ -v

# Type checking
uv run pyright

# Format code
uvx ruff format .

# Lint
uvx ruff check --fix --unsafe-fixes .

示例:AI助手场景

智能电子邮件管理

# Get account ID first
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# List latest emails with full content
emails = list_emails(account_id, limit=10, include_body=True)

# Reply maintaining thread
reply_to_email(account_id, email_id, "Thanks for your message. I'll review and get back to you.")

# Forward with attachments
email = get_email(email_id, account_id)
attachments = [get_attachment(email_id, att["id"], account_id) for att in email["attachments"]]
send_email(account_id, "boss@company.com", f"FW: {email['subject']}", email["body"]["content"], attachments=attachments)

智能调度

# Get account ID first
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# Check availability before scheduling
availability = check_availability(account_id, "2024-01-15T10:00:00Z", "2024-01-15T18:00:00Z", ["colleague@company.com"])

# Create meeting with details
create_event(
    account_id,
    "Project Review",
    "2024-01-15T14:00:00Z", 
    "2024-01-15T15:00:00Z",
    location="Conference Room A",
    body="Quarterly review of project progress",
    attendees=["colleague@company.com", "manager@company.com"]
)

安全说明

  • 令牌在本地缓存在 ~/.microsoft_mcp_token_cache.json
  • 如果您启用了2FA,请使用特定于应用程序的密码
  • 仅请求您的应用程序实际需要的权限
  • 考虑使用专用的应用程序注册进行生产

故障排除

  • 身份验证失败:检查您的CLIENT_ID是否正确
  • “需要管理员批准”:使用 MICROSOFT_MCP_TENANT_ID=consumers 个人账户
  • 缺少权限:确保在Azure中授予所有必需的API权限
  • 令牌错误:删除 ~/.microsoft_mcp_token_cache.json 并重新验证

许可证

麻省理工学院

目录标签

目录标签

邮件管理PythonClaude联系人管理本地部署日历智能文件操作多账户支持统一搜索

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP