@antonytm/mcp-sitecore-server 0.3.0 → 0.5.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.
Files changed (30) hide show
  1. package/README.md +14 -0
  2. package/dist/tools/powershell/client.js +3 -0
  3. package/dist/tools/powershell/client.js.map +1 -1
  4. package/dist/tools/powershell/simple/security/access-rights.d.ts +7 -0
  5. package/dist/tools/powershell/simple/security/access-rights.js +33 -0
  6. package/dist/tools/powershell/simple/security/access-rights.js.map +1 -0
  7. package/dist/tools/powershell/simple/security/register-add-role-member.d.ts +3 -0
  8. package/dist/tools/powershell/simple/security/register-add-role-member.js +19 -0
  9. package/dist/tools/powershell/simple/security/register-add-role-member.js.map +1 -0
  10. package/dist/tools/powershell/simple/security/register-get-item-acl.d.ts +3 -0
  11. package/dist/tools/powershell/simple/security/register-get-item-acl.js +56 -0
  12. package/dist/tools/powershell/simple/security/register-get-item-acl.js.map +1 -0
  13. package/dist/tools/powershell/simple/security/register-remove-rolemember.d.ts +3 -0
  14. package/dist/tools/powershell/simple/security/register-remove-rolemember.js +19 -0
  15. package/dist/tools/powershell/simple/security/register-remove-rolemember.js.map +1 -0
  16. package/dist/tools/powershell/simple/security/register-security-powershell.js +14 -0
  17. package/dist/tools/powershell/simple/security/register-security-powershell.js.map +1 -1
  18. package/dist/tools/powershell/simple/security/register-set-user.d.ts +3 -0
  19. package/dist/tools/powershell/simple/security/register-set-user.js +66 -0
  20. package/dist/tools/powershell/simple/security/register-set-user.js.map +1 -0
  21. package/dist/tools/powershell/simple/security/register-test-account.d.ts +3 -0
  22. package/dist/tools/powershell/simple/security/register-test-account.js +21 -0
  23. package/dist/tools/powershell/simple/security/register-test-account.js.map +1 -0
  24. package/dist/tools/powershell/simple/security/register-test-item-acl.d.ts +3 -0
  25. package/dist/tools/powershell/simple/security/register-test-item-acl.js +59 -0
  26. package/dist/tools/powershell/simple/security/register-test-item-acl.js.map +1 -0
  27. package/dist/tools/powershell/simple/security/register-unlock-user.d.ts +3 -0
  28. package/dist/tools/powershell/simple/security/register-unlock-user.js +16 -0
  29. package/dist/tools/powershell/simple/security/register-unlock-user.js.map +1 -0
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -48,6 +48,20 @@
48
48
  - [x] `security-protect-item-by-path`: protects an item by path
49
49
  - [x] `security-unprotect-item-by-id`: unprotects an item by ID
50
50
  - [x] `security-unprotect-item-by-path`: unprotects an item by path
51
+ - [x] `security-test-acccount`: tests an account
52
+ - [x] `security-unlock-user`: unlocks a user
53
+ - [ ] test covergage requires logging user with wrong password
54
+ - [ ] `security-login-user`: logs in a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1367#issue-3055272174).
55
+ - [ ] `security-logout-user`: logs out a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1368)
56
+ - [ ] `security-export-user`: exports a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1370)
57
+ - [ ] `security-import-user`: imports a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1371)
58
+ - [ ] `security-export-role`: exports a role. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1369)
59
+ - [ ] `security-import-role`: imports a role. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1372)
60
+ - [x] `security-add-role-member`: adds a member to a role
61
+ - [x] `security-remove-role-member`: removes a member from a role
62
+ - [x] `security-test-item-acl-by-id`: tests an item ACL by ID
63
+ - [x] `security-test-item-acl-by-path`: tests an item ACL by path
64
+
51
65
  - [ ] Sitecore CLI
52
66
 
53
67
  ## Installation
@@ -25,6 +25,9 @@ class PowershellClient {
25
25
  if (parameters[parameter] === "") {
26
26
  scriptWithParameters += ` -${parameter}`;
27
27
  }
28
+ else if (Array.isArray(parameters[parameter])) {
29
+ scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
30
+ }
28
31
  else {
29
32
  scriptWithParameters += ` -${parameter} "${parameters[parameter]}"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BACxE,CAAC;YACL,CAAC;QACL,CAAC;QAED,MAAM,IAAI,GAAG,GAAG,oBAAoB,UAAU,IAAI,QAAQ,CAAC;QAE3D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC9B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,IAAI;SAEb,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAAc,EAAE,aAAkC,EAAE;QACxE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI;iBAC3B,IAAI,CAAC,GAAG,CAAC;iBACT,IAAI,CAAC,GAAG,CAAC;iBACT,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Simple array of access rights available in Sitecore security operations.
3
+ * Used in security-related PowerShell operations like Test-ItemAcl.
4
+ *
5
+ * @see https://doc.sitecorepowershell.com/appendix/security/test-itemacl
6
+ */
7
+ export declare const AccessRights: string[];
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Simple array of access rights available in Sitecore security operations.
3
+ * Used in security-related PowerShell operations like Test-ItemAcl.
4
+ *
5
+ * @see https://doc.sitecorepowershell.com/appendix/security/test-itemacl
6
+ */
7
+ export const AccessRights = [
8
+ // Item-level access rights
9
+ 'item:read',
10
+ 'item:write',
11
+ 'item:create',
12
+ 'item:delete',
13
+ 'item:rename',
14
+ 'item:admin',
15
+ // Field-level access rights
16
+ 'field:read',
17
+ 'field:write',
18
+ // Language-level access rights
19
+ 'language:read',
20
+ 'language:write',
21
+ // Workflow-related access rights
22
+ 'workflowState:delete',
23
+ 'workflowState:write',
24
+ 'workflowCommand:execute',
25
+ // Additional access rights
26
+ 'site:enter',
27
+ 'remote:fieldread',
28
+ 'insert:show',
29
+ 'profile:customize',
30
+ 'bucket:makebucket',
31
+ 'bucket:unmake'
32
+ ];
33
+ //# sourceMappingURL=access-rights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-rights.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/access-rights.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,WAAW;IACX,YAAY;IACZ,aAAa;IACb,aAAa;IACb,aAAa;IACb,YAAY;IAEZ,4BAA4B;IAC5B,YAAY;IACZ,aAAa;IAEb,+BAA+B;IAC/B,eAAe;IACf,gBAAgB;IAEhB,iCAAiC;IACjC,sBAAsB;IACtB,qBAAqB;IACrB,yBAAyB;IAEzB,2BAA2B;IAC3B,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;CAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerAddRoleMemberPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerAddRoleMemberPowerShell(server, config) {
5
+ server.tool("security-add-role-member", "Adds a member to a Sitecore role.", {
6
+ identity: z.string()
7
+ .describe("The identity of the role to add members to (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
8
+ members: z.string()
9
+ .describe("The members to add to the role (comma-separated list of users or roles, e.g. 'sitecore\\user1,sitecore\\user2')"),
10
+ }, async (params) => {
11
+ const command = `Add-RoleMember`;
12
+ const options = {
13
+ "Identity": params.identity,
14
+ "Members": params.members.split(',').map(member => member.trim()).join('","'),
15
+ };
16
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
17
+ });
18
+ }
19
+ //# sourceMappingURL=register-add-role-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-add-role-member.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-add-role-member.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,+BAA+B,CAAC,MAAiB,EAAE,MAAc;IAC7E,MAAM,CAAC,IAAI,CACP,0BAA0B,EAC1B,mCAAmC,EACnC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,oGAAoG,CAAC;QACnH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;aACd,QAAQ,CAAC,iHAAiH,CAAC;KACnI,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,gBAAgB,CAAC;QACjC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;SAChF,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerGetItemAclPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerGetItemAclPowerShell(server, config) {
5
+ server.tool("security-get-item-acl-by-id", "Gets the access control list (ACL) of a Sitecore item by its ID.", {
6
+ id: z.string()
7
+ .describe("The ID of the item to get ACL for"),
8
+ includeInherited: z.boolean().optional()
9
+ .describe("If set to true, includes inherited ACL entries"),
10
+ includeSystem: z.boolean().optional()
11
+ .describe("If set to true, includes system ACL entries"),
12
+ database: z.string().optional()
13
+ .describe("The database containing the item (defaults to the context database)")
14
+ }, async (params) => {
15
+ const command = `Get-ItemAcl`;
16
+ const options = {
17
+ "ID": params.id,
18
+ };
19
+ if (params.includeInherited) {
20
+ options["IncludeInherited"] = "";
21
+ }
22
+ if (params.includeSystem) {
23
+ options["IncludeSystem"] = "";
24
+ }
25
+ if (params.database) {
26
+ options["Database"] = params.database;
27
+ }
28
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
29
+ });
30
+ server.tool("security-get-item-acl-by-path", "Gets the access control list (ACL) of a Sitecore item by its path.", {
31
+ path: z.string()
32
+ .describe("The path of the item to get ACL for (e.g. /sitecore/content/Home)"),
33
+ includeInherited: z.boolean().optional()
34
+ .describe("If set to true, includes inherited ACL entries"),
35
+ includeSystem: z.boolean().optional()
36
+ .describe("If set to true, includes system ACL entries"),
37
+ database: z.string().optional()
38
+ .describe("The database containing the item (defaults to the context database)")
39
+ }, async (params) => {
40
+ const command = `Get-ItemAcl`;
41
+ const options = {
42
+ "Path": params.path,
43
+ };
44
+ if (params.includeInherited) {
45
+ options["IncludeInherited"] = "";
46
+ }
47
+ if (params.includeSystem) {
48
+ options["IncludeSystem"] = "";
49
+ }
50
+ if (params.database) {
51
+ options["Database"] = params.database;
52
+ }
53
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
54
+ });
55
+ }
56
+ //# sourceMappingURL=register-get-item-acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-get-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-get-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,kEAAkE,EAClE;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,mCAAmC,CAAC;QAClD,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aACnC,QAAQ,CAAC,gDAAgD,CAAC;QAC/D,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAChC,QAAQ,CAAC,6CAA6C,CAAC;QAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,IAAI,EAAE,MAAM,CAAC,EAAE;SAClB,CAAC;QAEF,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC1B,OAAO,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC;QACrC,CAAC;QAED,IAAI,MAAM,C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,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerRemoveRoleMemberPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerRemoveRoleMemberPowerShell(server, config) {
5
+ server.tool("security-remove-role-member", "Removes members from a Sitecore role.", {
6
+ identity: z.string()
7
+ .describe("The identity of the role to remove members from (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
8
+ members: z.string()
9
+ .describe("The members to remove from the role (comma-separated list of users or roles, e.g. 'sitecore\\user1,sitecore\\user2')"),
10
+ }, async (params) => {
11
+ const command = `Remove-RoleMember`;
12
+ const options = {
13
+ "Identity": params.identity,
14
+ "Members": params.members.split(',').map(member => member.trim()).join('","'),
15
+ };
16
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
17
+ });
18
+ }
19
+ //# sourceMappingURL=register-remove-rolemember.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-remove-rolemember.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-rolemember.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,kCAAkC,CAAC,MAAiB,EAAE,MAAc;IAChF,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,uCAAuC,EACvC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,yGAAyG,CAAC;QACxH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;aACd,QAAQ,CAAC,sHAAsH,CAAC;KACxI,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,mBAAmB,CAAC;QACpC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;SAChF,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -3,9 +3,13 @@ import { registerNewUserPowerShell } from "./register-new-user.js";
3
3
  import { registerRemoveUserPowerShell } from "./register-remove-user.js";
4
4
  import { registerDisableUserPowerShell } from "./register-disable-user.js";
5
5
  import { registerEnableUserPowerShell } from "./register-enable-user.js";
6
+ import { registerUnlockUserPowerShell } from "./register-unlock-user.js";
7
+ import { registerSetUserPowerShell } from "./register-set-user.js";
6
8
  import { registerGetDomainPowerShell } from "./register-get-domain.js";
7
9
  import { registerGetRolePowerShell } from "./register-get-role.js";
8
10
  import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
11
+ import { registerAddRoleMemberPowerShell } from "./register-add-role-member.js";
12
+ import { registerRemoveRoleMemberPowerShell } from "./register-remove-rolemember.js";
9
13
  import { registerLockItemPowerShell } from "./register-lock-item.js";
10
14
  import { registerUnlockItemPowerShell } from "./register-unlock-item.js";
11
15
  import { registerProtectItemPowerShell } from "./register-protect-item.js";
@@ -14,15 +18,22 @@ import { registerNewRolePowerShell } from "./register-new-role.js";
14
18
  import { registerRemoveRolePowerShell } from "./register-remove-role.js";
15
19
  import { registerNewDomainPowerShell } from "./register-new-domain.js";
16
20
  import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
21
+ import { registerTestAccountPowerShell } from "./register-test-account.js";
22
+ import { registerGetItemAclPowerShell } from "./register-get-item-acl.js";
23
+ import { registerTestItemAclPowerShell } from "./register-test-item-acl.js";
17
24
  export function registerSecurityPowerShell(server, config) {
18
25
  registerGetUserPowerShell(server, config);
19
26
  registerNewUserPowerShell(server, config);
20
27
  registerRemoveUserPowerShell(server, config);
21
28
  registerDisableUserPowerShell(server, config);
22
29
  registerEnableUserPowerShell(server, config);
30
+ registerUnlockUserPowerShell(server, config);
31
+ registerSetUserPowerShell(server, config);
23
32
  registerGetDomainPowerShell(server, config);
24
33
  registerGetRolePowerShell(server, config);
25
34
  registerGetRoleMemberPowerShell(server, config);
35
+ registerAddRoleMemberPowerShell(server, config);
36
+ registerRemoveRoleMemberPowerShell(server, config);
26
37
  registerLockItemPowerShell(server, config);
27
38
  registerUnlockItemPowerShell(server, config);
28
39
  registerProtectItemPowerShell(server, config);
@@ -31,5 +42,8 @@ export function registerSecurityPowerShell(server, config) {
31
42
  registerRemoveRolePowerShell(server, config);
32
43
  registerNewDomainPowerShell(server, config);
33
44
  registerRemoveDomainPowerShell(server, config);
45
+ registerTestAccountPowerShell(server, config);
46
+ registerGetItemAclPowerShell(server, config);
47
+ registerTestItemAclPowerShell(server, config);
34
48
  }
35
49
  //# sourceMappingURL=register-security-powershell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2B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CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC"}
1
+ {"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAA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B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerSetUserPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerSetUserPowerShell(server, config) {
5
+ server.tool("security-set-user", "Updates properties of a Sitecore user account.", {
6
+ identity: z.string()
7
+ .describe("The identity of the user to update (e.g. 'admin' or full path 'sitecore\\admin')"),
8
+ isAdministrator: z.boolean().optional()
9
+ .describe("Set the user as an administrator"),
10
+ password: z.string().optional()
11
+ .describe("The new password for the user"),
12
+ comment: z.string().optional()
13
+ .describe("Comment for the user"),
14
+ email: z.string().optional()
15
+ .describe("Email for the user"),
16
+ fullName: z.string().optional()
17
+ .describe("Full name of the user"),
18
+ portrait: z.string().optional()
19
+ .describe("Portrait for the user"),
20
+ profileItemId: z.string().optional()
21
+ .describe("Profile item ID for the user"),
22
+ startUrl: z.string().optional()
23
+ .describe("Start URL for the user"),
24
+ clientLanguage: z.string().optional()
25
+ .describe("Client language for the user"),
26
+ enabled: z.boolean().optional()
27
+ .describe("Enable or disable the user"),
28
+ }, async (params) => {
29
+ const command = `Set-User`;
30
+ const options = {
31
+ "Identity": params.identity,
32
+ };
33
+ if (params.password) {
34
+ options["Password"] = params.password;
35
+ }
36
+ if (params.comment) {
37
+ options["Comment"] = params.comment;
38
+ }
39
+ if (params.email) {
40
+ options["Email"] = params.email;
41
+ }
42
+ if (params.fullName) {
43
+ options["FullName"] = params.fullName;
44
+ }
45
+ if (params.portrait) {
46
+ options["Portrait"] = params.portrait;
47
+ }
48
+ if (params.startUrl) {
49
+ options["StartUrl"] = params.startUrl;
50
+ }
51
+ if (params.clientLanguage) {
52
+ options["ClientLanguage"] = params.clientLanguage;
53
+ }
54
+ if (params.profileItemId) {
55
+ options["ProfileItemId"] = params.profileItemId;
56
+ }
57
+ if (params.isAdministrator) {
58
+ options["IsAdministrator"] = params.isAdministrator;
59
+ }
60
+ if (params.enabled) {
61
+ options["Enabled"] = params.enabled;
62
+ }
63
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
64
+ });
65
+ }
66
+ //# sourceMappingURL=register-set-user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-set-user.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-set-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAc;IACvE,MAAM,CAAC,IAAI,CACP,mBAAmB,EACnB,gDAAgD,EAChD;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,kFAAkF,CAAC;QACjG,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAClC,QAAQ,CAAC,kCAAkC,CAAC;QACjD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,+BAA+B,CAAC;QAC9C,OAAO,EAAE,CAAC,CAAC,M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CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YACxB,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC;QACtD,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC;QACpD,CAAC;QAED,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;YACzB,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;QACxD,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;QACxC,CAAC;QAGD,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerTestAccountPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerTestAccountPowerShell(server, config) {
5
+ server.tool("security-test-account", "Tests if a Sitecore user exists and has specific properties.", {
6
+ identity: z.string()
7
+ .describe("The identity of the user to test (e.g. 'admin' or full path 'sitecore\\admin')"),
8
+ accountType: z.enum(["All", "User", "Role"]).optional()
9
+ .describe("The type of account to test (defaults to 'All')"),
10
+ }, async (params) => {
11
+ const command = `Test-Account`;
12
+ const options = {
13
+ "Identity": params.identity
14
+ };
15
+ if (params.accountType) {
16
+ options["AccountType"] = params.accountType;
17
+ }
18
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
19
+ });
20
+ }
21
+ //# sourceMappingURL=register-test-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-test-account.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-test-account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,uBAAuB,EACvB,8DAA8D,EAC9D;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,gFAAgF,CAAC;QAC/F,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;aAClD,QAAQ,CAAC,iDAAiD,CAAC;KACnE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAChD,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerTestItemAclPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ import { AccessRights } from "./access-rights.js";
5
+ export function registerTestItemAclPowerShell(server, config) {
6
+ server.tool("security-test-item-acl-by-id", "Tests whether a user or role has specific access rights to a Sitecore item by its ID.", {
7
+ id: z.string()
8
+ .describe("The ID of the item to test access rights on"),
9
+ identity: z.string()
10
+ .describe("The identity of the user or role to test (e.g. 'sitecore\\admin')"),
11
+ accessRight: z.enum(AccessRights)
12
+ .describe("The access right to test (e.g. 'item:read', 'item:write')"),
13
+ propType: z.enum(["Descendants", "Children", "Entity"]).optional()
14
+ .describe("The propagation type for the access right"),
15
+ database: z.string().optional()
16
+ .describe("The database containing the item (defaults to the context database)")
17
+ }, async (params) => {
18
+ const command = `Test-ItemAcl`;
19
+ const options = {
20
+ "ID": params.id,
21
+ "Identity": params.identity,
22
+ "AccessRight": params.accessRight,
23
+ };
24
+ if (params.propType) {
25
+ options["PropType"] = params.propType;
26
+ }
27
+ if (params.database) {
28
+ options["Database"] = params.database;
29
+ }
30
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
31
+ });
32
+ server.tool("security-test-item-acl-by-path", "Tests whether a user or role has specific access rights to a Sitecore item by its path.", {
33
+ path: z.string()
34
+ .describe("The path of the item to test access rights on (e.g. /sitecore/content/Home)"),
35
+ identity: z.string()
36
+ .describe("The identity of the user or role to test (e.g. 'sitecore\\admin')"),
37
+ accessRight: z.string()
38
+ .describe("The access right to test (e.g. 'item:read', 'item:write')"),
39
+ propType: z.enum(["Descendants", "Children", "Entity"]).optional()
40
+ .describe("The propagation type for the access right"),
41
+ database: z.string().optional()
42
+ .describe("The database containing the item (defaults to the context database)")
43
+ }, async (params) => {
44
+ const command = `Test-ItemAcl`;
45
+ const options = {
46
+ "Path": params.path,
47
+ "Identity": params.identity,
48
+ "AccessRight": params.accessRight,
49
+ };
50
+ if (params.propType) {
51
+ options["PropType"] = params.propType;
52
+ }
53
+ if (params.database) {
54
+ options["Database"] = params.database;
55
+ }
56
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
57
+ });
58
+ }
59
+ //# sourceMappingURL=register-test-item-acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-test-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-test-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,8BAA8B,EAC9B,uFAAuF,EACvF;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,6CAA6C,CAAC;QAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,mEAAmE,CAAC;QAClF,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,YAAqC,CAAC;aACrD,QAAQ,CAAC,2DAA2D,CAAC;QAC1E,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;aAC7D,QAAQ,CAAC,2CAA2C,CAAC;QAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM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AC;QAC/B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,aAAa,EAAE,MAAM,CAAC,WAAW;SACpC,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerUnlockUserPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerUnlockUserPowerShell(server, config) {
5
+ server.tool("security-unlock-user", "Unlocks a Sitecore user account that has been locked out due to failed login attempts.", {
6
+ identity: z.string()
7
+ .describe("The identity of the user to unlock (e.g. 'admin' or full path 'sitecore\\admin')"),
8
+ }, async (params) => {
9
+ const command = `Unlock-User`;
10
+ const options = {
11
+ "Identity": params.identity,
12
+ };
13
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
14
+ });
15
+ }
16
+ //# sourceMappingURL=register-unlock-user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-unlock-user.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unlock-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,sBAAsB,EACtB,wFAAwF,EACxF;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,kFAAkF,CAAC;KACpG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antonytm/mcp-sitecore-server",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "A Model Context Protocol server for Sitecore",
5
5
  "files": [
6
6
  "dist",