A terminal session reaching document libraries in three separate Microsoft 365 tenants through a single Carly MCP server

Connect Multiple SharePoint Sites to Claude Code

Add each tenant’s SharePoint to Carly and one Claude Code session searches all of your sites at once. Authorize every Microsoft identity, register a single MCP server, and the terminal works across your own document libraries and both clients’ together.

Claude Code reaches SharePoint the way it reaches everything outside your repository: through the Model Context Protocol. So the tenant count is a property of the server you register, not a Claude Code setting, and every other route holds exactly one Microsoft identity.

1. Add your SharePoint tenants to Carly

  1. Sign in at carlyassistant.com.
  2. Open carlyassistant.com/integrations.
  3. Find SharePoint (Microsoft 365), click Connect, and authorize the account.
  4. Click Connect again for the next one, and repeat for every tenant.

Microsoft reuses the session your browser already holds, so sign out between authorizations or use a separate browser profile and read the full address on the consent screen. An agency signing in twice through the same warm session ends up with a duplicate of its own tenant rather than the client’s.

On a managed tenant an administrator may need to approve the connection, and each tenant decides separately, so three tenants means three requests worth starting early. Each tenant keeps its own authorization, and nothing is merged or copied between them.

Carly connects to thousands of apps, so while you are on that page you can add your inboxes, calendars, CRM, and anything else you want Claude Code to reach through the same server.

2. Register Carly as an MCP server

Carly is a remote HTTP server, so one command does it:

claude mcp add --transport http --scope user carly https://carlyassistant.com/mcp/

--scope user stores the entry in ~/.claude.json and loads it in every project, which is what you want for document libraries you reach from everywhere. Drop the flag and it lands in local scope, visible only in the directory where you added it. --scope project writes a committed .mcp.json for a team.

Then authenticate:

claude mcp login carly

That opens a browser for the OAuth flow. Sign in to the Carly workspace holding the tenants. The /mcp panel inside a session runs the same flow.

Confirm the server is live:

claude mcp list

A healthy entry reads ✔ Connected. ! Needs authentication means the OAuth flow did not finish.

What one session can do across every tenant’s sites

Prompts stop being per-tenant questions:

  • “Search all my SharePoint sites for the latest Adobe statement of work and tell me which tenant and library each version sits in.”
  • “List every document added to my SharePoint libraries this week and group the results by tenant.”
  • “Find the Databricks security review across all my sites and send me the direct link to the most recent copy.”
  • “Create a 2026-Q4 folder in each delivery library and upload the countersigned Stripe order form into the right one.”

Carly searches sites and document libraries, reads files, lists library contents, creates folders, moves and organizes documents, uploads files, and shares them with the people you specify, on every connected tenant. Separation holds throughout: each Microsoft identity keeps its own permissions and its own authorization, and results say which tenant and library a file came from.

The routes Claude Code already has to SharePoint

Three exist, and each one stops at a single tenant.

The first is inherited rather than configured. Claude Code loads the connectors attached to your claude.ai account when you sign in with a subscription, so the Microsoft 365 connector turns up in the terminal without a line of MCP config. An issue on the Claude Code GitHub repository, filed about context bloat, put it plainly: every connector set at the claude.ai account level loads into every CLI session once the login carries the user:mcp_servers scope. Anthropic’s help article on that connector says it reads Word, Excel, PowerPoint, PDF, and plain-text files from SharePoint and OneDrive, and that a Microsoft Entra Global Administrator must authorize it before anyone in the tenant can connect.

SharePoint then adds a scope problem the rest of the suite does not have. Anthropic’s Microsoft 365 connector security guide states that the connector searches SharePoint across the entire tenant using the permissions of the signed-in user, that this needs the tenant-wide Sites.Read.All permission, and that site-specific permissioning with *.Selected scopes is unsupported because the underlying search is tenant-wide. You get one tenant, and you get all of it. A feature request asking for site and library filters, from a user whose large organization returns “a whole lot of relevant data I don’t want,” was closed without being planned.

The second route is Microsoft’s own. Work IQ SharePoint, published as mcp_SharePointRemoteServer under Agent 365 and documented on Microsoft Learn, covers sites, libraries, files, and lists. It is a preview, it requires a Microsoft 365 Copilot license, an administrator registers an enterprise application in Entra and hands you a tenant id and a client id, and file operations cap at 5 MB. The endpoint is tenant-scoped, so a second tenant is a second registration behind a second administrator.

The third is a community Microsoft Graph server, which inherits Microsoft’s consent model whole: a confidential Entra app registration with Sites.Read.All or Sites.ReadWrite.All application permissions and admin consent in the Entra portal. Narrowing that with Sites.Selected simplifies nothing, because the app-level grant only makes the permission available and someone still assigns the app to each site collection, per site, per tenant.

Underneath all three sits the same wall, and it is not the terminal. Guest access does not cross it: the connector uses delegated permissions and acts as you, and a guest authenticates against their home organization, so the token belongs to the tenant that issued it. Conditional access is the other common stop. An issue on Anthropic’s connector repository reports the Microsoft 365 connector failing with “Your organization’s access policy blocks the MCP server,” and an issue on Microsoft’s Agent 365 developer tools repository reports conditional access blocking the browser login the CLI for Microsoft 365 MCP server needs.

Per-tenant Graph servers versus Carly in Claude Code

NeedSelf-hosted Graph MCP serverCarly MCP server
Search one tenant’s sitesYesYes
Search sites in three tenants at onceOne server or one registration per tenantOne server, all tenants
Restrict a search to one libraryVaries by serverYes, per instruction
Register an Entra app and hold a client secretUsually requiredNo
Buy a Microsoft 365 Copilot licenseRequired for Work IQNo
Add a fourth tenant laterNew registration and consentNo config change
Keep the work running with the terminal closedNoYes

Carly gives Claude Code one file toolset that covers every tenant you already have access to, instead of a stack of tenant-specific applications. Carly offers free Zapier-style workflows; AI agents start at $35/month.

The part that outlives the session

A terminal session ends when you close it. The library work does not: filing the countersigned contract against the right client, renaming exports to a convention, lifting the renewal date off a new document and onto a calendar, telling the account owner a deliverable landed.

That work belongs in a Carly workflow or a Carly agent, which runs with nothing open and no session attached. Carly watches each connected tenant individually, so a rule can fire on a document landing in one client’s library and stay quiet on the others.

One wrinkle if you want Carly inside a Claude Code routine: routines run in the cloud against the connectors on your claude.ai account, and a server added locally with claude mcp add lives on your machine. Add Carly at claude.ai/customize/connectors as well, or declare it in a committed .mcp.json. Routines also start from a schedule, a pull request, or an HTTP call, so a document arriving in SharePoint starts nothing.

Rolling this out across an agency with tenant-by-tenant review is available too: book a call.

Quick fixes when a site does not appear

ProblemFix
Server shows ! Needs authenticationRun claude mcp login carly and finish the browser flow
Server missing in another projectRe-add with --scope user, or move the entry out of local scope
claude -p reports the tools are unavailableSign in interactively once with /mcp, then rerun the script
The same tenant connected twiceRemove the duplicate, sign out of Microsoft, and reconnect the other identity
A client tenant blocks authorizationAsk that tenant’s Entra administrator to approve Carly
A site in your own tenant is invisibleOpen it in a browser as the same account; if you cannot, ask the site owner
A file is missing from resultsConfirm it sits in a site library rather than a personal OneDrive shared into it

Frequently asked questions

Can Claude Code reach SharePoint sites in two Microsoft tenants?

Through Carly, yes. Each tenant is authorized separately on the integrations page, Claude Code talks to one MCP server, and a single session covers all of them at once.

Does guest access get Claude Code into a client’s SharePoint?

No. The Microsoft 365 connector acts with your delegated permissions, and a guest account authenticates against its home organization, so the token belongs to the tenant that issued it rather than the one hosting the site.

Can I limit a search to one SharePoint library?

Not through the native connector: Anthropic documents SharePoint search as tenant-wide, with *.Selected scopes unsupported. Carly takes the library as part of the instruction, so a prompt can stay inside one site or sweep all of them.

Do I need a Microsoft 365 Copilot license?

Not for this route. Copilot licensing gates Microsoft’s own Work IQ SharePoint server. Carly handles the Microsoft authorization on the integrations page, with no Entra app registration and no client secret.

Will this work in a non-interactive run?

Yes, once you have signed in. Claude Code cannot run an OAuth flow mid-script, so complete claude mcp login carly from an interactive session first and the claude -p run inherits the stored token.


Related: Multiple OneDrive accounts in Claude Code · Multiple Outlook accounts in Claude Code · Multiple email accounts in Claude Code · Multiple SharePoint sites in Claude · SharePoint MCP · Claude Code MCP · Best AI assistants for SharePoint

Ready to automate your busywork?

Carly schedules, researches, and briefs you—so you can focus on what matters.

See what people say

"Before Carly, I relied on a Calendly link, but the whole process felt impersonal and not very professional. Carly changed that by handling all the back-and-forth, so I'm no longer stuck in endless email threads trying to line up schedules.

Now Carly reaches out to candidates, shares my real-time availability, lets them pick a slot, then sends a Zoom link and drops it straight into my calendar. She sends reminders to both of us before each call, which has significantly reduced no-shows and last-minute confusion.

On top of scheduling, Carly acts like a full executive assistant, sending me my schedule the night before so I can prepare for each call. It reminds me of the old x.ai assistant, but Carly is noticeably smarter, faster, and better suited to my healthcare recruitment business."

Gus Ibrahim, Founder & Director, IHR