@juvantlabs/m365-graph-mcp-server 0.3.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -11,6 +11,48 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [0.4.0] - unreleased — SharePoint sites RW + permission-surface invariants
15
+
16
+ ### Added
17
+
18
+ - **Delegated scope `Sites.ReadWrite.All`** in `src/auth/msal.ts`. Enables
19
+ read/write against SharePoint document libraries via the existing file
20
+ tools. Deliberately scoped: `Sites.Manage.All`, `Sites.FullControl.All`,
21
+ and `Application.ReadWrite.All` are NOT requested — those carry
22
+ permission-mutation privileges (sharing-link creation, guest invites,
23
+ permission grants, ownership transfer) outside the v0.4.0 threat model.
24
+ - **`ToolCategory` value `permission_mutating`** (`src/types/tool.ts`),
25
+ distinct from `write_irreversible`. Reserved for operations that create
26
+ or modify standing access / sharing / ownership. v0.4.0 ships with zero
27
+ tools in this category — it is a pre-classification slot.
28
+
29
+ ### Security
30
+
31
+ - **CI Layer A — permission-mutation surface invariant**
32
+ (`.github/workflows/ci.yml`). Two checks fail the build:
33
+ (1) the MSAL scope set in `src/auth/msal.ts` must not include
34
+ `Sites.Manage.All` / `Sites.FullControl.All` / `Application.ReadWrite.All`
35
+ unless at least one tool is classified `permission_mutating` AND its
36
+ filename is on `PERMISSION_MUTATING_ALLOWLIST` inside the workflow;
37
+ (2) any tool source under `src/tools/` matching a permission/sharing
38
+ Graph endpoint shape (`/permissions`, `createLink`, `/invite`,
39
+ `assignSensitivityLabel`, `transferOwnership`) must be classified
40
+ `permission_mutating` and on the same allowlist. The allowlist is
41
+ intentionally maintained inline in the workflow so additions surface
42
+ in code review.
43
+ - **CI Layer B — synthetic permission-surface canary**
44
+ (`tests/unit/permission_surface.test.ts`). Static assertion over
45
+ `ALL_TOOLS` that every exposed tool is either scopable (declares a
46
+ drive/site/item/event/meeting/calendar/transcript id parameter in its
47
+ inputSchema), on the `NO_TARGET_TOOLS` allowlist, or classified
48
+ `permission_mutating`. Runs unconditionally — no tenant calls, no
49
+ secrets — so PR builds without `VENDOR_SANDBOX_TOKEN` still gate.
50
+ - Baseline assertion: zero `permission_mutating` tools in v0.4.0.
51
+ Introducing the first one requires updating BOTH the test floor AND
52
+ the workflow allowlist in the same PR.
53
+
54
+ Reference: decisions#210 (per-agent legal-ip enforcement architecture).
55
+
14
56
  ---
15
57
 
16
58
  ## [0.3.0] - 2026-06-22 — Long Teams transcript paging + cap fix
@@ -1 +1 @@
1
- {"version":3,"file":"msal.d.ts","sourceRoot":"","sources":["../../src/auth/msal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,6BAA6B,EAE7B,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAI1B;;;;;;;GAOG;AAKH,eAAO,MAAM,gBAAgB,UAO5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,wCAAwC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAe9D;AAED,wBAAgB,cAAc,IAAI,6BAA6B,CAa9D;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,MAAM,CAAC,CAoBjB"}
1
+ {"version":3,"file":"msal.d.ts","sourceRoot":"","sources":["../../src/auth/msal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,6BAA6B,EAE7B,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAI1B;;;;;;;GAOG;AAcH,eAAO,MAAM,gBAAgB,UAQ5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,wCAAwC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAe9D;AAED,wBAAgB,cAAc,IAAI,6BAA6B,CAa9D;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,MAAM,CAAC,CAoBjB"}
package/dist/auth/msal.js CHANGED
@@ -23,9 +23,19 @@ import { getTokenStore } from "./keyring.js";
23
23
  // Calendars.Read. The Entra app permissions list still includes the
24
24
  // narrower scopes (granted earlier) — they're harmless, just not
25
25
  // requested at token acquisition time.
26
+ //
27
+ // `Sites.ReadWrite.All` (added v0.4.0): delegated scope for SharePoint
28
+ // document-library RW. Deliberately *not* `Sites.Manage.All` /
29
+ // `Sites.FullControl.All` / `Application.ReadWrite.All` — those carry
30
+ // permission-mutation privileges (sharing-link creation, guest invites,
31
+ // permission grants, ownership transfer) that exceed the v0.4.0 threat
32
+ // model. CI Layer A in `.github/workflows/ci.yml` fails the build if
33
+ // any of those broader scopes are introduced without a matching
34
+ // `permission_mutating` tool classification + allowlist entry.
26
35
  export const DELEGATED_SCOPES = [
27
36
  "User.Read",
28
37
  "Files.ReadWrite",
38
+ "Sites.ReadWrite.All",
29
39
  "Calendars.ReadWrite",
30
40
  "OnlineMeetings.Read",
31
41
  "OnlineMeetingTranscript.Read.All",
@@ -1 +1 @@
1
- {"version":3,"file":"msal.js","sourceRoot":"","sources":["../../src/auth/msal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,6BAA6B,GAI9B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,oEAAoE;AACpE,oEAAoE;AACpE,iEAAiE;AACjE,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW;IACX,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,kCAAkC;IAClC,gBAAgB;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,C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B,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,iEAAiE,CACpE,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC;AAC5B,CAAC"}
@@ -30,11 +30,22 @@ export interface ToolDefinition {
30
30
  * to recipients, deletions without a deterministic restore path,
31
31
  * payments). MUST gate via the two-phase confirmation token pattern
32
32
  * (preview → token → execute) per ADR 0002. CI enforces this.
33
+ * - `permission_mutating` — operations that create/modify standing
34
+ * access, sharing, or ownership of a resource (sharing-link creation,
35
+ * guest invite, permission grant/revoke, sensitivity-label change,
36
+ * ownership transfer). Distinct from `write_irreversible` because
37
+ * the threat model is privilege escalation: a single call grants a
38
+ * third party persistent access that survives the session and
39
+ * bypasses content-level RW deny-lists. No tool in v0.4.0 carries
40
+ * this category — it is a pre-classification slot. CI Layer A
41
+ * (`.github/workflows/ci.yml`) fails the build if any future tool
42
+ * touches a permission/sharing Graph endpoint without being
43
+ * classified here AND added to the workflow's allowlist.
33
44
  *
34
45
  * Ambiguous categorizations resolve to the strictest. When in doubt,
35
46
  * gate it.
36
47
  */
37
- export type ToolCategory = "read" | "write_idempotent" | "write_irreversible";
48
+ export type ToolCategory = "read" | "write_idempotent" | "write_irreversible" | "permission_mutating";
38
49
  /**
39
50
  * Return shape for a tool handler. We use the SDK's `CallToolResult`
40
51
  * directly so the dispatcher in `src/index.ts` can return handler
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/types/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAA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AAM,WAAW,GAAG,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,YAAY,CAAC,CAAC;AAE3B,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juvantlabs/m365-graph-mcp-server",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Microsoft Graph MCP server — OneDrive, SharePoint, and Calendar read+write for Juvant OS agents.",
5
5
  "license": "MIT",
6
6
  "author": "Juvant Srls",