SharePoint MCP Server

by sekops-ch

Not rated
GitHub

About

Browse and interact with Microsoft SharePoint sites and documents.

Details

Author
sekops-ch
Categories
File Management, Other, Communication

Setup

Install SharePoint MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/sekops-ch/sharepoint-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol server for browsing and interacting with Microsoft SharePoint sites and documents.

This TypeScript-based MCP server provides comprehensive SharePoint integration through Microsoft Graph API, enabling:

- Resources: Access SharePoint sites as MCP resources with structured metadata
- Tools: Search files, list sites, browse document libraries, and retrieve file content
- Authentication: Secure OAuth2 client credentials flow with automatic token management

- List SharePoint sites accessible to the application
- Access individual site information viasharepoint://site/{siteId}URIs
- JSON-formatted site metadata with display names and web URLs

Search for files and documents across SharePoint using Microsoft Graph Search API

- Parameters:

- query(required): Search query string
- limit(optional): Maximum results to return (default: 10)

List SharePoint sites accessible to the application

- Parameters:

- search(optional): Filter sites by display name

Get detailed information about a specific SharePoint site

- Parameters:

- siteUrl(required): SharePoint site URL (e.g.,https://tenant.sharepoint.com/sites/sitename)

List document libraries (drives) in a SharePoint site

- Parameters:

- siteUrl(required): SharePoint site URL

List files and folders in a SharePoint document library

- Parameters:

- siteUrl(required): SharePoint site URL
- driveId(optional): Specific drive ID (uses default drive if not specified)
- folderPath(optional): Folder path to list items from (default: root)

Get the content of a specific file from SharePoint (text files only)

- Parameters:

- siteUrl(required): SharePoint site URL
- filePath(required): Path to the file
- driveId(optional): Specific drive ID (uses default drive if not specified)
- Register an application in Azure Active Directory
- Configure API permissions:

- Microsoft Graph:Sites.Read.All(Application permission)
- Microsoft Graph:Files.Read.All(Application permission)

Set the following environment variables:

SHAREPOINT_URL=https://yourtenant.sharepoint.com TENANT_ID=your-azure-tenant-id CLIENT_ID=your-azure-app-client-id CLIENT_SECRET=your-azure-app-client-secret

Test the server using the MCP Inspector:

The Inspector provides a web interface to test all available tools and resources.

Add the server to your Claude Desktop configuration:

macOS:~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:%APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "sharepoint-mcp-server": { "command": "node", "args": ["/path/to/sharepoint-mcp-server/build/index.js"], "env": { "SHAREPOINT_URL": "https://yourtenant.sharepoint.com", "TENANT_ID": "your-azure-tenant-id", "CLIENT_ID": "your-azure-app-client-id", "CLIENT_SECRET": "your-azure-app-client-secret" } } } }

You can also install the server globally:

The server implements a service-oriented architecture with clear separation of concerns:

- Authentication Layer: Handles OAuth2 token acquisition and refresh
- Graph API Client: Manages HTTP requests to Microsoft Graph API
- Tool Handlers: Process MCP tool requests and format responses
- Resource Handlers: Manage SharePoint site resources and metadata
- Error Handling: Comprehensive error management with proper MCP error codes

- Uses OAuth2 client credentials flow for secure authentication
- Tokens are automatically refreshed before expiration
- All API requests use HTTPS
- Client secrets should be stored securely and never committed to version control
- Application permissions require admin consent in Azure AD
- Authentication Errors: Verify Azure app registration and permissions
- Site Access: Ensure the app has appropriate SharePoint permissions
- Network Issues: Check firewall settings for Microsoft Graph API access

Set environment variable for detailed logging:
- Follow TypeScript best practices
- Maintain comprehensive error handling
- Add tests for new functionality
- Update documentation for API changes

This project is licensed under the Mozilla Public License 2.0. See theLICENSEfile for details.

We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Make your changes
- Add tests for new functionality
- Ensure all tests pass (npm test)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request

- Follow TypeScript best practices and maintain type safety
- Implement comprehensive error handling with proper MCP error codes
- Add JSDoc comments for all public methods and classes
- Maintain the service-oriented architecture with clear separation of concerns
- Follow SOLID principles and keep functions focused and testable
- Update documentation for any API changes

- Use TypeScript strict mode
- Follow the existing code formatting and naming conventions
- Remove unused imports and variables
- Use descriptive variable and function names
- Prefer composition over inheritance

- Add unit tests for new functionality
- Test error conditions and edge cases
- Ensure the basic test suite passes
- Test with real SharePoint environments when possible

- Update README.md for new features or configuration changes
- Add JSDoc comments for new public APIs
- Include examples for complex functionality
- Update the changelog for significant changes

- Basic SharePoint integration via Microsoft Graph API
- Support for searching files across SharePoint
- Site listing and browsing capabilities
- Document library access and file content retrieval
- OAuth2 client credentials authentication
- MCP resource support for SharePoint sites
- Comprehensive error handling and logging

If you encounter issues or have questions:
- Check the
troubleshooting sectionin this README
- Search existing
GitHub issues
- Create a new issue with detailed information about your problem
- Include relevant logs and configuration (without sensitive information)

- Built with theModel Context Protocol SDK
- Uses Microsoft Graph API for SharePoint integration
- Inspired by the MCP community and ecosystem

Integrates with Microsoft SharePoint, allowing interaction with documents, folders, and other SharePoint resources.

A secure, multi-user server connecting LLMs to Microsoft 365 services.

Interact with ONLYOFFICE DocSpace for document collaboration and management.

The MCP Server that gives your AI agent a brain for Microsoft SharePoint

Interact with Speckle, the collaborative data hub that connects with your AEC tools.

Read and edit HTML/Markdown tables in GitBook-synced documents via MCP tools.

WeCom (Enterprise WeChat) document operations via MCP — create, read, and edit Docs and Smartsheets. 9 tools. Fills the doc-CRUD gap: existing WeCom MCP servers only support webhook messaging

Integrates with Wiki.js, enabling AI to read and update documentation.

MCP server for XWiki REST API — read your wiki from Claude and other AI agents

Manage files and downloads on Synology NAS devices using an AI assistant.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.