SharePoint MCP Server
Read-only MCP server exposing SharePointClient to AI agents: list, browse, and inspect files/folders via the Microsoft Graph API.
| Tool | Description |
|---|
list_items(path: str | None = None) -> list[str] | List item names in a folder (default: drive root) |
list_with_metadata(path: str | None = None) -> list[dict] | List items with name, type, size, modified date |
list_recursive(path: str | None = None, max_depth: int = 10) -> dict | Hierarchical folder/file tree |
get_item_metadata(path: str) -> dict | Metadata for one item, including download_url for files |
read_object_text(path: str, max_bytes: int = 1_000_000) -> str | Read a file's content as UTF-8 text. Refuses (raises) files larger than max_bytes rather than truncating. |
No write-guard needed โ SharePointClient has no write/delete methods at all. download() (writes to a local filesystem path) isn't wrapped; agents don't have a filesystem to write to. Use read_object_text for small text content, or get_item_metadata()'s download_url if a real use case needs the raw bytes or a larger file.
Environment Variables
| Variable | Required | Default | Notes |
|---|
SHAREPOINT_CLIENT_ID | yes | โ | Azure AD app client ID |
SHAREPOINT_CLIENT_SECRET | yes | โ | Azure AD app client secret |
SHAREPOINT_TENANT_ID | yes | โ | Azure AD tenant ID |
SHAREPOINT_SITE_ID | yes | โ | SharePoint site ID |
SHAREPOINT_HOST | no | yourcompany.sharepoint.com | |
Run locally
pip install "data-connectors-ai[sharepoint,mcp]"
data-connectors-sharepoint-mcp
Use with an MCP client
{
"mcpServers": {
"sharepoint": {
"command": "uvx",
"args": ["--from", "data-connectors-ai[sharepoint,mcp]", "data-connectors-sharepoint-mcp"],
"env": {
"SHAREPOINT_CLIENT_ID": "...",
"SHAREPOINT_CLIENT_SECRET": "...",
"SHAREPOINT_TENANT_ID": "...",
"SHAREPOINT_SITE_ID": "..."
}
}
}
}
Registry
Published at io.github.nagarjunr/data-connectors-sharepoint on the official MCP registry.