Table of contents

Thousands of companies trust Merge to accelerate AI from PoC to production.
Get a demo

How to connect a SharePoint MCP to Cursor (4 steps)

Jon Gitlin
Senior Content Marketing Manager
at Merge

Developers writing SharePoint integrations in Cursor have to leave the editor, make test calls against a live environment, and copy JSON back in just to discover the field names their code depends on.

To help your developers inspect live SharePoint API responses more easily within Cursor, we'll show you how to connect SharePoint with Merge Agent Handler's SharePoint MCP server.

How it works

Merge Agent Handler connects Cursor to the SharePoint API through the Merge CLI.

Install the CLI, authenticate once, and run a single setup command from your project root. That command writes a ## Merge CLI section to the project's .cursorrules file, which tells Cursor's agent when to call merge search-tools and merge execute-tool to reach SharePoint.

Once authenticated, Merge handles Microsoft OAuth credential management and Azure AD token refresh so you never configure an Azure AD app registration or store Graph API tokens locally.

Here's the registration command:

merge setup cursor

Prerequisites

Before getting started, you'll need the following:

  • A Merge Agent Handler account
  • Cursor installed
  • pipx installed (run pipx --version to confirm, or install via pip install pipx)
  • A Microsoft 365 account with access to the SharePoint sites you want to connect

If you want to connect Merge Agent Handler's SharePoint MCP with internal or customer-facing agentic products, you can follow the steps in our docs.

1. Install the Merge CLI

Install with pipx and verify: pipx install merge-api

Verify your installation: merge --version

2. Log in to Merge

Run the following to authenticate the CLI with your Merge Agent Handler account: merge login

This links the CLI to your account so it can make authorized requests to SharePoint on your behalf.

Related: How to use a Sharepoint MCP in Claude Code

3. Connect the CLI to Cursor

Run the following from the root of the project where you want to use Merge tools:

merge setup cursor

This writes a ## Merge CLI section to .cursorrules so Cursor knows to use the CLI for third-party services. The command is idempotent, safe to re-run if you need to reset.

4. Authenticate SharePoint

Open a Cursor chat in your project and start with a query that reflects real development work. For example: "Fetch the column definitions for a SharePoint list in my default site, including each column's internal name, data type, and whether it's required, so I can write accurate field interfaces for a list item creation function."

The first time you invoke a SharePoint tool, a Magic Link will appear to complete connector authentication.

Sharepoint auth UI

{{this-blog-only-cta}}

SharePoint MCP FAQ

In case you have more questions on setting up and using the SharePoint MCP in Cursor, we've addressed several more commonly-asked questions below.

What can you do once the SharePoint MCP is connected to Cursor?

With SharePoint connected, Cursor can:

  • Fetch a live DriveItem response while writing TypeScript interfaces: retrieve a real file record from a document library to see the exact field names, nested object shapes, and optional properties your parser or sync tool needs to handle
  • Pull list column internal names and types while building a list item creation function: query a real SharePoint list's schema to get the internal column names, field types, and required constraints before writing the function that populates them
  • Inspect site collection hierarchy while writing multi-site traversal logic: retrieve the list of sites and their sub-sites to understand the structure your traversal code needs to navigate before coding the recursion or fan-out logic
  • Fetch content type field schema while implementing a document creation tool: pull a content type's field definitions from a real library to verify which fields your document creation code needs to set and what format each one expects
  • Check pagination behavior from a large document library while writing a list-all-files feature: fetch a real paged response to see the nextLink structure your pagination loop needs to handle before coding the continuation logic
  • Retrieve sharing permission details while coding access-control logic: fetch the permission object on a specific file or folder to see the exact role and identity fields your access-control check needs to inspect before writing the validation layer

Why use Merge Agent Handler vs. a self-hosted SharePoint MCP server?

You can build a self-hosted MCP server on top of Microsoft Graph API's SharePoint endpoints. For a solo developer with an existing Azure AD app registration, the initial setup is achievable: configure the OAuth scopes, handle token storage, write tool schemas for the resources you need.

The credential setup is non-trivial before any of that happens. Microsoft Graph requires an Azure AD app registration with SharePoint-specific API permissions, a working OAuth 2.0 flow, and per-user token storage with refresh logic. That's groundwork you complete before writing a single tool schema, and it needs to be replicated for every developer on the team.

Microsoft offers an official Work IQ SharePoint MCP server, but it requires a Microsoft 365 Copilot license per user. Not every team working with SharePoint data in Cursor will have or want to provision those licenses just to unlock MCP access.

Merge Agent Handler handles the Azure AD and OAuth layer without requiring a Copilot license, and adds tool-level scoping on top.

A read-only schema inspection agent can, for example, only get file and list read tools. It never reaches delete or write operations unless explicitly configured. Every call is also logged with the timestamp, tool name, and inputs.

Why connect SharePoint to Cursor?

Developers writing SharePoint integrations via Microsoft Graph need to understand what the API actually returns before the code can be correct.

The documentation describes the resource schemas in the abstract. A real response from your tenant shows you which fields are present, which are null, what the internal column names are for your org's list configuration, and how the nested objects are structured in the version of Graph your app is calling against.

With the SharePoint MCP connected, Cursor can fetch that reference data inline while you write the code that depends on it.

Jon Gitlin
Senior Content Marketing Manager
@Merge

Jon Gitlin is the Managing Editor of Merge's blog. He has several years of experience in the integration and automation space; before Merge, he worked at Workato, an integration platform as a service (iPaaS) solution, where he also managed the company's blog. In his free time he loves to watch soccer matches, go on long runs in parks, and explore local restaurants.

Read more

Introducing the new Merge

Company

How Merge activates institutional knowledge with Agent Handler’s Notion connector 

AI

How Merge uses Agent Handler’s Ahrefs connector to automate SEO and AEO research

AI

Subscribe to the Merge Blog

Get stories from Merge straight to your inbox

Subscribe

Connect Cursor to thousands of tools with Merge Agent Handler

Use Merge Agent Handler’s 150+ connectors (including SharePoint) to power reliable, secure, and powerful agents.

Get started for free
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text