Skip the install. Get this working in under 2 minutes.
Start a free trial on cloud.anythingmcp.com, add the Excel (Microsoft 365) in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.
Summary
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.
Try asking
Example prompts for Excel (Microsoft 365)
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Excel (Microsoft 365), paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Microsoft Excel + Gemini
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.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID
Step 1 — Get credentials
-
Open the Microsoft Entra admin center (entra.microsoft.com) or the Azure portal and go to Applications → App registrations → New registration.
-
Name the app (for example "AnythingMCP Microsoft 365") and choose the Supported account types. The choice decides what goes into
MICROSOFT_TENANT_ID:- Accounts in this organizational directory only (single tenant): only users of your organisation can sign in. Use the Directory (tenant) ID from the app's Overview page (a GUID) or your domain, such as
contoso.onmicrosoft.com. - Accounts in any organizational directory (multi-tenant): use
organizations. - Accounts in any organizational directory and personal Microsoft accounts: use
common(work, school and personal accounts) orconsumers(personal accounts only).
If the value does not match the account type, Microsoft refuses the sign-in (AADSTS50194 or AADSTS50020).
- Accounts in this organizational directory only (single tenant): only users of your organisation can sign in. Use the Directory (tenant) ID from the app's Overview page (a GUID) or your domain, such as
-
Under Redirect URI, pick the platform Web and enter
https://cloud.anythingmcp.com/api/mcp-oauth/callback. If you host AnythingMCP yourself, enterhttps://your-anythingmcp-host/api/mcp-oauth/callbackinstead. The URI must match character for character, otherwise Microsoft answers AADSTS50011. -
Open API permissions → Add a permission → Microsoft Graph → Delegated permissions and add
offline_access,User.ReadandFiles.ReadWrite.offline_accessis what makes Microsoft issue a refresh token; without it the connector stops an hour after you authorize it. -
Open Certificates & secrets → New client secret. Copy the secret Value, not the Secret ID; it is shown only once. Note the expiry date: when the secret expires, the connector stops working until you create a new one and paste it in.
-
Paste the Application (client) ID from the Overview page into
MICROSOFT_CLIENT_ID, the secret value intoMICROSOFT_CLIENT_SECRETand the tenant value from step 2 intoMICROSOFT_TENANT_ID, then install the connector. -
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 (valid for about an hour) are renewed automatically.
-
Start with
excel_get_my_drive: it shows which OneDrive the connector is signed in to.
One Entra app for all Microsoft connectors: the app registration you made for the Outlook, OneDrive or SharePoint connector works here too. Open it, add the permission from step 4 under API permissions, keep the same redirect URI and reuse the same client ID, secret and tenant. Each connector asks only for its own permissions when you authorize it:
- Outlook:
Mail.ReadWrite,Mail.Send,Calendars.ReadWrite - OneDrive:
Files.ReadWrite - Excel:
Files.ReadWrite(plusFiles.ReadWrite.Allfor workbooks in SharePoint or shared with you) - SharePoint:
Sites.ReadWrite.AllandFiles.ReadWrite.All
All of them also need offline_access and User.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 once and clicks API permissions → Grant admin consent for the organisation. After that every user can authorize. Each connector still works only with what the account that signed in may see.
Workbooks in SharePoint or shared with you: Files.ReadWrite covers the workbooks in your own OneDrive. For workbooks in SharePoint libraries or shared by other people, add Files.ReadWrite.All to the app registration, replace Files.ReadWrite with it in the connector's OAuth settings and authorize again. The AI finds a workbook in your OneDrive by name or by path (for example Finance/Budget 2026.xlsx); for a SharePoint library it takes the library's drive id from the Microsoft SharePoint connector.
Keeping workbooks unchanged: even reading a workbook needs a write permission, because Microsoft 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 and excel_create_table.
Switched off at install: excel_clear_range and excel_delete_worksheet. Neither can be undone through the API, only from the file's version history. Turn them on only if the AI really needs them.
Reading and writing: only .xlsx files (and .xlsm, .xlsb) work; .xls and .csv files do not. Dates come as Excel serial numbers unless the AI asks for the displayed text, and large sheets are read in blocks of rows. Appending rows to an Excel table is the safest way to add records: the table grows and keeps its formulas and formats. Formulas use English function names and commas, for example =SUM(B2:B20). Every change is saved to the file at once, and Excel for the web and the desktop app see it. Personal OneDrive accounts support most read and range tools, but not table rows.
Limits: Microsoft Graph handles workbooks up to about 100 MB, and a request times out after about 30 seconds, so keep ranges moderate. If someone has the file open in the Excel desktop app with unsaved changes, or a large workbook is still loading, Graph can answer 409 or 504: wait a moment and try again.
Common errors: 401 InvalidAuthenticationToken means the authorization was revoked or the client secret expired; paste a new secret if needed and click Authorize with Provider again. 403 accessDenied means a permission is missing, or the workbook belongs to someone else and the scope lacks Files.ReadWrite.All. 404 itemNotFound means a wrong workbook, or a sheet or table name that does not exist. 400 InvalidArgument means an address Excel cannot read or values that do not match the shape of the range. UnsupportedWorkbook or NotSupported means the file is not .xlsx, is password protected or is too large for the workbook API.
The connector does not create new workbook files, charts, pivot tables or named items, and does not format cells beyond number formats.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Gemini
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell):anythingmcpshould show as connected. - Start prompting: Gemini CLI can now call the
Microsoft Exceltools.
Available tools
| Tool | What it does |
|---|---|
excel_get_my_drive | Get the signed-in user's OneDrive: its id (the drive_id for workbooks stored there), type and owner |
excel_find_workbooks | Search the user's OneDrive for workbooks by name or content, e.g. "budget" or "xlsx" |
excel_get_workbook_by_path | Look up a workbook in the user's OneDrive by path, e.g. "Documents/Budget 2026.xlsx", and return its id and parentReference.driveId for the… |
excel_list_worksheets | List the worksheets (tabs) of a workbook: id, name, position (0-based) and visibility |
excel_read_range | Read a range of one worksheet, e.g. "A1:D20": returns address and values (a list of rows, numbers as numbers, dates as serial numbers) by… |
excel_read_used_range | Read the part of a worksheet that holds values (its used range): address (e.g |
excel_update_range | Write into a range, overwriting what is there: values, or formulas (e.g. [["=SUM(B2:B20)"]]), and optionally numberFormat |
excel_add_worksheet | Add a worksheet (tab) at the end of the workbook |
excel_list_tables | List the tables (formatted Excel tables) of a workbook: id, name, showHeaders, showTotals and style |
excel_list_table_columns | List a table's columns: id, name (the header text) and index |
excel_list_table_rows | Read the data rows of a table (without the header): each row's index and values |
excel_add_table_rows | Append rows at the end of a table (or insert them at a 0-based index); the table grows and formulas and formats of the table columns carry… |
excel_create_table | Turn a range into an Excel table, e.g. address "Sheet1!A1:D1" with has_headers true to start an empty table from a header row |
excel_clear_range | Clear a range: its contents, its formats, or both |
excel_delete_worksheet | Delete a worksheet with everything on it |
Example prompts
- "Open Finance/Budget 2026.xlsx and tell me which cost centres are over budget."
- "Add these three expenses as new rows to the Expenses table in my travel workbook."
- "Read the Sales sheet and write the monthly totals into a new sheet called Summary."
- "Which tabs does the workbook Pricing 2026 have, and how many rows does each one use?"
FAQ
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
Was this guide helpful?