Connector guide8-minute read15 MCP tools7 languages

How to Connect Microsoft Excel to ChatGPT via MCP

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.

HCBy HelpCode teamUpdated 8 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Excel (Microsoft 365)

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.

tools

15

Region

INTL

Category

Productivity

Authentication

OAuth 2.0

Required env vars

MICROSOFT_CLIENT_IDMICROSOFT_CLIENT_SECRETMICROSOFT_TENANT_ID
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

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.

Start free trial

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.

Excel (Microsoft 365) · live via MCP
Share
Opus 4.7

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 + ChatGPT

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

  1. Open the Microsoft Entra admin center (entra.microsoft.com) or the Azure portal and go to Applications → App registrations → New registration.

  2. 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) or consumers (personal accounts only).

    If the value does not match the account type, Microsoft refuses the sign-in (AADSTS50194 or AADSTS50020).

  3. Under Redirect URI, pick the platform Web and enter https://cloud.anythingmcp.com/api/mcp-oauth/callback. If you host AnythingMCP yourself, enter https://your-anythingmcp-host/api/mcp-oauth/callback instead. The URI must match character for character, otherwise Microsoft answers AADSTS50011.

  4. Open API permissions → Add a permission → Microsoft Graph → Delegated permissions and add offline_access, User.Read and Files.ReadWrite. offline_access is what makes Microsoft issue a refresh token; without it the connector stops an hour after you authorize it.

  5. 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.

  6. Paste the Application (client) ID from the Overview page into MICROSOFT_CLIENT_ID, the secret value into MICROSOFT_CLIENT_SECRET and the tenant value from step 2 into MICROSOFT_TENANT_ID, then install the connector.

  7. 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.

  8. 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 (plus Files.ReadWrite.All for workbooks in SharePoint or shared with you)
  • SharePoint: Sites.ReadWrite.All and Files.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 ChatGPT

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 shows YOUR_SERVER_ID.

ChatGPT connects to MCP servers as custom apps in developer mode, available on paid plans (not on Free). On Business and Enterprise workspaces an admin may have to allow it first.

  1. In ChatGPT, open Settings → Security and login and turn on Developer mode.
  2. Go to chatgpt.com/plugins and click +.
  3. Enter a name and a short description, e.g. Name: Microsoft Excel.
  4. Under Connection, enter the MCP server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID and create the connection.
  5. When ChatGPT asks, sign in to AnythingMCP (OAuth) and allow access.

Available tools

ToolWhat it does
excel_get_my_driveGet the signed-in user's OneDrive: its id (the drive_id for workbooks stored there), type and owner
excel_find_workbooksSearch the user's OneDrive for workbooks by name or content, e.g. "budget" or "xlsx"
excel_get_workbook_by_pathLook 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_worksheetsList the worksheets (tabs) of a workbook: id, name, position (0-based) and visibility
excel_read_rangeRead 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_rangeRead the part of a worksheet that holds values (its used range): address (e.g
excel_update_rangeWrite into a range, overwriting what is there: values, or formulas (e.g. [["=SUM(B2:B20)"]]), and optionally numberFormat
excel_add_worksheetAdd a worksheet (tab) at the end of the workbook
excel_list_tablesList the tables (formatted Excel tables) of a workbook: id, name, showHeaders, showTotals and style
excel_list_table_columnsList a table's columns: id, name (the header text) and index
excel_list_table_rowsRead the data rows of a table (without the header): each row's index and values
excel_add_table_rowsAppend 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_tableTurn 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_rangeClear a range: its contents, its formats, or both
excel_delete_worksheetDelete 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

Does the free ChatGPT plan work with custom MCP connectors? No. Custom MCP connections need developer mode, which is only on paid plans.

Next steps

Was this guide helpful?

Your Excel agent is one click away.

Install the connector, paste the key, prompt ChatGPT. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Microsoft Excel to Claude via MCP

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.

Connectors

How to Connect Microsoft Excel to Cursor via MCP

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.

Connectors

How to Connect Microsoft Excel to Gemini via MCP

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.

Connectors

How to Connect Microsoft Excel to Meta Muse via MCP

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.

Connectors

Microsoft Excel to MCP: Drive Microsoft Excel from any AI Agent

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.

Connectors

How to Connect HubSpot to ChatGPT via MCP

Let your AI work in HubSpot CRM: search and update contacts, companies, deals and tickets, see who is linked to what, check pipelines and owners, and log notes and tasks. One account, through a service key you create yourself.