Microsoft 365 SharePoint — Claude Code MCP server: sites, files
An MCP server that gives your agent SharePoint through Microsoft Graph: find sites, read libraries and lists, search content, and create sharing links.
claude mcp add --env MS_CLIENT_ID=<MS_CLIENT_ID> --env MS_CONFIG_DIR=<MS_CONFIG_DIR> --env MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> --env MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> --env MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> --transport stdio microsoft-sharepoint -- npx -y @mindstone/mcp-server-microsoft-sharepointWhat Microsoft 365 SharePoint does
The server sits on top of the Microsoft Graph API and exposes 46 tools to the agent: authentication, sites, document libraries, pages, lists, metadata, search, and file and list mutations. A typical run finds a document on a given site and hands back a link to it.
OAuth is owned by the host application, not by this server. The host writes token files to ${MS_CONFIG_DIR}/credentials/${sanitised-email}.token.json plus an ${MS_CONFIG_DIR}/accounts.json index; the server only reads them. Incremental consent for Sites.Read.All goes through a dedicated authenticate_sharepoint tool, so the existing mail, calendar, files and teams session stays untouched.
You need Node.js 20+ and npm. Two environment variables are required: MS_CLIENT_ID (the Microsoft Entra application client ID) and MS_CONFIG_DIR. Without a host that runs the OAuth flow and writes the token files, the server will not start — it never initiates sign-in on its own.
What it helps with
- find a document on a SharePoint site by name
- list what a document library contains
- read items from a SharePoint list
- create a read-only sharing link for a team
- search SharePoint content from the agent
Example prompts for the agent
- Find the Q3 OKR doc on the Strategy team's site
- Create a read-only link to that file for the whole organization
- Show me what's in this site's document library
How to install Microsoft 365 SharePoint
Platform CLI
claude mcp add --env MS_CLIENT_ID=<MS_CLIENT_ID> --env MS_CONFIG_DIR=<MS_CONFIG_DIR> --env MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> --env MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> --env MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> --transport stdio microsoft-sharepoint -- npx -y @mindstone/mcp-server-microsoft-sharepointReplace <…> with your own values
Platform CLI
codex mcp add microsoft-sharepoint --env MS_CLIENT_ID=<MS_CLIENT_ID> --env MS_CONFIG_DIR=<MS_CONFIG_DIR> --env MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> --env MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> --env MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> -- npx -y @mindstone/mcp-server-microsoft-sharepointReplace <…> with your own values
Config file
{
"mcpServers": {
"microsoft-sharepoint": {
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-microsoft-sharepoint"
],
"env": {
"MS_CLIENT_ID": "<MS_CLIENT_ID>",
"MS_CONFIG_DIR": "<MS_CONFIG_DIR>",
"MS_ACCOUNT_EMAIL": "<MS_ACCOUNT_EMAIL>",
"MS_MCP_PACKAGE_ID": "<MS_MCP_PACKAGE_ID>",
"MICROSOFT_REQUEST_TIMEOUT_MS": "<MICROSOFT_REQUEST_TIMEOUT_MS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"microsoft-sharepoint": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-microsoft-sharepoint"
],
"env": {
"MS_CLIENT_ID": "<MS_CLIENT_ID>",
"MS_CONFIG_DIR": "<MS_CONFIG_DIR>",
"MS_ACCOUNT_EMAIL": "<MS_ACCOUNT_EMAIL>",
"MS_MCP_PACKAGE_ID": "<MS_MCP_PACKAGE_ID>",
"MICROSOFT_REQUEST_TIMEOUT_MS": "<MICROSOFT_REQUEST_TIMEOUT_MS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MS_CLIENT_ID=<MS_CLIENT_ID> -e MS_CONFIG_DIR=<MS_CONFIG_DIR> -e MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> -e MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> -e MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> microsoft-sharepoint npx -y @mindstone/mcp-server-microsoft-sharepointReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Microsoft 365 SharePoint
How do I install Microsoft 365 SharePoint in Claude Code?
Run `claude mcp add mcp-server-microsoft-sharepoint -e MS_CLIENT_ID=<MS_CLIENT_ID> -e MS_CONFIG_DIR=<MS_CONFIG_DIR> -- npx -y @mindstone/mcp-server-microsoft-sharepoint`. Fill in your client ID and config directory path.
What does Microsoft 365 SharePoint do?
It connects the agent to SharePoint via Microsoft Graph: searching sites and documents, reading libraries, pages and lists, and creating links or making file and list changes.
What does the server need to run?
Node.js 20+, npm, and a host application that handles the Microsoft OAuth flow and writes token files into MS_CONFIG_DIR. The server itself does not sign you in.