SharePoint MCP Server

SharePoint MCP Server

Enables AI assistants to interact with Microsoft SharePoint via natural language, supporting document management, list operations, search, and site provisioning through the Microsoft Graph API.

Category
访问服务器

README

MseeP.ai Security Assessment Badge

License: MIT Python 3.10+ MCP Built with Claude Code

SharePoint MCP Server

DISCLAIMER: This project is not affiliated with, endorsed by, or related to Microsoft Corporation. SharePoint and Microsoft Graph API are trademarks of Microsoft Corporation. This is an independent, community-driven project.

SharePoint MCP Server is a Model Context Protocol (MCP) server that connects LLM applications such as Claude to your SharePoint site via the Microsoft Graph API. Use natural language to query documents, manage lists, upload files, and more — directly from your AI assistant.


Features

Category Capability
Site Get site information
Libraries Browse document libraries, list folder contents
Documents Read DOCX, PDF, XLSX, CSV, TXT; browse by path; get item metadata; upload files
Search Full-text search across all site content
Lists Create lists with AI-optimized schemas; create, update list items
Pages Create modern pages and news posts
Provisioning Create new SharePoint sites and advanced document libraries
Transport stdio (local), SSE, streamable-http (web / Docker)

Prerequisites

  • Python 3.10 or higher
  • A SharePoint site with Microsoft 365
  • An Azure AD application registration with the required Graph API permissions (see docs/auth_guide.md)

Quickstart

1. Clone and install

git clone https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
cd sharepoint-mcp

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

pip install -r requirements.txt

2. Configure

cp .env.example .env
# Edit .env with your Azure AD credentials and SharePoint site URL

Required variables in .env:

Variable Description
TENANT_ID Azure AD tenant ID
CLIENT_ID Azure AD application (client) ID
CLIENT_SECRET Azure AD client secret
SITE_URL SharePoint site URL (https://{tenant}.sharepoint.com/sites/{name})

3. Verify your setup (optional)

python config_checker.py   # Validate configuration
python auth-diagnostic.py  # Test authentication

4. Start the server

# stdio — default, for Claude Desktop / MCP Inspector
python server.py

# HTTP streamable-http — for web services and Copilot agents
python server.py --transport streamable-http --port 8000

# Docker
docker-compose up

Usage

Claude Desktop

Install the server into Claude Desktop:

mcp install server.py --name "SharePoint Assistant"

Or add it manually to claude_desktop_config.json:

{
  "mcpServers": {
    "sharepoint": {
      "command": "python",
      "args": ["/absolute/path/to/sharepoint-mcp/server.py"],
      "env": {
        "TENANT_ID": "...",
        "CLIENT_ID": "...",
        "CLIENT_SECRET": "...",
        "SITE_URL": "..."
      }
    }
  }
}

MCP Inspector (development)

mcp dev server.py

HTTP Server

# streamable-http (recommended for Copilot agents and web clients)
python server.py --transport streamable-http --host 0.0.0.0 --port 8000

# SSE
python server.py --transport sse --host 0.0.0.0 --port 8000

# Via environment variables
MCP_TRANSPORT=streamable-http MCP_PORT=8000 python server.py

Docker

# Build and start (defaults to streamable-http on port 8000)
docker-compose up

# Or run manually
docker build -t sharepoint-mcp .
docker run --env-file .env -p 8000:8000 sharepoint-mcp

Available Tools

The following MCP tools are exposed to the LLM:

Tool Description
get_site_info Get name, description, URL, and metadata of the SharePoint site
list_document_libraries List all document libraries (drives) in the site
list_folder_contents Browse files and folders within a document library by path
get_document_content Read and parse DOCX, PDF, XLSX, CSV, or TXT files
get_document_by_path Retrieve document content by file path
get_item_metadata Get metadata for a file or folder
search_sharepoint Full-text search across all content in the site
upload_document Upload a file to a document library
create_list_item Create a new item in a SharePoint list
update_list_item Update an existing item in a SharePoint list
create_intelligent_list Provision a list with an AI-optimized schema
create_advanced_document_library Create a document library with rich metadata
create_modern_page Publish a modern SharePoint page
create_news_post Publish a news article to the site
create_sharepoint_site Provision a new SharePoint team site

For detailed usage examples and example prompts, see docs/usage.md.


Monitoring and Troubleshooting

Logs

The server writes logs to stdout. Set DEBUG=True in .env to enable verbose logging.

Common Issues

Symptom Resolution
Authentication failure Run python auth-diagnostic.py to diagnose
Permission errors Verify your Azure AD app has the required Graph API permissions
Token issues Run python token-decoder.py to inspect token claims

Contributing

Contributions are welcome. Please open an issue first to discuss significant changes. See CONTRIBUTING.md for guidelines.

All contributions must pass the quality checks before merge:

black .       # Formatting
ruff check .  # Linting
pytest        # Tests

License

Released under the MIT License. See LICENSE for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选