Logo SharePoint MCP Server

SharePoint MCP Server

Tổ chức
sekops-ch

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

Nhà phát hànhsekops-ch
Kho mãsharepoint-mcp-server
Ngôn ngữJavaScript
Bản fork
5
Sao
10
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    SharePoint MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    10 sao và 5 bản fork từ kho mã được liên kết.

SharePoint MCP Server

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

Features

Resources

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

Tools

search_files

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_sites

List SharePoint sites accessible to the application

  • Parameters:
    • search (optional): Filter sites by display name

get_site_info

Get detailed information about a specific SharePoint site

list_site_drives

List document libraries (drives) in a SharePoint site

  • Parameters:
    • siteUrl (required): SharePoint site URL

list_drive_items

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_file_content

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)

Prerequisites

Azure App Registration

  1. Register an application in Azure Active Directory
  2. Configure API permissions:
    • Microsoft Graph: Sites.Read.All (Application permission)
    • Microsoft Graph: Files.Read.All (Application permission)
  3. Grant admin consent for the permissions
  4. Create a client secret

Environment Variables

Set the following environment variables:

bash
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

Development

Install dependencies:

bash
npm install

Build the server:

bash
npm run build

For development with auto-rebuild:

bash
npm run watch

Testing

Test the server using the MCP Inspector:

bash
npm run inspector

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

Installation

Claude Desktop Configuration

Add the server to your Claude Desktop configuration:

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

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"
      }
    }
  }
}

Global Installation

You can also install the server globally:

bash
npm install -g .

Then use it directly:

bash
sharepoint-mcp-server

Architecture

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

Security Considerations

  • 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

Troubleshooting

Common Issues

  1. Authentication Errors: Verify Azure app registration and permissions
  2. Site Access: Ensure the app has appropriate SharePoint permissions
  3. Network Issues: Check firewall settings for Microsoft Graph API access

Debug Mode

Set environment variable for detailed logging:

bash
DEBUG=sharepoint-mcp-server

Contributing

  1. Follow TypeScript best practices
  2. Maintain comprehensive error handling
  3. Add tests for new functionality
  4. Update documentation for API changes

License

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

Contributing

We welcome contributions! Please follow these guidelines:

Getting Started

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (npm test)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Guidelines

  • 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

Code Style

  • 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

Testing

  • 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

Documentation

  • 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

Changelog

[0.1.0] - Initial Release

  • 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

Support

If you encounter issues or have questions:

  1. Check the troubleshooting section in this README
  2. Search existing GitHub issues
  3. Create a new issue with detailed information about your problem
  4. Include relevant logs and configuration (without sensitive information)

Acknowledgments

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

Dùng MCP SharePoint MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối SharePoint MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm SharePoint MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của SharePoint MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "sharepoint-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của SharePoint MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của SharePoint MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng SharePoint MCP Server giúp tôi làm việc này không?
SharePoint MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng SharePoint MCP Server.

Câu hỏi thường gặp

Máy chủ MCP SharePoint MCP Server dùng để làm gì?

SharePoint MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP SharePoint MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng SharePoint MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP SharePoint MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối SharePoint MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP SharePoint MCP Server với TypingMind?

SharePoint MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP SharePoint MCP Server cung cấp những công cụ nào trong TypingMind?

SharePoint MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP SharePoint MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu SharePoint MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇