Excel (Microsoft 365)
Let your AI work with Excel workbooks in OneDrive and SharePoint: list sheets, read any range or a sheet's used range, write values and formulas, read and append table rows, add sheets and create tables. Microsoft 365 through the Microsoft Graph workbook API, signed in with your Microsoft account.
7 天免费 · 无需信用卡 · EU 托管
问 Excel 任何事
通过 AnythingMCP 对 Excel (Microsoft 365) 试一个真实提示 — Claude 调用工具并返回答案。在你的消息上按 Enter 即可在 Cloud 安装。
在 Cloud 上安装 ExcelClaude 是 AI,可能会出错。请核对回答。
2 分钟设置
- 1在 cloud.anythingmcp.com 开始免费试用。
- 2在连接器商店点击 Excel (Microsoft 365)。提示时粘贴凭据。
- 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
配置 Excel (Microsoft 365)
直接来自连接器定义:在哪里获取凭据、需要哪些权限,以及该适配器调用的是哪个 API。 由连接器作者以英文提供。
Excel
This connector reads and writes Excel workbooks (.xlsx) stored in OneDrive or SharePoint through the Microsoft Graph workbook API (https://graph.microsoft.com/v1.0): worksheets, cell ranges, the used range of a sheet, Excel tables and their rows. It works on the file in the cloud, as the user who authorized the connector; Excel for the web and desktop see the changes. Work or school accounts (Microsoft 365) are fully supported; personal OneDrive supports most read and range tools but not table rows.
Setup (one-time, about 10 minutes)
- Open https://entra.microsoft.com (or https://portal.azure.com) → Applications → App registrations → New registration.
- Name it (e.g. "AnythingMCP Microsoft 365") and choose the supported account types:
- Accounts in this organizational directory only (single tenant): only your organisation's users can sign in. Set
MICROSOFT_TENANT_IDto the Directory (tenant) ID shown on the app's Overview page (a GUID), or to your domain such ascontoso.onmicrosoft.com. - Accounts in any organizational directory (multi-tenant): set
MICROSOFT_TENANT_IDtoorganizations. - ... and personal Microsoft accounts: set
MICROSOFT_TENANT_IDtocommon(work, school and personal accounts) orconsumers(personal accounts only). The value must match the app's account type, otherwise Microsoft refuses the sign-in (AADSTS50194 or AADSTS50020).
- Accounts in this organizational directory only (single tenant): only your organisation's users can sign in. Set
- Under Redirect URI pick platform Web and enter
https://cloud.anythingmcp.com/api/mcp-oauth/callbackon AnythingMCP Cloud, or<your AnythingMCP URL>/api/mcp-oauth/callbackwhen you host AnythingMCP yourself. It must match character for character (AADSTS50011 otherwise). - API permissions → Add a permission → Microsoft Graph → Delegated permissions: add
offline_access,User.Read,Files.ReadWrite. - Certificates & secrets → New client secret. Copy the secret Value (not the Secret ID); it is shown once. Note its expiry date: when it expires the connector stops working until you paste a new one.
- Paste the Application (client) ID into
MICROSOFT_CLIENT_ID, the secret value intoMICROSOFT_CLIENT_SECRET, the tenant value from step 2 intoMICROSOFT_TENANT_ID, and install. - On the connector page click Authorize with Provider and sign in with the account whose workbooks the AI should work with. The refresh token is stored encrypted and access tokens (about 1 hour) are renewed automatically.
One Entra app for all Microsoft connectors: the app registration made for the Outlook connector works here as well. Open it, add the delegated permissions from step 4 under API permissions, keep the same redirect URI, and reuse the same MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET and MICROSOFT_TENANT_ID. Each connector asks only for its own scopes when you authorize it. The permissions per connector:
- Outlook:
Mail.ReadWrite,Mail.Send,Calendars.ReadWrite - OneDrive:
Files.ReadWrite - Excel:
Files.ReadWrite(plusFiles.ReadWrite.Allfor workbooks in SharePoint or shared with the user) - SharePoint:
Sites.ReadWrite.AllandFiles.ReadWrite.AllEvery connector also needsoffline_accessandUser.Read.
Admin consent: these delegated permissions normally do not need an administrator, but many organisations turn off user consent. If the sign-in shows "Need admin approval" (AADSTS65001 or AADSTS90094), a tenant administrator opens the app registration → API permissions → Grant admin consent for <organisation> once; afterwards every user can authorize. Each connector still works only with what the account that signed in may see.
Scopes: offline_access User.Read Files.ReadWrite. offline_access is what makes Microsoft issue a refresh token. Files.ReadWrite covers workbooks in the user's own OneDrive. For workbooks in SharePoint libraries or shared by other people, add Files.ReadWrite.All to the app registration and replace Files.ReadWrite with it in the connector's OAuth settings, then authorize again. Even reading a workbook needs write permission, because Graph opens it in an Excel session. To keep the AI from changing workbooks, disable excel_update_range, excel_add_worksheet, excel_add_table_rows, excel_create_table.
Switched off at install: excel_clear_range and excel_delete_worksheet. Turn them on per tool if the AI needs them.
Finding a workbook: every tool takes the workbook's drive_id and item_id.
- In the user's OneDrive:
excel_find_workbooks(search) orexcel_get_workbook_by_path(e.g.Finance/Budget 2026.xlsx) returnidandparentReference.driveId. - In SharePoint: use the SharePoint connector's
sharepoint_list_drivesandsharepoint_search_drivefor the library's drive id and the file's id. Only.xlsx(and.xlsm,.xlsb) files work;.xlsand.csvanswer an error. Then callexcel_list_worksheetsto learn the sheet names.
Reading: excel_read_range reads an address on one sheet (A1:D50, A:C, B2); excel_read_used_range reads everything that holds values and tells the sheet's size. values are a list of rows; numbers come as numbers and dates as Excel serial numbers (days since 30 December 1899): ask for text in fields to get them as displayed. There is no pagination: read big sheets in blocks of rows (A1:Z500, A501:Z1000), keeping each answer under the 200 KB cap. Tables: excel_list_tables, excel_list_table_columns, excel_list_table_rows (paged with top and skip).
Writing
excel_update_rangeoverwrites a range withvaluesorformulas(English function names and commas, e.g.=SUM(B2:B20)), optionally withnumber_format. The arrays must match the range's shape exactly.excel_add_table_rowsappends rows to a table; it is the safest way to add records, because the table grows and keeps its formulas and formats. Send many rows in one call.excel_add_worksheetadds a tab;excel_create_tableturns a range into a table. Changes are saved to the file immediately. If someone has the file open in Excel desktop with unsaved changes, or a large workbook is still loading, Graph can answer 409 or 504: wait a moment and retry.
Limits: Graph handles workbooks up to about 100 MB; requests time out after about 30 seconds, so keep ranges moderate. Excel throttles per workbook; a throttled call answers 429 with Retry-After.
Common errors
- 401
InvalidAuthenticationToken: the authorization was revoked or the client secret expired. Paste a new secret if needed and click Authorize with Provider again. - 403
accessDenied: a permission is missing, or the workbook belongs to someone else and the scope lacksFiles.ReadWrite.All. - 404
itemNotFound: wrong drive or item id, or a worksheet or table name that does not exist (names are case-sensitive in some places; checkexcel_list_worksheets). - 400
InvalidArgument: an address Excel cannot read, or values whose shape does not match the range. 400ItemAlreadyExists: a sheet with that name exists. UnsupportedWorkbookorNotSupported: the file is not .xlsx, is password protected, or is too large for the workbook API.
Out of scope here: creating new workbook files, charts, pivot tables, formatting beyond number formats, named items, and workbook sessions (every call is saved directly).