Graph Excel

السجل الرسمي أخرى

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

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package graph-excel-mcp
Claude Code
claude mcp add graph-excel -e 'GRAPH_EXCEL_HOME=<GRAPH_EXCEL_HOME>' -- npx -y graph-excel-mcp@0.5.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "graph-excel": {
            "command": "npx",
            "args": [
                "-y",
                "graph-excel-mcp@0.5.1"
            ],
            "env": {
                "GRAPH_EXCEL_HOME": "<GRAPH_EXCEL_HOME>"
            }
        }
    }
}

متغيرات البيئة

  • GRAPH_EXCEL_HOME Folder for token.json and workbooks.json. Default: ~/.graph-excel

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. graph-excel-mcp
  2. Install
  3. Sign in
  4. Workbook aliases
  5. Tools
  6. Notes
  7. Development
  8. Release
  9. Privacy
  10. Support
  11. License

graph-excel-mcp

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):

claude mcp add --scope user graph-excel -- npx -y graph-excel-mcp
{ "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:

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

الأسئلة الشائعة

ما هو Graph Excel؟

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

كيف أثبّت Graph Excel؟

يعمل على جهازك. في Claude Code: claude mcp add graph-excel -e 'GRAPH_EXCEL_HOME=<GRAPH_EXCEL_HOME>' -- npx -y graph-excel-mcp@0.5.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Graph Excel إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل Graph Excel مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Graph Excel؟

ينشره mickey-ichi. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.