npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memori.ai/mcp-sharepoint

v1.0.6

Published

MCP server that executes Sharepoint apis

Readme

mcp-sharepoint

A Model Context Protocol (MCP) server that exposes core Microsoft SharePoint / Microsoft Graph API functionalities as tools usable by LLM agents (e.g. Claude Desktop).

This server is designed with an agent-first approach:

  • no direct access to the local filesystem
  • deterministic inputs and outputs

✨ Features

The server allows an agent to:

📁 Folder management

A path can/must be passed as an argument

  • List folders
  • Create new folder
  • Delete folder (only if empty)
  • Retrieve the folder tree structure

📄 Document management

A path can/must be passed as an argument

  • List documents
  • Read document content (PDF, Word, Excel, PowerPoint)
  • Upload new document (text or binary)
  • Update an existing document (replace the full content)
  • Delete document

🔐 Prerequisites

  • Node.js ≥ 18
  • A Microsoft 365 tenant
  • An app registered in Microsoft Entra ID with Graph permissions

Recommended Graph permissions

Sites.Read.All
Sites.ReadWrite.All
Files.Read.All
Files.ReadWrite.All

⚠️ Use Application permissions


  • Authentication through Microsoft Entra ID App Registration
  • All operations are performed via Microsoft Graph

Sharepoint guide

  1. On Sharepoint, click on the left "app registration"
  2. Click on top "New registration"
  3. Insert a name and click "Register"
  4. Open the new registered app, by clicking on its name in "app registration"
  5. On top you can see the client id and tenant id
  6. Click on top-right "Client credentials: 0 certificates, 0 secrets"
  7. Click on "New client secret"
  8. Insert the desired description and expire time, and click "Add"
  9. In the table there will be the new client secret, copy the "Value" field.

⚠️You can copy it only once, after you will not be able to see the "Value" again

  1. The copied "Value" is the client secret
  2. Go to the following url: https://graph.microsoft.com/v1.0/sites/_yourdomain_.sharepoint.com:/sites/_yoursitename_ and copy the white/plain "id" value, this is the site id

⚠️You need to pass the access token as header param, Authorization: access_token

  1. Go to the following url: https://_yourdomain_.sharepoint.com/sites/_yoursite_/_api/v2.0/drives and copy the "id" value of the desired drive, this is the drive id
  2. Go to the following url: https://_yourdomain_.sharepoint.com/sites/_yoursite_/_api/v2.0/drives/_yourdriveid_/list and copy the "id" value of the desired list, this is the list id

⚙️ Configuration

The authorization is obtained using app variables. The agent needs to send these variables in every call.

Required app variables

| Variable | Description | | ------------- | ---------------------------------------- | | tenantId | Microsoft Entra directory tenant ID | | clientId | Microsoft Entra app client ID | | clientSecret| Microsoft Entra client secret |

Other common variables needed. These depends on the Sharepoint you are using.

| Variable | Description | | ------------- | ---------------------------------------- | | siteId | Sharepoint full site ID | | driveId | Sharepoint drive ID | | listId | Sharepoint list ID |


🧰 Available MCP tools

common parameters

// Microsoft Entra ID app authentication parameters

authParams: {
  {
    "name": "clientId",
    "type": "string",
    "required": "true",
    "descrciption": "The application (client) ID",
    "example": "ab12cd34-e5f6-g7h8-i9j9-ab12cd34e5f6"
  },
  {
    "name": "clientSecret",
    "type": "string",
    "required": "true",
    "descrciption": "The client secret",
    "example": "1~A1B~aB12Cd34E5f6aB12cd34E5f6ab~d37cD37"
  },
  {
    "name": "tenantId",
    "type": "string",
    "required": "true",
    "descrciption": "The directory (tenant) ID",
    "example": "ab12cd34-e5f6-g7h8-i9j9-ab12cd34e5f6"
  }
}
// SharePoint site and drive identifiers

siteDriveParams: {
  {
    "name": "siteId",
    "type": "string",
    "required": "true",
    "descrciption": "The ID of the SharePoint site",
    "example": "namexyz.sharepoint.com,ab12cd34-e5f6-g7h8-i9j9-ab12cd34e5f6,fb12cd34-e5f6-g7h8-i9j9-ab12cd34e5f9"
  },
  {
    "name": "driveId",
    "type": "string",
    "required": "true",
    "descrciption":" The ID of the drive within the SharePoint site",
    "example": "f!aB12Cd34E5f6aB12cd34E5f6abd37cD37aB12Cd34E5f6aB12cd34E5f6abd3712"
  }
}

📁 Folders

getFolders

List folders in a given path.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "path",
  "type": "string",
  "required": "true",
  "descrciption": "The path in SharePoint to retrieve folders from",
  "example": "cartella_1/cartella_2"
}

createFolder

Create a new folder.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "path",
  "type": "string",
  "required": "true",
  "descrciption": "The parent path where the folder will be created",
  "example": "cartella_1/cartella_2"
},
{
  "name": "folderName",
  "type": "string",
  "required": "true",
  "descrciption": "The name of the new folder to create",
  "example": "cartella_3"
}

deleteFolder

Delete a folder only if it is empty.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "path",
  "type": "string",
  "required": "true",
  "descrciption": "The path to the folder to delete",
  "example": "cartella_1/cartella_2/cartella_3"
}

getFolderTree

Retrieve the folder tree structure.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "path",
  "type": "string",
  "required": "false",
  "descrciption": "The starting path (default: 'root')",
  "example": "cartella_1/cartella_2"
},
{
  "name": "maxDepth",
  "type": "number",
  "required": "false",
  "descrciption": "Maximum depth to traverse (default: 10)",
  "example": 5
}

📄 Documents

getDocuments

List documents in a folder.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "path",
  "type": "string",
  "required": "true",
  "descrciption": "The path in SharePoint to retrieve documents from",
  "example": "cartella_1/cartella_2"
}

getDocumentContent

Retrieve and extract the textual content of a document.

Supported formats:

  • Native PDFs
  • Word / Excel / PowerPoint (converted to PDF via Graph)

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "filePath",
  "type": "string",
  "required": "true",
  "descrciption": "The path to the file",
  "example": "cartella_1/cartella_2/file.txt"
}

uploadDocument

Upload a new document.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "filePath",
  "type": "string",
  "required": "true",
  "descrciption": "The path where the file will be uploaded",
  "example": "cartella_1/cartella_2"
},
{
  "name": "content",
  "type": "string",
  "required": "true",
  "descrciption": "The string or base64-encoded content of the file to upload",
  "example": "Questo è il testo del doc .txt"
},
{
  "name": "contentType",
  "type": "string",
  "required": "false",
  "descrciption": "The MIME type of the content (default: 'application/octet-stream')",
  "example": "application/octet-stream"
},
{
  "name": "overwrite",
  "type": "boolean",
  "required": "false",
  "descrciption": "Whether to overwrite existing files (default: false)",
  "example": true
}

updateDocumentContent

Fully update an existing document.

⚠️ The operation replace the full content of the file.
⚠️ The operation fails if the file does not exist.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "filePath",
  "type": "string",
  "required": "true",
  "descrciption": "The path to the existing file to update",
  "example": "cartella_1/cartella_2"
},
{
  "name": "content",
  "type": "string",
  "required": "true",
  "descrciption": "The new string or base64-encoded content of the file",
  "example": "Questo è il nuovo testo del doc .txt"
},
{
  "name": "contentType",
  "type": "string",
  "required": "false",
  "descrciption": "The MIME type of the content (default: 'application/octet-stream')",
  "example": "application/pdf"
}

deleteDocument

Delete a document (moved to the SharePoint recycle bin).

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "filePath",
  "type": "string",
  "required": "true",
  "descrciption": "The path to the file to delete",
  "example": "cartella_1/cartella_2/file.docx"
},

searchDocumentsByKeywords

Search for documents containing at least one of the keywords in the given attribute.

Input:

{
  "name": "auth",
  "type": "authParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "siteDrive",
  "type": "siteDriveParams",
  "required": "true",
  "descrciption": "refer to the `common parameters` section",
  "example": "refer to the `common parameters` section"
},
{
  "name": "listId",
  "type": "string",
  "required": "true",
  "descrciption": "The ID of the SharePoint list to search in",
  "example": "ab12cd34-e5f6-g7h8-i9j9-ab12cd34e5f6"
},
{
  "name": "keywords",
  "type": "Array<string>",
  "required": "true",
  "descrciption": "Array of keywords to search for",
  "example": "["word_1", "word_2", "word_3"]"
},
{
  "name": "attributeName",
  "type": "string",
  "required": "true",
  "descrciption": The document attribute to search in",
  "example": "name"
},

🚀 Try it on Aisuru!

This MCP server is easily integrated into aisuru, our AI agent platform where you can create, test, and deploy intelligent agents with access to powerful tools like this mcp-sharepoint server.

Failed to load image

Visit Aisuru.com to start building with your agents today!


⚠️ Known limitations

  • Partial document updates are not supported
  • Large files (>4MB) require upload sessions (not yet implemented)
  • Text extraction from complex PDFs/Excel files may lose structure

🔒 Security

  • Never expose client secret publicly
  • Rotate secrets regularly
  • Grant the minimum required Graph permissions