Graph Excel

io.github.mickey-ichi由 GitHub 帳號 mickey-ichi 發布v0.5.2更新於 Nov 7, 2026

Read and edit Excel workbooks on SharePoint/OneDrive via Microsoft Graph, with verified writes.

概覽

AI 產生的概覽

透過 Microsoft Graph 讀取與編輯 SharePoint、OneDrive 或 Teams 上的 Excel 活頁簿,寫入預設為試執行並回讀驗證。

可以做什麼
  • 登入並檢查 Microsoft Graph 權杖,將活頁簿別名解析為 driveId、itemId 及各工作表的已使用範圍
  • 讀取儲存格值與每格雜湊,以子字串或正規表示式跨工作表搜尋儲存格文字
  • 依基準檢查寫入數值區塊並回讀確認,在儲存格原有文字下附加或取代更新段落
  • 批次設定或清除填滿色彩,並套用粗體、字型、換行、對齊與數字格式
  • 新增、重新命名工作表,插入或附加列,所有變更在明確送出前皆為試執行
適用情境
適合讓助理不需瀏覽器即可檢視或更新 Microsoft 365 中的共用 Excel 活頁簿,尤其是多人同時編輯、必須避免覆蓋他人修改的表格。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node 18 或更新版本。需以裝置代碼登入 Microsoft,使用 Graph PowerShell 公開用戶端與委派權限 Files.ReadWrite.All;若租用戶禁止使用者同意,需由系統管理員核准該用戶端。重新整理權杖與活頁簿別名存放在由 GRAPH_EXCEL_HOME 指定的資料夾,預設為 ~/.graph-excel。需要連線至 Microsoft 登入與 Graph 端點的網路。
安裝前請注意
token.json 中的重新整理權杖可讀寫使用者檔案,請保護該資料夾及 GRAPH_EXCEL_HOME 指定的位置。寫入會變更真實的共用活頁簿,只有將 send 設為 true 才會實際執行,且不會刪除工作表、列或儲存格。請求時儲存格內容會傳送給助理,所有通訊僅送往 Microsoft Graph。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Graph Excel,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[圖片]

graph-excel-mcp

Read and edit Excel workbooks on SharePoint and OneDrive from AI agents — without overwriting anyone’s edits.

[npm] [downloads] [CI] [provenance] [license]

npm · Claude Desktop extension · Releases

MCP server for reading and editing Excel workbooks on SharePoint, OneDrive or Teams through Microsoft Graph, without a browser. It is written in TypeScript, has no runtime dependencies, and runs on Node 18 or later.

It is built for workbooks that several people edit at once:

  • Every write starts as a dry run.
  • Before writing, it checks the cells' current content against the version you read, so it won't overwrite someone else's edit.
  • After writing, it reads the cells back to confirm the change.

Install

Claude Code / any MCP host (stdio):

bash
claude mcp add --scope user graph-excel -- npx -y graph-excel-mcp
json
{ "mcpServers": { "graph-excel": { "command": "npx", "args": ["-y", "graph-excel-mcp"] } } }

Claude Desktop extension: download graph-excel-mcp-<version>.mcpb from the latest release and open it. One install covers both Chat and Cowork in Claude Desktop.

Claude plugin (Cowork, Claude Code): install the plugin/ folder of this repo. It contains the server and a graph-excel skill.

Sign in

Call the login_status tool, or run npx graph-excel-mcp login, then enter the code it shows at https://login.microsoft.com/device. The refresh token is saved in ~/.graph-excel/token.json with mode 600. Set GRAPH_EXCEL_HOME to keep it somewhere else.

Sign-in uses the Microsoft Graph PowerShell public client with the delegated scope Files.ReadWrite.All, so you don't need to register an app. If your tenant blocks user consent, an admin has to approve that client once.

Workbook aliases

Instead of pasting the SharePoint URL every time, you can add aliases to ~/.graph-excel/workbooks.json (see workbooks.example.json). The resolve tool returns the driveId and itemId you need for an alias.

Tools

ToolWhat it does
login_statusChecks the token, or starts a device code login
resolveReturns drive/item ids, last modified, and the sheets with their used ranges
read_rangeReturns values plus a sha256: hash per cell, and fills on request
write_valuesWrites blocks of values with a base check (expected) and read-back verification
append_updateAdds or replaces a 「-----update-----」 section under a cell's existing text, keeping the original part byte-identical, and can fill the row with a color
set_fillSets or clears the fill color of one or more ranges in a single batch
findSearches cell text across all sheets (or one), substring or regex, and returns addresses with hashes
add_sheetAdds an empty sheet (Excel name rules, no duplicates), optionally at a position
rename_sheetRenames a sheet
insert_rowsInserts empty rows above a row and verifies the shifted row moved intact
append_rowsAppends rows below the last used row; the target cells must still be empty
set_formatBold, italic, font color and size, wrap, alignment and number format for one or more ranges

Every tool that changes the workbook is a dry run until send: true. Nothing deletes sheets, rows or cells.

Notes

  • Every call runs inside a workbook session. Sessionless calls on large workbooks can time out with a 504 even though the write was applied.
  • Line breaks are sent as \n, which Excel stores as \r\n. If you write \r\n directly, the cell ends up with a stray _x000D_.

Development

Development needs Node 22.18 or later, which runs the .ts sources directly.

CommandWhat it does
npm run mcp / npm run loginRuns the server or the terminal sign-in from src/
npm run typecheckRuns tsc in strict mode with no emit
npm testRuns offline tests: range parsing, update composition, and the MCP handshake on src/ and dist/
npm run buildCompiles src/ to dist/, which is what npm, the .mcpb and the plugin run
npm run packBuilds, then writes build/*.mcpb (gitignored) and plugin/ (committed)

Layout:

PathContents
src/graph.tsAuth and the Graph client
src/excel.tsWorkbook operations
src/mcp.tsTools and the JSON-RPC server
src/cli.tsEntry point

Release

Bump version in package.json, run npm run pack, commit, then push a matching tag:

bash
git tag v0.3.1 && git push origin v0.3.1

The Publish workflow runs the tests, publishes to npm through trusted publishing (no token or OTP; provenance attached) and creates a GitHub release with the .mcpb attached.

Privacy

graph-excel-mcp has no server of its own and collects nothing. It signs in to Microsoft with a device code and keeps the refresh token only in ~/.graph-excel/token.json (mode 600) on your computer. It talks to Microsoft only — login.microsoftonline.com to sign in and graph.microsoft.com to read and write the workbooks you point it at. Cell contents go to Claude only when you ask for them, and are then handled under your Claude plan's terms. No telemetry, no third-party services.

Support

If graph-excel-mcp saves you time, you can support its development through GitHub Sponsors. Bug reports and pull requests are just as welcome.

License

MIT

來源:README.md,提交 7535b0a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.2最新Nov 7, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分