Skip to main content
Glama

sharepoint-mcp

MCP server pre SharePoint Online — správa listov, knižníc, stĺpcov, pohľadov, položiek a súborov priamo z AI agenta.


Štruktúra projektu

sharepoint-mcp/
├── .env.example          # Šablóna konfigurácie (skopíruj do .env)
├── package.json
├── tsconfig.json
└── src/
    ├── index.ts          # MCP server + registrácia všetkých nástrojov
    ├── auth.ts           # MSAL browser login + file token cache
    ├── sharepoint.ts     # SharePoint REST klient (GET / POST / PATCH / DELETE / upload)
    ├── types.ts          # Zdieľané TypeScript typy (ColumnSpec, ViewSpec)
    ├── column-types.ts   # Mapovanie typov stĺpcov + buildFieldBody
    └── tools/
        ├── lists.ts      # Nástroje pre listy a knižnice
        ├── columns.ts    # Nástroje pre stĺpce
        ├── items.ts      # Nástroje pre položky
        ├── views.ts      # Nástroje pre pohľady
        └── files.ts      # Nástroje pre súbory

Related MCP server: SharePoint MCP Server

Dostupné nástroje (22)

Nástroj

Popis

set_site

Nastaví SharePoint site URL pre aktuálnu reláciu

list_lists

Zoznam všetkých listov a knižníc na site

get_list_schema

Stĺpce, pohľady a metadáta listu / knižnice

get_list_schema_xml

Export kompletného SchemaXml (backup, klonovanie)

create_list

Vytvorí list alebo knižnicu so stĺpcami a pohľadmi

create_list_from_xml

Vytvorí list zo SchemaXml reťazca

delete_list

Vymaže list alebo knižnicu

get_items

Načíta položky (OData filter, select, orderby, paging)

create_item

Vytvorí novú položku

update_item

Aktualizuje položku podľa ID

delete_item

Vymaže položku podľa ID

add_column

Pridá stĺpec do existujúceho listu

update_column

Zmení nastavenia stĺpca (názov, required, default, choices…)

delete_column

Vymaže stĺpec

get_views

Zoznam pohľadov listu

create_view

Vytvorí nový pohľad so stĺpcami a filtrom

update_view

Aktualizuje pohľad (stĺpce, filter, row limit)

list_files

Zoznam súborov a priečinkov v knižnici

upload_file

Nahrá súbor (base64 obsah)

download_file

Stiahne súbor (vráti base64 obsah)

delete_file

Vymaže súbor


Autentifikácia

Nevyžaduje app registration ani admin súhlas. Používa PnP Management Shell — well-known public client (31359c7f-bd7e-475c-86db-fdb8c937548e).

  • Pri prvom spustení sa otvorí prehliadač → prihlásenie pod vlastným účtom → jednorazový consent

  • Token je uložený v ~/.sharepoint-mcp/token-cache.json — ďalšie spustenia nevyžadujú login

  • Jeden token pokrýva všetky site collections na tom istom tenante

  • Prepínanie medzi site collections: zavolaj set_site s novou URL


Inštalácia a spustenie

# 1. Nainštaluj závislosti
npm install

# 2. Vytvor .env zo šablóny
cp .env.example .env
# Uprav SITE_URL v .env

# 3. Spusti vývojový server (voliteľné — Claude Code štartuje server sám)
npm run dev

.env

SITE_URL=https://contoso.sharepoint.com/sites/mysite

Konfigurácia MCP v Claude Desktop

Pridaj do claude_desktop_config.json (zvyčajne %APPDATA%\Claude\claude_desktop_config.json alebo na Windows %LOCALAPPDATA%\Packages\Claude_...\LocalCache\Roaming\Claude\claude_desktop_config.json):

Možnosť 1 — skompilovaný build (odporúčané)

Najprv sprav build projektu:

npm run build

Potom pridaj do konfigurácie (uprav cestu podľa svojho umiestnenia projektu):

{
  "mcpServers": {
    "sharepoint": {
      "command": "node",
      "args": ["C:/Users/Lukas/Documents/AI Projects/sharepoint-mcp/dist/index.js"]
    }
  }
}

Po každej zmene kódu treba znovu spustiť npm run build.

Možnosť 2 — priamo TypeScript cez tsx (len pre vývoj)

{
  "mcpServers": {
    "sharepoint": {
      "command": "npx",
      "args": ["tsx", "C:/Users/Lukas/Documents/AI Projects/sharepoint-mcp/src/index.ts"]
    }
  }
}

Pozor: cwd v konfigurácii Claude Desktop nefunguje spoľahlivo — vždy používaj absolútnu cestu v args.

Po uložení reštartuj Claude Desktop — server sa spustí automaticky pri prvom volaní nástroja.

Tip: Ak pracuješ na viacerých site collections, stačí na začiatku konverzácie zavolať set_site s príslušnou URL. Token sa znovu použije, prehliadač sa neotvorí.


Typy stĺpcov

Typ

Popis

Voliteľné parametre

text

Jednoriadkový text

—

note

Viacriadkový text

richText

number

Číslo

min, max, decimals

currency

Mena

decimals

date

Dátum a čas

dateOnly

boolean

Áno / Nie

defaultValue

choice

Výber jednej hodnoty

choices[]

multichoice

Výber viacerých hodnôt

choices[]

person

People picker

multiple

url

Odkaz

—

calculated

Vypočítaný stĺpec

formula, outputType

Available Tools

21 tools
add_columnB

Add a new column to an existing list or library. The column is automatically added to the default view unless addToDefaultView is false.

Inputs: listName (required), column (required), addToDefaultView.

create_itemB

Create a new item in a list. Pass field values as key-value pairs using internal column names. For person fields use the format {FieldNameId: userId}. For date fields use ISO 8601 strings.

Inputs: listName (required), fields (required).

create_listA

Create a new SharePoint list or document library with optional columns and views. Columns are described using structured specs (type, choices, required, indexed, etc.). New columns are automatically added to the default view.

Inputs: name (required), type, description, columns, +1 more.

create_list_from_xmlA

Create a list from a full SharePoint SchemaXml string (e.g. obtained from get_list_schema_xml). Useful for cloning or restoring a list.

Inputs: name (required), schemaXml (required), description.

create_viewC

Create a new view for a list or library with specified columns, row limit, and optional CAML filter.

Inputs: listName (required), name (required), columns (required), isDefault, +2 more.

delete_columnA

Delete a column from a list (by internal name). Cannot delete read-only or sealed columns.

Inputs: listName (required), internalName (required).

delete_fileB

Permanently delete a file from a document library.

Inputs: serverRelativeUrl (required).

delete_itemC

Delete a list item by its numeric ID.

Inputs: listName (required), id (required).

delete_listC

Permanently delete a list or document library.

Inputs: listName (required).

download_fileC

Download a file from SharePoint. Returns base64-encoded content.

Inputs: serverRelativeUrl (required).

get_itemsC

Query items in a list. Supports OData $filter, $select, $orderby, $top, $skip, $expand.

Inputs: listName (required), filter, select, orderBy, +3 more.

get_list_schemaA

Get the full schema of a list or library: all columns (type, required, default, indexed), all views, and list metadata. Works on both lists (baseTemplate 100) and document libraries (101).

Inputs: listName (required).

get_list_schema_xmlA

Export the full SharePoint SchemaXml of a list or library. The XML contains every field, view, content type, and JSON formatting definition. Useful for backup or cloning.

Inputs: listName (required).

get_viewsC

List all views of a list or library with their columns, filters, and row limits.

Inputs: listName (required).

list_filesC

List files and sub-folders inside a document library or a specific folder within it.

Inputs: libraryName (required), folderPath.

list_listsA

List all lists and document libraries in the SharePoint site. Returns name, id, type (list / documentLibrary), item count, etc.

Inputs: includeHidden.

set_siteA

Set the SharePoint site URL to work with. Must be called before any other tool if SITE_URL is not set in .env.

Inputs: siteUrl (required).

update_columnC

Update settings of an existing column (display name, description, required, default value, indexed, choices).

Inputs: listName (required), internalName (required), updates (required).

update_itemC

Update fields of an existing list item by its numeric ID.

Inputs: listName (required), id (required), fields (required).

update_viewC

Update an existing view: change columns, CAML query, row limit, or make it the default.

Inputs: listName (required), viewName (required), columns, query, +2 more.

upload_fileC

Upload a file to a document library. Content must be base64-encoded.

Inputs: libraryName (required), fileName (required), content (required), folderPath, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 21 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific SharePoint operations like list management, item handling, file operations, or schema manipulation. There is no significant overlap; for example, create_list and create_list_from_xml serve different creation methods, and get_list_schema vs. get_list_schema_xml provide different output formats.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as create_item, delete_file, and update_view. This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming conventions.

    Tool Count4/5

    With 21 tools, the count is slightly high but reasonable for a comprehensive SharePoint server covering lists, items, files, columns, and views. It includes all essential CRUD operations and advanced features like schema handling, which justifies the breadth without feeling excessively bloated.

    Completeness5/5

    The tool set provides complete coverage for SharePoint operations, including full CRUD for lists, items, files, columns, and views, along with utilities for schema management, querying, and site configuration. There are no obvious gaps; agents can perform all typical workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers