# graph-excel-mcp [Health: Active]

**Category:** 🏢 Workplace & Productivity  
**Repository:** https://github.com/mickey-ichi/graph-excel-mcp  
**GitHub Stars:** 4  
**npm Downloads (last month):** 1399  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/graph-excel-mcp

## Description
MCP server for reading and editing Excel workbooks on SharePoint/OneDrive via Microsoft Graph: base-checked writes, read-back verification, fills. Zero dependencies.

## Tools
Capabilities this server exposes over MCP:

- **login_status** — Check the Microsoft Graph sign-in. If not signed in, starts a device code login and returns the URL + code: give them to the user (never sign in for them), then call login_status again once they say they're done.
- **resolve** — Workbook info: driveId/itemId, last modified (when/by whom), and every sheet with its used range.
- **read_range** — Read one contiguous range (e.g. H60:J60). Each cell comes with sha256:<hash> to pass back as `expected` when writing. fills=true adds each cell's fill color (≤400 cells). hashOnly=true omits the text (just hash + length).
- **write_values** — Write blocks of cell values. Each block is one contiguous range with a 2D `values` array (a scalar for one cell). `expected` (same shape; exact text, sha256:<hash>, or null to skip a cell) is the base check: a block whose current content differs is skipped as a conflict, never half-written. After writing, every block is read back and compared (status written-verified / written-mismatch). Values are interpreted like typed input: text that looks like a number/date may be converted — mismatches report it.
- **append_update** — Write the 「-----update-----」 part of cells in one row (e.g. H/I/J) and keep the original part byte-identical. No separator yet: appends blank line + separator + text. Separator present: mode=replace (default) swaps the update part, mode=append adds after it. Pass `expected` per column (sha256 from read_range) as the base check. After writing it verifies the original part is intact, then fills `fillRange` (default the updated columns of that row) with `fill` (default #FFFF00; null = no fill).
- **set_fill** — Set or clear the fill color of one or more contiguous ranges (non-contiguous rows = several ranges; sent in one batch). color "#FFFF00" etc., or null to clear. Verified by reading the fill back.
- **find** — Search cell text across every sheet (or one `sheet`): case-insensitive substring by default, regex=true for a JavaScript regular expression. Returns sheet, address, a preview and the sha256 hash per hit (≤ limit, default 50, max 500).
- **add_sheet** — Add an empty worksheet (Excel name rules, no duplicate names), optionally at `position` (0 = first). Verified by listing the sheets afterwards.
- **rename_sheet** — Rename a worksheet (Excel name rules, no duplicate names). Formulas that refer to it follow the new name. Verified by listing the sheets afterwards.
- **insert_rows** — Insert `count` empty rows above `row`; everything from `row` down shifts down. The dry run shows the row that will move. Verified afterwards: that row is found at row+count and the new rows are empty.
- **append_rows** — Append rows below the last used row of a sheet, starting at `column` (default A). `values` is a 2D array, one array per row. Base check: the target cells must still be empty; read back and verified like write_values.
- **set_format** — Format one or more contiguous ranges: bold, italic, fontColor (#RRGGBB), fontSize, wrapText, horizontalAlignment (General/Left/Center/Right/Justify), numberFormat (e.g. "yyyy-mm-dd", "0.00", "@" for text). Font changes are read back and verified. Fill colors: use set_fill.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "graph-excel-mcp": {
    "command": "npx",
    "args": ["-y","graph-excel-mcp"]
  }
}
```

## Documentation

## What graph-excel-mcp does

graph-excel-mcp exposes Excel workbook operations through MCP and Microsoft Graph. It works with files on SharePoint, OneDrive, and Teams without requiring a browser. The server can inspect workbook metadata, read cell values and formatting, search across sheets, update existing content, append rows, insert rows, create or rename sheets, and change selected formatting properties.

The write workflow is designed for workbooks edited by multiple people. Mutating calls first produce a dry run unless `send: true` is supplied. Before writing, the server compares the target cells with the expected content from an earlier read. Afterward, it reads the affected cells back to verify the operation. Nothing deletes sheets, rows, or cells.

## How it works

Sign-in uses Microsoft’s device code flow with the delegated `Files.ReadWrite.All` scope. The user receives a code and completes authentication at Microsoft’s device login page. A refresh token is stored locally in `~/.graph-excel/token.json` with restrictive file permissions. The `GRAPH_EXCEL_HOME` setting can move this data to another directory.

Each operation runs within a workbook session. A workbook can be addressed using its SharePoint or OneDrive location, or through an alias configured in `~/.graph-excel/workbooks.json`. The `resolve` operation returns the drive and item identifiers, modification time, sheet names, and used ranges needed for subsequent calls.

Cell reads include a `sha256:` hash for each value. Those hashes support the base check used by write operations and are also returned by searches. For text annotations, `append_update` preserves the existing portion of a cell byte-for-byte while adding or replacing a delimited update section.

## Setup and configuration

The package runs on Node.js 18 or later and has no runtime dependencies. For an MCP host using stdio, install it with `npx -y graph-excel-mcp`, or configure the equivalent command and argument in the host’s MCP settings. Claude Desktop can also use the `.mcpb` package attached to the latest GitHub release. Claude Code and other MCP hosts can use the stdio command directly.

Authenticate by calling `login_status` or running `npx graph-excel-mcp login`, then complete the device-code flow. If a Microsoft tenant blocks user consent, an administrator must approve the public client. Workbook aliases are optional and are defined in `~/.graph-excel/workbooks.json`.

## Tools and capabilities

- `login_status` checks authentication or begins device-code login.
- `resolve` identifies a workbook and lists sheets with their used ranges.
- `read_range` returns values, per-cell hashes, and optionally fills.
- `write_values` writes value blocks with an expected-content check and read-back verification.
- `append_update` manages a `-----update-----` section beneath existing cell text and can color the row.
- `set_fill` sets or clears fills across ranges in one batch.
- `find` searches one or all sheets using substring or regular-expression matching.
- `add_sheet`, `rename_sheet`, `insert_rows`, and `append_rows` manage workbook structure.
- `set_format` changes bold, italic, font color and size, wrapping, alignment, and number formats.

## Limitations and notes

Mutating tools require `send: true` to apply their dry-run result. `append_rows` only targets cells that remain empty, and new sheets must follow Excel naming rules without duplicating an existing name. Sessionless calls on large workbooks can time out with a 504 even when a write was applied.

Line breaks should be sent as `\n`. Sending `\r\n` directly can leave an `_x000D_` sequence in the Excel cell. Authentication and workbook traffic go to Microsoft services; the server itself has no separate backend or telemetry service.

_Full upstream README: https://allmcps.com/mcp/graph-excel-mcp/readme_

