SharePoint Lists MCP server

Enables AI to interact with SharePoint lists through the CLI for Microsoft 365, allowing natural language management of content without requiring SharePoint structure knowledge.
Back to servers
Setup instructions
Provider
MS 365 PnP
Release date
Apr 18, 2025
Language
TypeScript
Stats
24 stars

The CLI for Microsoft 365 MCP Server allows you to manage Microsoft 365 through natural language commands. This server acts as a bridge between your natural language prompts and CLI for Microsoft 365 commands, enabling you to perform complex Microsoft 365 management tasks across services like SharePoint, Teams, Power Platform, and more without memorizing command syntax.

Prerequisites

Before installing the MCP server, ensure you have:

  • Node.js 20.x or higher
  • CLI for Microsoft 365 installed globally

Installation

Step 1: Install CLI for Microsoft 365

Install the CLI for Microsoft 365 globally using npm:

npm i -g @pnp/cli-microsoft365

Step 2: Set up CLI for Microsoft 365

Perform the initial setup by running:

m365 setup

For authentication details, see the Microsoft 365 login guide at CLI for Microsoft 365 documentation.

Step 3: Configure CLI for Microsoft 365

Update the CLI configuration with these commands:

m365 cli config set --key prompt --value false
m365 cli config set --key output --value text
m365 cli config set --key helpMode --value full

These settings ensure the MCP server receives maximum information from CLI for Microsoft 365 when processing commands.

Step 4: Authenticate with Microsoft 365

Authenticate using the CLI for Microsoft 365:

m365 login

The MCP server will use this authentication context for all operations.

Step 5: Install the MCP Server in VS Code

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS)
  2. Type MCP: Add Server and select it
  3. Choose Command (stdio) as the server type
  4. Enter the following command:
    npx -y @pnp/cli-microsoft365-mcp-server@latest
    
  5. Name the server (e.g., CLI for Microsoft 365 MCP Server)

This will create an .vscode/mcp.json file with configuration similar to:

{
    "servers": {
        "CLI for Microsoft 365 MCP Server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@pnp/cli-microsoft365-mcp-server@latest"
            ]
        }
    }
}

Usage Examples

For optimal results, use this MCP server with Claude Sonnet 4 or Claude Sonnet 3.7. Here are some example scenarios showing how to use natural language prompts to manage Microsoft 365:

Managing SharePoint Online

You can create and configure SharePoint lists with a simple prompt:

Add a new list to this site with title "awesome ducks". Then add new columns to that list including them in the default view. The first should be a text description column and the second one should be a user column. Then add 3 items to this list with some funny jokes about ducks added in the description column and adding my user in the user column. Use emojis 🙂

Managing Microsoft Teams

Create and configure Teams with natural language:

Create a new Team on Teams with name "Awesome Ducks" and in the General channel add a welcome post

Managing Power Platform Solutions

Control Power Automate flows:

Can you check if I have HoursReportingReminder flow and if so disable it

Managing Planner

Set up project management resources:

Can you create a new plan in planner to manage work for the awesome ducks. I need some sample buckets and tasks to get started

Available Tools

The MCP server provides three main tools:

  • m365GetCommands: Retrieves all CLI for Microsoft 365 commands for the MCP to select the appropriate command
  • m365GetCommandDocs: Gets detailed documentation for specific CLI commands
  • m365RunCommand: Executes specified CLI commands and returns results

These tools work together to interpret your natural language requests and convert them into the appropriate CLI for Microsoft 365 commands.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "cli-microsoft365-mcp-server" '{"command":"node","args":["dist/index.js"],"env":{"CertificateBase64Encoded":"","CertificatePassword":"","AppId":"","TenantId":"","TenantUrl":""}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cli-microsoft365-mcp-server": {
            "command": "node",
            "args": [
                "dist/index.js"
            ],
            "env": {
                "CertificateBase64Encoded": "",
                "CertificatePassword": "",
                "AppId": "",
                "TenantId": "",
                "TenantUrl": ""
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "cli-microsoft365-mcp-server": {
            "command": "node",
            "args": [
                "dist/index.js"
            ],
            "env": {
                "CertificateBase64Encoded": "",
                "CertificatePassword": "",
                "AppId": "",
                "TenantId": "",
                "TenantUrl": ""
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later