MCPInstall

Graph Excel

by mickey-ichi 4 stars mickey-ichi/graph-excel-mcp

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

READMEmain
Graph Excel README: icon

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 · Codex plugin · Excel add-in · 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 works with Claude Code, Claude Desktop (Chat and Cowork), Codex, Cursor and any other MCP client.

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

ClientRecommendedIncludes the skill
Claude Codeclaude mcp add --scope user graph-excel -- npx -y graph-excel-mcpnpx -y graph-excel-mcp setup
Claude Desktop (Chat, Cowork).mcpb extension from the latest release—
Codex (CLI, app)Codex plugin: codex plugin marketplace add mickey-ichi/graph-excel-mcp, then codex plugin add graph-excel@graph-excelyes
Cursor, other MCP hoststhe JSON belownpx -y graph-excel-mcp setup

npx graph-excel-mcp config prints the setup for every client. Details per client:

Claude Code / any MCP host (stdio):

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

Codex plugin (server + skill):

codex plugin marketplace add mickey-ichi/graph-excel-mcp
codex plugin add graph-excel@graph-excel

Or as a plain MCP server: codex mcp add graph-excel -- npx -y graph-excel-mcp, plus npx -y graph-excel-mcp setup for the skill.

See docs/codex.md. npx graph-excel-mcp config prints the setup for every client.

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. The same folder is the Codex plugin (.codex-plugin/).

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, horizontal and vertical alignment, and number format for one or more ranges
set_layoutColumn widths (in characters, like Excel), row heights, autofit, hiding rows or columns
merge_cellsMerges or unmerges ranges, or merges each group of a category column (groupBy); refuses a merge that would drop data
set_bordersDraws or clears borders: outline, inside lines, style, weight and color
insert_columnsInserts empty columns and verifies the shifted column moved intact
delete_rows / delete_columnsDeletes rows or columns; needs the contentHash from the dry run, so nothing changed in between is lost
clear_rangeClears contents, formats or both without shifting cells (contents need the dry run's contentHash)
set_sheet_visibilityHides or shows a sheet
delete_sheetDeletes a sheet; needs confirmName equal to the sheet name

Every tool that changes the workbook is a dry run until send: true. Deleting needs one more proof on top of that: the contentHash the dry run returned (or the sheet name), so the agent deletes only what the user saw.

Excel add-in: dropdowns, conditional formats, freeze panes

Graph's workbook API has no endpoint for data validation (dropdowns), conditional formatting, freeze panes, sheet autofilter, copying a sheet, or reading which cells are merged (checked on v1.0 and beta, 2026-11). The optional graph-excel bridge Excel add-in does them inside the workbook you have open, so co-authors see the change live:

ToolWhat it does
bridge_statusWhether the bridge is on, which workbooks have the add-in open, pairing code
get_validation / set_validationDropdowns (list or =range), number, date, time, text length and custom rules; the dry run lists cells that don't fit
list_conditional_formats / set_conditional_formatCell value, contains text, formula, color scale, data bar, top/bottom, duplicates
set_viewFreeze panes and sheet autofilter
copy_sheetCopies a sheet with its formats, validation and conditional formats
get_merged_areasLists merged areas

Setup: set GRAPH_EXCEL_BRIDGE=1 for the server, install the add-in (Microsoft 365 admin center → Integrated apps → link https://mickey-ichi.github.io/graph-excel-mcp/manifest.xml, or Upload My Add-in for yourself), then pair once with the code the agent shows. Full guide: docs/excel-addin.md (Tiếng Việt). npx graph-excel-mcp addin-manifest prints the manifest's path and URL.

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), plugin/ (Claude and Codex plugin, committed) and .agents/plugins/marketplace.json (Codex marketplace)

Layout:

PathContents
src/graph.tsAuth and the Graph client
src/excel.tsWorkbook operations
src/mcp.tsTools and the JSON-RPC server
src/setup.tsconfig snippets, setup (skill install) and addin-manifest
src/bridge.ts, src/addin.tsLocal bridge to the Excel add-in and its tools
addin/Excel add-in: manifest and task pane, published to GitHub Pages by addin-pages.yml
src/cli.tsEntry point

Release

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

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 your AI agent (Claude, Codex, Cursor…) only when you ask for them, and are then handled under that provider's terms. The optional Excel add-in talks to the server only over 127.0.0.1 on your computer; its task pane files are served by GitHub Pages. 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

More Productivity & Workflow MCP servers

Similar servers from the same category.

Integrates with monday.com API to enable direct access to boards, workflows, and data for automating tasks and managing resources without context switching.

Productivity & Workflow
Activepieces logo

Activepieces

activepieces

Dynamic server to which you can add apps (Google Calendar, Notion, etc) or advanced Activepieces Flows (Refund logic, a research and enrichment logic, etc).

search
Time logo

Time

modelcontextprotocol

Time and timezone conversion capabilities

timeconversion

Interact with Microsoft Word.

word