# Excel — how to use (mcp.ai)

Microsoft Excel is a powerful spreadsheet application for data analysis, calculations, and visualization, enabling users to organize and process data with formulas, charts, and pivot tables

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_excel?ms=1781541840000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `excel_add_chart`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/excel`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/excel/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/excel/add/chart` — Add a chart to a worksheet using microsoft graph api.
  - body: { type: string, item_id: string, seriesby: string, worksheet: string, session_id?: string, sourcedata: string }
- `POST https://api.mcp.ai/api/excel/add/sharepoint/worksheet` — Add a new worksheet to a sharepoint excel workbook using microsoft graph sites api.
  - body: { name: string, item_id: string, site_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/add/table` — Create a table in a workbook using microsoft graph api.
  - body: { name: string, style: string, item_id: string, table_id: string, hasHeaders: boolean, session_id?: string, showTotals: boolean }
- `POST https://api.mcp.ai/api/excel/add/table/column` — Add a column to a table using microsoft graph api.
  - body: { index: integer, values: array[], item_id: string, table_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/add/table/row` — Add a row to a table using microsoft graph api.
  - body: { index?: integer, values: array[], item_id: string, table_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/add/workbook/permission` — Tool to grant access to a workbook via invite. use when you need to share a specific workbook file with designated recipients and roles.
  - body: { roles: string[], item_id: string, message?: string, password?: string, recipients: object[], requireSignIn?: boolean, sendInvitation?: boolean, expirationDateTime?: string, retainInheritedPermissions?: boolean }
- `POST https://api.mcp.ai/api/excel/add/worksheet` — Add a new worksheet to an excel workbook using microsoft graph api.
  - body: { name: string, item_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/apply/table/filter` — Apply a filter to a table column using microsoft graph api.
  - body: { item_id: string, criteria: object, table_id: string, column_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/apply/table/sort` — Apply a sort to a table using microsoft graph api.
  - body: { fields: object[], item_id: string, table_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/clear/range` — Tool to clear values, formats, or contents in a specified worksheet range. use when you need to reset cells before adding new data.
  - body: { address: string, applyTo?: string, item_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/clear/table/filter` — Clear a filter from a table column using microsoft graph api.
  - body: { item_id: string, table_id: string, column_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/close/session` — Tool to close an existing excel workbook session. use when you need to explicitly end a persistent session to release workbook locks.
  - body: { item_id: string, session_id: string }
- `POST https://api.mcp.ai/api/excel/convert/table/to/range` — Convert a table to a range using microsoft graph api.
  - body: { item_id: string, table_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/create/workbook` — Tool to create a new workbook file at a specified drive path. use when uploading a new .xlsx file to onedrive.
  - body: { path: string, content: string, drive_id?: string }
- `POST https://api.mcp.ai/api/excel/delete/table/column` — Delete a column from a table using microsoft graph api.
  - body: { item_id: string, table_id: string, column_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/delete/table/row` — Delete a row from a table using microsoft graph api.
  - body: { item_id: string, table_id: string, row_index: integer, session_id?: string }
- `POST https://api.mcp.ai/api/excel/delete/worksheet` — Tool to delete a worksheet from the workbook. use when cleaning up unused or temporary sheets after verifying no dependencies exist. example: "delete 'sheet2' after review."
  - body: { item_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/get/chart/axis` — Tool to retrieve a specific axis from a chart. use when you need properties like min, max, interval, and formatting of the chart axis.
  - body: { expand?: string, select?: string, item_id: string, axis_type: string, worksheet: string, chart_name: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/get/chart/data/labels` — Tool to retrieve the data labels object of a chart. use when you need to inspect label settings like position, separator, and visibility flags after creating or updating a chart.
  - body: { item_id: string, chart_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/get/chart/legend` — Tool to retrieve the legend object of a chart. use after creating or updating a chart when you need to inspect legend visibility and formatting.
  - body: { expand?: string, select?: string, item_id: string, chart_name: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/get/range` — Get a range from a worksheet using microsoft graph api.
  - body: { address: string, item_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/get/session` — Create a session for an excel workbook using microsoft graph api.
  - body: { item_id: string, persist_changes?: boolean }
- `POST https://api.mcp.ai/api/excel/get/sharepoint/range` — Get a range from a worksheet in sharepoint using microsoft graph sites api.
  - body: { address: string, item_id: string, site_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/get/sharepoint/worksheet` — Get a worksheet by name or id from a sharepoint excel workbook using microsoft graph sites api.
  - body: { item_id: string, site_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/get/table/column` — Tool to retrieve a specific column from a workbook table. use when you need to fetch column properties and data by its id or name.
  - body: { item_id: string, table_id: string, column_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/get/workbook` — Tool to retrieve the properties and relationships of a workbook. use when you need to inspect comments, names, tables, or worksheets.
  - body: { expand?: string[], item_id: string, drive_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/get/worksheet` — Get a worksheet by name or id from an excel workbook using microsoft graph api.
  - body: { item_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/insert/range` — Tool to insert a new cell range into a worksheet, shifting existing cells down or right. use when you need to create space for new content without overwriting.
  - body: { shift: string, address: string, item_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/list/chart/series` — Tool to list all data series in a chart. use when you need to enumerate chart series for further analysis.
  - body: { item_id: string, worksheet: string, chart_name: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/charts` — List charts in a worksheet using microsoft graph api.
  - body: { item_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/comments` — Tool to list comments in an excel workbook. use when you need to retrieve all workbook comments via microsoft graph api.
  - body: { item_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/files` — List files and folders in a drive root or specified path.
  - body: { path?: string, drive_id?: string }
- `POST https://api.mcp.ai/api/excel/list/named/items` — List named items in a workbook using microsoft graph api.
  - body: { item_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/sharepoint/tables` — List tables in a sharepoint worksheet using microsoft graph sites api.
  - body: { item_id: string, site_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/sharepoint/worksheets` — List worksheets in an excel workbook stored in sharepoint using microsoft graph sites api.
  - body: { item_id: string, site_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/table/columns` — List columns in a table using microsoft graph api.
  - body: { item_id: string, table_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/table/rows` — List rows in a table using microsoft graph api.
  - body: { item_id: string, table_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/tables` — List tables in a worksheet using microsoft graph api.
  - body: { item_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/list/workbook/permissions` — Tool to list permissions set on the workbook file. use when you need to see which users or links have access to a specific excel file by supplying its drive and item ids. example: "list permissions fo
  - body: { $top?: integer, $skip?: integer, $expand?: string, $select?: string, item_id: string, drive_id: string }
- `POST https://api.mcp.ai/api/excel/list/worksheets` — List worksheets in an excel workbook using microsoft graph api.
  - body: { item_id: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/merge/cells` — Merge cells in a worksheet range using microsoft graph api.
  - body: { range: string, across?: boolean, item_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/protect/worksheet` — Tool to protect a worksheet using optional protection options. use when you need to prevent editing certain parts of a sheet before sharing. example: "protect 'sheet1' to lock formatting and sorting."
  - body: { item_id: string, options?: object, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/sort/range` — Sort a range in a worksheet using microsoft graph api.
  - body: { fields: object[], item_id: string, worksheet: string, range_type: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/update/chart` — Update a chart in a worksheet using microsoft graph api.
  - body: { top?: number, left?: number, name?: string, width?: number, height?: number, item_id: string, chart_id: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/update/chart/legend` — Tool to update formatting or position of a chart legend. use when adjusting legend settings after confirming chart and worksheet exist.
  - body: { item_id: string, overlay?: boolean, visible?: boolean, chart_id: string, position?: string, worksheet: string, session_id?: string }
- `POST https://api.mcp.ai/api/excel/update/range` — Update a range in a worksheet using microsoft graph api.
  - body: { values: array[], address: string, item_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/update/sharepoint/range` — Update a range in a sharepoint worksheet using microsoft graph sites api.
  - body: { values: array[], address: string, item_id: string, site_id: string, session_id?: string, worksheet_id: string }
- `POST https://api.mcp.ai/api/excel/update/table` — Update a table in a workbook using microsoft graph api.
  - body: { name?: string, style?: string, item_id: string, table_id: string, session_id?: string, showTotals?: boolean, showHeaders?: boolean }
- `POST https://api.mcp.ai/api/excel/update/worksheet` — Update worksheet properties (name, position) in an excel workbook using microsoft graph api.
  - body: { name?: string, item_id: string, position?: integer, worksheet: string, session_id?: string }

## More
- Page: https://mcp.ai/excel
- Agent spec (llms.txt): https://mcp.ai/excel/llms.txt
- Postman collection: https://mcp.ai/excel/postman.json
