The Sharepoint MCP server provides access to your organization's Sharepoint resources through the Model Context Protocol, allowing AI assistants to interact with your Sharepoint content, including sites, drives, and documents.
Create your environment configuration file:
cp .env.example .env
Fill in the required fields in the .env
file with your Sharepoint credentials:
TENANT_ID
: Your Microsoft 365 tenant IDCLIENT_ID
: Your registered application's client IDCLIENT_SECRET
: Your registered application's client secretSITE_ID
: The Sharepoint site IDDRIVE_ID
: The Sharepoint drive IDYou can run the server with the MCP inspector to debug and test functionality:
npx @modelcontextprotocol/inspector -e TENANT_ID=your_tenant_id -e CLIENT_ID=your_client_id -e CLIENT_SECRET=your_client_secret -e SITE_ID=your_site_id -e DRIVE_ID=your_drive_id -- node dist/index.js
You can integrate this MCP server with Claude Desktop in two ways:
Build and tag the Docker image:
docker build -t mcp/sharepoint .
Add the following configuration to the "mcpServers" section of your claude_desktop_config.json
:
{
"mcpServers": {
"sharepoint": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"-e", "DOCKER_CONTAINER=true",
"-e", "TENANT_ID=your-tenant-id",
"-e", "CLIENT_ID=your-client-id",
"-e", "CLIENT_SECRET=your-client-secret",
"-e", "SITE_ID=your-site-id",
"-e", "DRIVE_ID=your-drive-id",
"mcp/sharepoint"
]
}
}
}
Build the application:
pnpm run build
Add the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"sharepoint": {
"command": "node",
"args": ["run", "start"],
"env": {
"TENANT_ID": "your-tenant-id",
"CLIENT_ID": "your-client-id",
"CLIENT_SECRET": "your-client-secret",
"SITE_ID": "your-site-id",
"DRIVE_ID": "your-drive-id"
}
}
}
}
The server currently supports the following operations:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.