@softeria/ms-365-mcp-server 0.134.5 → 0.135.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -149,6 +149,21 @@ CLI value takes precedence over `MS365_MCP_ALLOWED_SCOPES`; if neither is set, t
149
149
 
150
150
  Scope coverage is hierarchy-aware: for example, `Mail.ReadWrite` covers tools that require `Mail.Read`, and `Files.ReadWrite.All` covers tools that require `Files.Read`.
151
151
 
152
+ SharePoint supports two enterprise permission models:
153
+
154
+ - Broad tenant scopes such as `Sites.Read.All`, `Sites.ReadWrite.All`, and `Sites.Manage.All`.
155
+ - Microsoft Graph `Sites.Selected`, where SharePoint site access is granted to the app on specific site collections and Graph evaluates the signed-in user's own permissions at request time.
156
+
157
+ The default org-mode behavior continues to request the broad SharePoint scopes used by existing deployments. Enterprises that want selected-site SharePoint access can set an allowlist containing `Sites.Selected` instead of broad `Sites.*.All` scopes. Direct site/list/item tools that target an explicit SharePoint site can run with `Sites.Selected`; tenant-wide SharePoint discovery and search tools still require broad SharePoint scopes.
158
+
159
+ ```bash
160
+ npx @softeria/ms-365-mcp-server \
161
+ --org-mode \
162
+ --read-only \
163
+ --enabled-tools 'sharepoint|site|drive|planner' \
164
+ --allowed-scopes 'User.Read Files.Read Notes.Read Tasks.Read Sites.Selected'
165
+ ```
166
+
152
167
  In HTTP mode, OAuth discovery advertises the effective filtered permissions so clients request the same consent surface. On-Behalf-Of mode (`--obo`) still advertises `api://<clientId>/access_as_user` for protected-resource metadata; `--allowed-scopes` does not override OBO.
153
168
 
154
169
  ### Requesting extra scopes
@@ -1811,56 +1811,56 @@
1811
1811
  "method": "get",
1812
1812
  "toolName": "get-sharepoint-site",
1813
1813
  "presets": ["work"],
1814
- "workScopes": ["Sites.Read.All"]
1814
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1815
1815
  },
1816
1816
  {
1817
1817
  "pathPattern": "/sites/{site-id}/drives",
1818
1818
  "method": "get",
1819
1819
  "toolName": "list-sharepoint-site-drives",
1820
1820
  "presets": ["work"],
1821
- "workScopes": ["Sites.Read.All"]
1821
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1822
1822
  },
1823
1823
  {
1824
1824
  "pathPattern": "/sites/{site-id}/drives/{drive-id}",
1825
1825
  "method": "get",
1826
1826
  "toolName": "get-sharepoint-site-drive-by-id",
1827
1827
  "presets": ["work"],
1828
- "workScopes": ["Sites.Read.All"]
1828
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1829
1829
  },
1830
1830
  {
1831
1831
  "pathPattern": "/sites/{site-id}/items",
1832
1832
  "method": "get",
1833
1833
  "toolName": "list-sharepoint-site-items",
1834
1834
  "presets": ["work"],
1835
- "workScopes": ["Sites.Read.All"]
1835
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1836
1836
  },
1837
1837
  {
1838
1838
  "pathPattern": "/sites/{site-id}/items/{baseItem-id}",
1839
1839
  "method": "get",
1840
1840
  "toolName": "get-sharepoint-site-item",
1841
1841
  "presets": ["work"],
1842
- "workScopes": ["Sites.Read.All"]
1842
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1843
1843
  },
1844
1844
  {
1845
1845
  "pathPattern": "/sites/{site-id}/lists",
1846
1846
  "method": "get",
1847
1847
  "toolName": "list-sharepoint-site-lists",
1848
1848
  "presets": ["work"],
1849
- "workScopes": ["Sites.Read.All"]
1849
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1850
1850
  },
1851
1851
  {
1852
1852
  "pathPattern": "/sites/{site-id}/lists/{list-id}",
1853
1853
  "method": "get",
1854
1854
  "toolName": "get-sharepoint-site-list",
1855
1855
  "presets": ["work"],
1856
- "workScopes": ["Sites.Read.All"]
1856
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1857
1857
  },
1858
1858
  {
1859
1859
  "pathPattern": "/sites/{site-id}/lists/{list-id}/items",
1860
1860
  "method": "get",
1861
1861
  "toolName": "list-sharepoint-site-list-items",
1862
1862
  "presets": ["work"],
1863
- "workScopes": ["Sites.Read.All"],
1863
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1864
1864
  "llmTip": "Add $expand=fields to include actual column values. Without it, only metadata is returned."
1865
1865
  },
1866
1866
  {
@@ -1868,7 +1868,7 @@
1868
1868
  "method": "get",
1869
1869
  "toolName": "get-sharepoint-site-list-item",
1870
1870
  "presets": ["work"],
1871
- "workScopes": ["Sites.Read.All"],
1871
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1872
1872
  "llmTip": "Add $expand=fields to include actual column values. Without it, only metadata is returned."
1873
1873
  },
1874
1874
  {
@@ -1876,7 +1876,7 @@
1876
1876
  "method": "post",
1877
1877
  "toolName": "create-sharepoint-list-item",
1878
1878
  "presets": ["work"],
1879
- "workScopes": ["Sites.ReadWrite.All"],
1879
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1880
1880
  "llmTip": "Creates a new item in a SharePoint list. Body: { fields: { Title: 'Item name', ColumnName: 'value', ... } }. Use list-sharepoint-site-lists to find the list ID and get-sharepoint-site-list to discover available columns."
1881
1881
  },
1882
1882
  {
@@ -1884,7 +1884,7 @@
1884
1884
  "method": "patch",
1885
1885
  "toolName": "update-sharepoint-list-item",
1886
1886
  "presets": ["work"],
1887
- "workScopes": ["Sites.ReadWrite.All"],
1887
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1888
1888
  "llmTip": "Updates fields on an existing list item. Body: { fields: { ColumnName: 'new value' } }. Send only the fields you want to change. Use $expand=fields on get-sharepoint-site-list-item to see current values first."
1889
1889
  },
1890
1890
  {
@@ -1892,7 +1892,7 @@
1892
1892
  "method": "delete",
1893
1893
  "toolName": "delete-sharepoint-list-item",
1894
1894
  "presets": ["work"],
1895
- "workScopes": ["Sites.ReadWrite.All"],
1895
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1896
1896
  "llmTip": "Deletes a list item permanently. This cannot be undone — the item is moved to the site recycle bin."
1897
1897
  },
1898
1898
  {
@@ -1900,7 +1900,7 @@
1900
1900
  "method": "post",
1901
1901
  "toolName": "create-sharepoint-list",
1902
1902
  "presets": ["work"],
1903
- "workScopes": ["Sites.Manage.All"],
1903
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1904
1904
  "llmTip": "Creates a new SharePoint list in a site. Body: { displayName: 'My List', description: 'Optional', list: { template: 'genericList' }, columns: [ { name: 'Status', text: {} }, { name: 'Due', dateTime: {} } ] }. Templates include genericList, documentLibrary, tasks, calendar, contacts, links, announcements, survey. Columns can be defined inline at creation; otherwise add them later via create-sharepoint-list-column. Use search-sharepoint-sites or get-sharepoint-site-by-path to find the site ID first."
1905
1905
  },
1906
1906
  {
@@ -1908,7 +1908,7 @@
1908
1908
  "method": "get",
1909
1909
  "toolName": "list-sharepoint-list-columns",
1910
1910
  "presets": ["work"],
1911
- "workScopes": ["Sites.Read.All"],
1911
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1912
1912
  "llmTip": "Lists column definitions for a SharePoint list. Returns each column's id, name, displayName, description, type indicator (text, number, choice, dateTime, person, lookup, boolean, calculated, hyperlinkOrPicture, etc.), required, indexed, hidden, readOnly. Use this to discover the schema before creating or updating list items."
1913
1913
  },
1914
1914
  {
@@ -1916,7 +1916,7 @@
1916
1916
  "method": "post",
1917
1917
  "toolName": "create-sharepoint-list-column",
1918
1918
  "presets": ["work"],
1919
- "workScopes": ["Sites.Manage.All"],
1919
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1920
1920
  "llmTip": "Creates a new column on a SharePoint list. Body must include name and exactly one column type property: { name: 'Priority', text: {} } or { name: 'DueDate', dateTime: { format: 'dateOnly' } } or { name: 'Status', choice: { choices: ['Open','In Progress','Done'] } }. Other types: number, boolean, currency, hyperlinkOrPicture, personOrGroup, lookup, calculated. Optional: displayName, description, required, indexed, enforceUniqueValues."
1921
1921
  },
1922
1922
  {
@@ -1924,7 +1924,7 @@
1924
1924
  "method": "get",
1925
1925
  "toolName": "get-sharepoint-list-column",
1926
1926
  "presets": ["work"],
1927
- "workScopes": ["Sites.Read.All"],
1927
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1928
1928
  "llmTip": "Gets a specific column definition by ID, including its full type configuration (choices for choice columns, format for dateTime, etc.). Use list-sharepoint-list-columns first to find the column ID."
1929
1929
  },
1930
1930
  {
@@ -1932,7 +1932,7 @@
1932
1932
  "method": "patch",
1933
1933
  "toolName": "update-sharepoint-list-column",
1934
1934
  "presets": ["work"],
1935
- "workScopes": ["Sites.Manage.All"],
1935
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1936
1936
  "llmTip": "Updates a column definition. Body: { displayName: 'New name', description: 'New description', required: true, ... }. The column type itself (text, choice, etc.) cannot be changed — only its metadata and per-type options (e.g. choices array for a choice column). Send only the fields you want to change."
1937
1937
  },
1938
1938
  {
@@ -1940,7 +1940,7 @@
1940
1940
  "method": "delete",
1941
1941
  "toolName": "delete-sharepoint-list-column",
1942
1942
  "presets": ["work"],
1943
- "workScopes": ["Sites.Manage.All"],
1943
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1944
1944
  "llmTip": "Deletes a column from a SharePoint list. This is irreversible — all data stored in this column across every list item is lost. Confirm with the user before calling. Cannot delete built-in columns (Title, Created, Modified, etc.)."
1945
1945
  },
1946
1946
  {
@@ -1948,7 +1948,7 @@
1948
1948
  "method": "get",
1949
1949
  "toolName": "get-sharepoint-site-by-path",
1950
1950
  "presets": ["work"],
1951
- "workScopes": ["Sites.Read.All"],
1951
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1952
1952
  "skipEncoding": ["path"],
1953
1953
  "llmTip": "Resolve a SharePoint site from its server-relative URL. site-id is the hostname (contoso.sharepoint.com) and path is the site path without a leading slash (sites/marketing, teams/hr). Returns the site object whose id feeds list-sharepoint-site-drives."
1954
1954
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.134.5",
3
+ "version": "0.135.0",
4
4
  "description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1811,56 +1811,56 @@
1811
1811
  "method": "get",
1812
1812
  "toolName": "get-sharepoint-site",
1813
1813
  "presets": ["work"],
1814
- "workScopes": ["Sites.Read.All"]
1814
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1815
1815
  },
1816
1816
  {
1817
1817
  "pathPattern": "/sites/{site-id}/drives",
1818
1818
  "method": "get",
1819
1819
  "toolName": "list-sharepoint-site-drives",
1820
1820
  "presets": ["work"],
1821
- "workScopes": ["Sites.Read.All"]
1821
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1822
1822
  },
1823
1823
  {
1824
1824
  "pathPattern": "/sites/{site-id}/drives/{drive-id}",
1825
1825
  "method": "get",
1826
1826
  "toolName": "get-sharepoint-site-drive-by-id",
1827
1827
  "presets": ["work"],
1828
- "workScopes": ["Sites.Read.All"]
1828
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1829
1829
  },
1830
1830
  {
1831
1831
  "pathPattern": "/sites/{site-id}/items",
1832
1832
  "method": "get",
1833
1833
  "toolName": "list-sharepoint-site-items",
1834
1834
  "presets": ["work"],
1835
- "workScopes": ["Sites.Read.All"]
1835
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1836
1836
  },
1837
1837
  {
1838
1838
  "pathPattern": "/sites/{site-id}/items/{baseItem-id}",
1839
1839
  "method": "get",
1840
1840
  "toolName": "get-sharepoint-site-item",
1841
1841
  "presets": ["work"],
1842
- "workScopes": ["Sites.Read.All"]
1842
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1843
1843
  },
1844
1844
  {
1845
1845
  "pathPattern": "/sites/{site-id}/lists",
1846
1846
  "method": "get",
1847
1847
  "toolName": "list-sharepoint-site-lists",
1848
1848
  "presets": ["work"],
1849
- "workScopes": ["Sites.Read.All"]
1849
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1850
1850
  },
1851
1851
  {
1852
1852
  "pathPattern": "/sites/{site-id}/lists/{list-id}",
1853
1853
  "method": "get",
1854
1854
  "toolName": "get-sharepoint-site-list",
1855
1855
  "presets": ["work"],
1856
- "workScopes": ["Sites.Read.All"]
1856
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
1857
1857
  },
1858
1858
  {
1859
1859
  "pathPattern": "/sites/{site-id}/lists/{list-id}/items",
1860
1860
  "method": "get",
1861
1861
  "toolName": "list-sharepoint-site-list-items",
1862
1862
  "presets": ["work"],
1863
- "workScopes": ["Sites.Read.All"],
1863
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1864
1864
  "llmTip": "Add $expand=fields to include actual column values. Without it, only metadata is returned."
1865
1865
  },
1866
1866
  {
@@ -1868,7 +1868,7 @@
1868
1868
  "method": "get",
1869
1869
  "toolName": "get-sharepoint-site-list-item",
1870
1870
  "presets": ["work"],
1871
- "workScopes": ["Sites.Read.All"],
1871
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1872
1872
  "llmTip": "Add $expand=fields to include actual column values. Without it, only metadata is returned."
1873
1873
  },
1874
1874
  {
@@ -1876,7 +1876,7 @@
1876
1876
  "method": "post",
1877
1877
  "toolName": "create-sharepoint-list-item",
1878
1878
  "presets": ["work"],
1879
- "workScopes": ["Sites.ReadWrite.All"],
1879
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1880
1880
  "llmTip": "Creates a new item in a SharePoint list. Body: { fields: { Title: 'Item name', ColumnName: 'value', ... } }. Use list-sharepoint-site-lists to find the list ID and get-sharepoint-site-list to discover available columns."
1881
1881
  },
1882
1882
  {
@@ -1884,7 +1884,7 @@
1884
1884
  "method": "patch",
1885
1885
  "toolName": "update-sharepoint-list-item",
1886
1886
  "presets": ["work"],
1887
- "workScopes": ["Sites.ReadWrite.All"],
1887
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1888
1888
  "llmTip": "Updates fields on an existing list item. Body: { fields: { ColumnName: 'new value' } }. Send only the fields you want to change. Use $expand=fields on get-sharepoint-site-list-item to see current values first."
1889
1889
  },
1890
1890
  {
@@ -1892,7 +1892,7 @@
1892
1892
  "method": "delete",
1893
1893
  "toolName": "delete-sharepoint-list-item",
1894
1894
  "presets": ["work"],
1895
- "workScopes": ["Sites.ReadWrite.All"],
1895
+ "workScopes": [["Sites.ReadWrite.All"], ["Sites.Selected"]],
1896
1896
  "llmTip": "Deletes a list item permanently. This cannot be undone — the item is moved to the site recycle bin."
1897
1897
  },
1898
1898
  {
@@ -1900,7 +1900,7 @@
1900
1900
  "method": "post",
1901
1901
  "toolName": "create-sharepoint-list",
1902
1902
  "presets": ["work"],
1903
- "workScopes": ["Sites.Manage.All"],
1903
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1904
1904
  "llmTip": "Creates a new SharePoint list in a site. Body: { displayName: 'My List', description: 'Optional', list: { template: 'genericList' }, columns: [ { name: 'Status', text: {} }, { name: 'Due', dateTime: {} } ] }. Templates include genericList, documentLibrary, tasks, calendar, contacts, links, announcements, survey. Columns can be defined inline at creation; otherwise add them later via create-sharepoint-list-column. Use search-sharepoint-sites or get-sharepoint-site-by-path to find the site ID first."
1905
1905
  },
1906
1906
  {
@@ -1908,7 +1908,7 @@
1908
1908
  "method": "get",
1909
1909
  "toolName": "list-sharepoint-list-columns",
1910
1910
  "presets": ["work"],
1911
- "workScopes": ["Sites.Read.All"],
1911
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1912
1912
  "llmTip": "Lists column definitions for a SharePoint list. Returns each column's id, name, displayName, description, type indicator (text, number, choice, dateTime, person, lookup, boolean, calculated, hyperlinkOrPicture, etc.), required, indexed, hidden, readOnly. Use this to discover the schema before creating or updating list items."
1913
1913
  },
1914
1914
  {
@@ -1916,7 +1916,7 @@
1916
1916
  "method": "post",
1917
1917
  "toolName": "create-sharepoint-list-column",
1918
1918
  "presets": ["work"],
1919
- "workScopes": ["Sites.Manage.All"],
1919
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1920
1920
  "llmTip": "Creates a new column on a SharePoint list. Body must include name and exactly one column type property: { name: 'Priority', text: {} } or { name: 'DueDate', dateTime: { format: 'dateOnly' } } or { name: 'Status', choice: { choices: ['Open','In Progress','Done'] } }. Other types: number, boolean, currency, hyperlinkOrPicture, personOrGroup, lookup, calculated. Optional: displayName, description, required, indexed, enforceUniqueValues."
1921
1921
  },
1922
1922
  {
@@ -1924,7 +1924,7 @@
1924
1924
  "method": "get",
1925
1925
  "toolName": "get-sharepoint-list-column",
1926
1926
  "presets": ["work"],
1927
- "workScopes": ["Sites.Read.All"],
1927
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1928
1928
  "llmTip": "Gets a specific column definition by ID, including its full type configuration (choices for choice columns, format for dateTime, etc.). Use list-sharepoint-list-columns first to find the column ID."
1929
1929
  },
1930
1930
  {
@@ -1932,7 +1932,7 @@
1932
1932
  "method": "patch",
1933
1933
  "toolName": "update-sharepoint-list-column",
1934
1934
  "presets": ["work"],
1935
- "workScopes": ["Sites.Manage.All"],
1935
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1936
1936
  "llmTip": "Updates a column definition. Body: { displayName: 'New name', description: 'New description', required: true, ... }. The column type itself (text, choice, etc.) cannot be changed — only its metadata and per-type options (e.g. choices array for a choice column). Send only the fields you want to change."
1937
1937
  },
1938
1938
  {
@@ -1940,7 +1940,7 @@
1940
1940
  "method": "delete",
1941
1941
  "toolName": "delete-sharepoint-list-column",
1942
1942
  "presets": ["work"],
1943
- "workScopes": ["Sites.Manage.All"],
1943
+ "workScopes": [["Sites.Manage.All"], ["Sites.Selected"]],
1944
1944
  "llmTip": "Deletes a column from a SharePoint list. This is irreversible — all data stored in this column across every list item is lost. Confirm with the user before calling. Cannot delete built-in columns (Title, Created, Modified, etc.)."
1945
1945
  },
1946
1946
  {
@@ -1948,7 +1948,7 @@
1948
1948
  "method": "get",
1949
1949
  "toolName": "get-sharepoint-site-by-path",
1950
1950
  "presets": ["work"],
1951
- "workScopes": ["Sites.Read.All"],
1951
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
1952
1952
  "skipEncoding": ["path"],
1953
1953
  "llmTip": "Resolve a SharePoint site from its server-relative URL. site-id is the hostname (contoso.sharepoint.com) and path is the site path without a leading slash (sites/marketing, teams/hr). Returns the site object whose id feeds list-sharepoint-site-drives."
1954
1954
  },