
Ms Graph Mcp
io.github.nitin27may由 GitHub 帳號 nitin27may 發布v0.3.0更新於 Oct 24, 2026
Microsoft Graph MCP server — 85 tools for mail, calendar, Teams, files, SharePoint, and Entra ID
概覽
本機 MCP 伺服器,提供 85 個 Microsoft Graph 工具,讓助理處理郵件、行事曆、Teams 聊天、檔案、SharePoint、人員、工作和 OneNote。
- 可以做什麼
- 搜尋和讀取郵件,僅在明確開啟寫入工具時寄送郵件;草稿功能仍在藍圖中,本版本尚不可用(R137、R164)。列出和建立行事曆事件與會議,包括會議逐字稿。讀取和傳送 Teams 聊天訊息,查詢人員、聯絡人和目錄項目。搜尋、讀取和共用 OneDrive 與 SharePoint 檔案,完成工作並讀取 OneNote 筆記。可依設定檔或單次請求縮小暴露的工具集,讓模型只看到需要的命名空間。
- 適用情境
- 適合讓助理以你自己的委派登入在 Microsoft 365 租用戶內回答問題或執行操作,例如整理郵件、查看行事曆、取得會議逐字稿或搜尋檔案。預設 core 設定檔維持較小的工具面,只為實際需要的產品加入設定檔。
- 執行需求
- 需要 Python 3.12+,以及 uv 或 pip 在本機透過 stdio 執行 PyPI 套件 ms-graph-mcp,或使用 HTTP 傳輸。需要一個註冊為公開用戶端的 Entra ID 應用程式,設定 localhost 重新導向 URI 和委派 Graph 權限;用戶端 ID 和租用戶 ID 填入 GRAPH_MCP_CLIENT_ID 和 GRAPH_MCP_TENANT_ID。首次登入會開啟瀏覽器,權杖會快取在本機。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Ms Graph Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ms-graph-mcp
[PyPI] [Release] [Docs] [CI] [Python] [Container] [License: MIT] [MCP]
A Model Context Protocol server for Microsoft Graph — 85 tools across mail, calendar, meetings (including transcripts), Teams chat, files, SharePoint, search, people, contacts, directory, tasks and OneNote, over stdio or Streamable HTTP.
Signs you in with your own Microsoft account — browser SSO, no token to paste, no client secret.
[The ms-graph-mcp tools listed in VS Code's Configure Tools panel]
- No
msgraph-sdk, noazure-identity— the Graph client is rawhttpx2, so the dependency tree stays small and the wire behaviour is inspectable. - Read/write separation is enforced, not advisory — write tools are hidden and refused unless the caller explicitly opts in.
- Auth-agnostic by default — tools receive an already-acquired Graph token via the request context. The server can also perform its own on-behalf-of exchange when you want it to act as a proper OAuth resource server.
Status: early. Extracted from a production agent platform where it has been running against a real tenant. The code is battle-tested; the packaging and public API surface are newer. Expect the config surface to move before 1.0.
Install
Requires Python 3.12+. Two paths — pick the one that matches what you want to do.
A. Use the package
Nothing to clone. uv runs it straight from PyPI:
or install it into an environment:
Release candidates are published too. pip skips them unless you ask:
A container image is on GHCR for the HTTP transport — see docs/hosting.md.
Also listed on the official MCP registry as
io.github.nitin27may/ms-graph-mcp.
TestPyPI is not a distribution channel. Every release is published there first, but that is a rehearsal of the publishing process: it can be wiped without notice and does not mirror PyPI, so installing from it needs
--extra-index-url https://pypi.org/simple/just to resolve ordinary dependencies. Use PyPI, or--pre.
B. Run from source
For hacking on it, forking it, or running an unreleased change:
uv sync is the only setup step. See
CONTRIBUTING.md before
opening a pull request — the tool allowlists and the tier separation have invariants that are
enforced rather than advisory.
To point an MCP client at your clone, you need its absolute path — clients do not inherit your
working directory and most do not expand ~:
Then use the source form of the config in Configure your MCP client below.
Set up the Entra app
You need an Entra ID app registration — about two minutes. Do not create a client secret: this registers as a public client, which signs you in through your browser using PKCE. A secret on a program running on your own machine would be readable by anyone with the config file, which is why the flow is designed not to need one. Nothing goes into a config file except two ids, neither of which is sensitive.
In the Entra portal → App registrations → New registration:
- Name: anything, e.g.
ms-graph-mcp - Supported account types: Accounts in this organizational directory only
- Redirect URI: select Public client/native, value
http://localhost
Leave Certificates & secrets alone — you do not need anything from it.
Then, on the new app:
-
Authentication → enable Allow public client flows
-
API permissions → Add a permission → Microsoft Graph → Delegated permissions, and add what you want the agent to reach. A sensible read-only starting set:
The complete copy-paste consent sets — and which permission each individual tool needs — are in docs/permissions.md.
Copy the Application (client) ID and Directory (tenant) ID from the Overview page. That is everything you need.
Configure your MCP client
Every MCP client that speaks stdio takes the same three things — a command, its arguments, and an environment block:
Where that block goes, and what the surrounding key is called, differs:
The first sign-in opens your browser for normal Microsoft 365 SSO — including MFA and conditional
access. The result is cached in ~/.ms-graph-mcp/token_cache.json, owner-readable only, so it does
not prompt again.
VS Code
Reload the window. VS Code prompts once for the two ids and remembers them, so this file is safe to
commit. Open the Chat view, switch to Agent mode, and the tools appear under the tools picker —
that is the panel in the screenshot above. Confirm with MCP: List Servers, which shows status
and output if it does not connect.
Claude Code
Confirm with /mcp inside Claude Code — it lists the server and its tools.
Claude Desktop
Confirm by quitting Claude Desktop fully — not just closing the window — reopening it, and looking for the tools icon in the composer.
Cursor and Windsurf
Both use the same mcpServers shape as Claude Desktop, in the file named in the table above.
MCP Inspector
The quickest way to check the server independently of any client:
Needs Node 22.19+. It opens a browser UI where you can list tools and call them by hand — worth
doing before blaming your client. There is a scriptable --cli mode too; see
docs/testing.md.
Pass variables with
-e, not from your shell. Inspector does not give the server it spawns your environment, soGRAPH_MCP_CLIENT_ID=… npx @modelcontextprotocol/inspector …starts the server with no client id. The-eflags go after the server command.
Running from source instead
Same blocks as above — swap the command and args for your clone's absolute path:
Two things catch people out here:
uv must be on the client's PATH. GUI apps launched from Finder or the Dock do not inherit your
shell's PATH, so a client can fail to start the server with an unhelpful error. If that happens, put
the output of which uv in "command" instead of the bare name.
--directory is not optional. Without it, uv run resolves against whatever directory the
client happened to launch from, which will not be the project.
Something not working?
docs/troubleshooting.md covers the Entra errors, Conditional Access, corporate TLS proxies, and the "server disconnected" that is almost always a startup error your client is hiding.
Configuration
Two settings get you running; everything else has a working default.
Every setting, both deployment shapes, and the hosted/OBO options are in docs/configuration.md. For running it as a service, see docs/hosting.md.
Toolset profiles
85 tools is a lot to put in front of a model. GRAPH_MCP_TOOLSETS selects named profiles, each a
group of namespaces:
Combine them with commas:
core is the default, so some tools are not advertised unless you ask for them. If you want
Teams chat, Planner, OneNote, meeting transcripts or directory lookups, name those profiles — or set
GRAPH_MCP_TOOLSETS=all to expose everything.
Over HTTP a caller may send X-Toolsets to narrow further for one request. It can only narrow.
The startup value is a ceiling, so a client asking for all gains nothing the deployment did not
already enable. This filters visibility, not authority — the write-scope and internal-tier gates
are what actually stop a call.
Tool surface
Three tiers, one auth seam.
The internal tier is not part of the agent surface. A model sees 76 agent-visible tools. By namespace: mail 11 · tasks 11 · calendar 10 · files 10 · chat 8 · directory 7 · meetings 7 · people 6 · notes 5 · search 1.
Tool names are namespaced by Graph permission family rather than by Microsoft product, because real
questions cross product boundaries — files_ covers OneDrive and SharePoint document libraries,
which are the same driveItem resource underneath.
Every tool declares MCP annotations (readOnlyHint, destructiveHint, idempotentHint) so clients
know what needs confirming, and every description names the delegated permission it requires.
Renamed in 0.2.0. Every pre-0.2.0 tool name still works as an alias, and will keep working until 0.4.0. Aliases are honoured by
tools/callbut never advertised intools/list, so they cost no context.
Documentation
Published as a searchable site at https://nitinksingh.com/ms-graph-mcp/.
What's next
SharePoint sites and lists are the largest gap; directory completion, file move/delete, and mail drafts follow. Sovereign clouds (GCC High / 21Vianet) are unsupported today. The full list, and what is deliberately out of scope, is in docs/roadmap.md.
Getting help
- Setup and app-registration questions → Discussions
- Bugs → Issues, with the output of running the server in a terminal
- Security vulnerabilities → never a public issue; see SECURITY.md
Never paste an access token, client secret or shared secret into any of them.
Contributing
Issues and pull requests are welcome. Start with CONTRIBUTING.md; participation is governed by the Code of Conduct.
License
MIT — see LICENSE.
來源:README.md,提交 5625f57
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分