@antonytm/mcp-sitecore-server 0.5.0 → 0.6.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 (27) hide show
  1. package/README.md +7 -0
  2. package/dist/tools/powershell/composite/register-composite-powershell.d.ts +3 -0
  3. package/dist/tools/powershell/composite/register-composite-powershell.js +5 -0
  4. package/dist/tools/powershell/composite/register-composite-powershell.js.map +1 -0
  5. package/dist/tools/powershell/composite/security/register-security-powershell.d.ts +3 -0
  6. package/dist/tools/powershell/composite/security/register-security-powershell.js +5 -0
  7. package/dist/tools/powershell/composite/security/register-security-powershell.js.map +1 -0
  8. package/dist/tools/powershell/composite/security/register-set-item-acl.d.ts +3 -0
  9. package/dist/tools/powershell/composite/security/register-set-item-acl.js +59 -0
  10. package/dist/tools/powershell/composite/security/register-set-item-acl.js.map +1 -0
  11. package/dist/tools/powershell/register-powershell.js +2 -0
  12. package/dist/tools/powershell/register-powershell.js.map +1 -1
  13. package/dist/tools/powershell/simple/security/register-add-item-acl.d.ts +3 -0
  14. package/dist/tools/powershell/simple/security/register-add-item-acl.js +66 -0
  15. package/dist/tools/powershell/simple/security/register-add-item-acl.js.map +1 -0
  16. package/dist/tools/powershell/simple/security/register-clear-item-acl.d.ts +3 -0
  17. package/dist/tools/powershell/simple/security/register-clear-item-acl.js +46 -0
  18. package/dist/tools/powershell/simple/security/register-clear-item-acl.js.map +1 -0
  19. package/dist/tools/powershell/simple/security/register-security-powershell.js +6 -0
  20. package/dist/tools/powershell/simple/security/register-security-powershell.js.map +1 -1
  21. package/dist/tools/powershell/simple/security/register-set-user-password.d.ts +3 -0
  22. package/dist/tools/powershell/simple/security/register-set-user-password.js +29 -0
  23. package/dist/tools/powershell/simple/security/register-set-user-password.js.map +1 -0
  24. package/dist/tools/powershell/utils.d.ts +1 -0
  25. package/dist/tools/powershell/utils.js +18 -0
  26. package/dist/tools/powershell/utils.js.map +1 -0
  27. package/package.json +1 -1
package/README.md CHANGED
@@ -40,6 +40,7 @@
40
40
  - [x] `security-get-role-member`: returns members of a role
41
41
  - [x] `security-enable-user`: enables a user
42
42
  - [x] `security-disable-user`: disables a user
43
+ - [x] `security-set-user-password`: changes a user's password
43
44
  - [x] `security-lock-item-by-id`: locks an item by ID
44
45
  - [x] `security-unlock-item-by-id`: unlocks an item by ID
45
46
  - [x] `security-lock-item-by-path`: locks an item by path
@@ -61,6 +62,12 @@
61
62
  - [x] `security-remove-role-member`: removes a member from a role
62
63
  - [x] `security-test-item-acl-by-id`: tests an item ACL by ID
63
64
  - [x] `security-test-item-acl-by-path`: tests an item ACL by path
65
+ - [x] `security-add-item-acl-by-id`: adds an item ACL by ID
66
+ - [x] `security-add-item-acl-by-path`: adds an item ACL by path
67
+ - [x] `security-clear-item-acl-by-id`: clears an item ACL by ID
68
+ - [x] `security-clear-item-acl-by-path`: clears an item ACL by path
69
+ - [x] `security-set-item-acl-by-id`: sets an item ACL by ID
70
+ - [x] `security-set-item-acl-by-path`: sets an item ACL by path
64
71
 
65
72
  - [ ] Sitecore CLI
66
73
 
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../config.js";
3
+ export declare function registerCompositePowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,5 @@
1
+ import { registerSecurityPowerShell } from "./security/register-security-powershell.js";
2
+ export function registerCompositePowerShell(server, config) {
3
+ registerSecurityPowerShell(server, config);
4
+ }
5
+ //# sourceMappingURL=register-composite-powershell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-composite-powershell.js","sourceRoot":"","sources":["../../../../src/tools/powershell/composite/register-composite-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAc;IACzE,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config";
3
+ export declare function registerSecurityPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,5 @@
1
+ import { registerSetItemAclPowerShell } from "./register-set-item-acl.js";
2
+ export function registerSecurityPowerShell(server, config) {
3
+ registerSetItemAclPowerShell(server, config);
4
+ }
5
+ //# sourceMappingURL=register-security-powershell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACjD,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 registerSetItemAclPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { prepareArgsString } from "../../utils.js";
4
+ import { AccessRights } from "../../simple/security/access-rights.js";
5
+ import { runGenericPowershellCommand } from "../../simple/generic.js";
6
+ // This security tool doesn't have sense as it could be replaced with Add-ItemAcl+Clear-ItemAcl tools.
7
+ // It is kept for testing "composite" tools.
8
+ export function registerSetItemAclPowerShell(server, config) {
9
+ server.tool("security-set-item-acl-by-id", "Sets an access control entry to a Sitecore item by its ID.", {
10
+ id: z.string()
11
+ .describe("The ID of the item to add ACL entry for"),
12
+ identity: z.string()
13
+ .describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
14
+ accessRight: z.enum(AccessRights)
15
+ .describe("The access right to grant (e.g. 'item:read', 'item:write')"),
16
+ propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
17
+ .describe("The propagation type for the access right"),
18
+ securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
19
+ .describe("Whether to allow or deny the specified access right"),
20
+ }, async (params) => {
21
+ const parameters1Obj = {};
22
+ parameters1Obj["Identity"] = params.identity;
23
+ parameters1Obj["AccessRight"] = params.accessRight;
24
+ parameters1Obj["PropagationType"] = params.propagationType;
25
+ parameters1Obj["SecurityPermission"] = params.securityPermission;
26
+ const parameters1 = prepareArgsString(parameters1Obj);
27
+ const command = `
28
+ $acl = New-ItemAcl ${parameters1}
29
+ Get-Item -Id ${params.id} | Set-ItemAcl -AccessRules $acl
30
+ `.replaceAll(/[\n]+/g, "");
31
+ ;
32
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
33
+ });
34
+ server.tool("security-set-item-acl-by-path", "Sets an access control entry to a Sitecore item by its path.", {
35
+ path: z.string()
36
+ .describe("The path of the item to add ACL entry for"),
37
+ identity: z.string()
38
+ .describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
39
+ accessRight: z.enum(AccessRights)
40
+ .describe("The access right to grant (e.g. 'item:read', 'item:write')"),
41
+ propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
42
+ .describe("The propagation type for the access right"),
43
+ securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
44
+ .describe("Whether to allow or deny the specified access right"),
45
+ }, async (params) => {
46
+ const parameters1Obj = {};
47
+ parameters1Obj["Identity"] = params.identity;
48
+ parameters1Obj["AccessRight"] = params.accessRight;
49
+ parameters1Obj["PropagationType"] = params.propagationType;
50
+ parameters1Obj["SecurityPermission"] = params.securityPermission;
51
+ const parameters1 = prepareArgsString(parameters1Obj);
52
+ const command = `
53
+ $acl = New-ItemAcl ${parameters1}
54
+ Get-Item -Path "${params.path}" | Set-ItemAcl -AccessRules $acl
55
+ `.replaceAll(/[\n]+/g, "");
56
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
57
+ });
58
+ }
59
+ //# sourceMappingURL=register-set-item-acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-set-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/security/register-set-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,sGAAsG;AACtG,4CAA4C;AAC5C,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,4DAA4D,EAC5D;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,yCAAyC,CAAC;QACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,6FAA6F,CAAC;QAC5G,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,YAAqC,CAAC;aACrD,QAAQ,CAAC,4DAA4D,CAAC;QAC3E,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;aAC3E,QAAQ,CAAC,2CAA2C,CAAC;QAC1D,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;aAC3E,QAAQ,CAAC,qDAAqD,CAAC;KACvE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,cAAc,GAAQ,EAAE,CAAC;QAE/B,cAAc,CAAC,UAAU,C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AU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC7C,cAAc,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QACnD,cAAc,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;QAC3D,cAAc,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEjE,MAAM,WAAW,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG;qCACS,WAAW;kCACd,MAAM,CAAC,IAAI;aAChC,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE3B,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { registerSimplePowerShell } from "./simple/register-simple-powershell.js";
2
+ import { registerCompositePowerShell } from "./composite/register-composite-powershell.js";
2
3
  export function registerPowerShell(server, config) {
3
4
  registerSimplePowerShell(server, config);
5
+ registerCompositePowerShell(server, config);
4
6
  }
5
7
  //# sourceMappingURL=register-powershell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-powershell.js","sourceRoot":"","sources":["../../../src/tools/powershell/register-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAc;IAChE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"register-powershell.js","sourceRoot":"","sources":["../../../src/tools/powershell/register-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAc;IAChE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD,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 registerAddItemAclPowerShell(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
+ import { AccessRights } from "./access-rights.js";
5
+ export function registerAddItemAclPowerShell(server, config) {
6
+ server.tool("security-add-item-acl-by-id", "Adds an access control entry to a Sitecore item by its ID.", {
7
+ id: z.string()
8
+ .describe("The ID of the item to add ACL entry for"),
9
+ identity: z.string()
10
+ .describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
11
+ accessRight: z.enum(AccessRights)
12
+ .describe("The access right to grant (e.g. 'item:read', 'item:write')"),
13
+ propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
14
+ .describe("The propagation type for the access right"),
15
+ securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
16
+ .describe("Whether to allow or deny the specified access right"),
17
+ database: z.string().optional()
18
+ .describe("The database containing the item (defaults to the context database)")
19
+ }, async (params) => {
20
+ const command = `Add-ItemAcl`;
21
+ const options = {
22
+ "ID": params.id,
23
+ "Identity": params.identity,
24
+ "AccessRight": params.accessRight,
25
+ "PropagationType": params.propagationType,
26
+ "SecurityPermission": params.securityPermission
27
+ };
28
+ if (params.database) {
29
+ options["Database"] = params.database;
30
+ }
31
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
32
+ });
33
+ server.tool("security-add-item-acl-by-path", "Adds an access control entry to a Sitecore item by its path.", {
34
+ path: z.string()
35
+ .describe("The path of the item to add ACL entry for (e.g. /sitecore/content/Home)"),
36
+ identity: z.string()
37
+ .describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
38
+ accessRight: z.enum(AccessRights)
39
+ .describe("The access right to grant (e.g. 'item:read', 'item:write')"),
40
+ propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
41
+ .describe("The propagation type for the access right"),
42
+ securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
43
+ .describe("Whether to allow or deny the specified access right"),
44
+ database: z.string().optional()
45
+ .describe("The database containing the item (defaults to the context database)"),
46
+ passThrough: z.boolean().optional()
47
+ .describe("")
48
+ }, async (params) => {
49
+ const command = `Add-ItemAcl`;
50
+ const options = {
51
+ "Path": params.path,
52
+ "Identity": params.identity,
53
+ "AccessRight": params.accessRight,
54
+ "PropagationType": params.propagationType,
55
+ "SecurityPermission": params.securityPermission
56
+ };
57
+ if (params.database) {
58
+ options["Database"] = params.database;
59
+ }
60
+ if (params.passThrough) {
61
+ options["PassThru"] = "";
62
+ }
63
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
64
+ });
65
+ }
66
+ //# sourceMappingURL=register-add-item-acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-add-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-add-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,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,4DAA4D,EAC5D;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,yCAAyC,CAAC;QACxD,QAAQ,EAAE,CAAC,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AAC,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 registerClearItemAclPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerClearItemAclPowerShell(server, config) {
5
+ server.tool("security-clear-item-acl-by-id", "Clears all access rules from a Sitecore item by its ID.", {
6
+ id: z.string()
7
+ .describe("The ID of the item to clear ACL for"),
8
+ passThru: z.boolean().optional()
9
+ .describe("If set to true, passes the processed object back to the pipeline"),
10
+ database: z.string().optional()
11
+ .describe("The database containing the item (defaults to the context database)")
12
+ }, async (params) => {
13
+ const command = `Clear-ItemAcl`;
14
+ const options = {
15
+ "ID": params.id,
16
+ };
17
+ if (params.passThru) {
18
+ options["PassThru"] = "";
19
+ }
20
+ if (params.database) {
21
+ options["Database"] = params.database;
22
+ }
23
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
24
+ });
25
+ server.tool("security-clear-item-acl-by-path", "Clears all access rules from a Sitecore item by its path.", {
26
+ path: z.string()
27
+ .describe("The path of the item to clear ACL for (e.g. /sitecore/content/Home)"),
28
+ passThru: z.boolean().optional()
29
+ .describe("If set to true, passes the processed object back to the pipeline"),
30
+ database: z.string().optional()
31
+ .describe("The database containing the item (defaults to the context database)")
32
+ }, async (params) => {
33
+ const command = `Clear-ItemAcl`;
34
+ const options = {
35
+ "Path": params.path,
36
+ };
37
+ if (params.passThru) {
38
+ options["PassThru"] = "";
39
+ }
40
+ if (params.database) {
41
+ options["Database"] = params.database;
42
+ }
43
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
44
+ });
45
+ }
46
+ //# sourceMappingURL=register-clear-item-acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-clear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,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,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,eAAe,CAAC;QAChC,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,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"}
@@ -5,6 +5,7 @@ import { registerDisableUserPowerShell } from "./register-disable-user.js";
5
5
  import { registerEnableUserPowerShell } from "./register-enable-user.js";
6
6
  import { registerUnlockUserPowerShell } from "./register-unlock-user.js";
7
7
  import { registerSetUserPowerShell } from "./register-set-user.js";
8
+ import { registerSetUserPasswordPowerShell } from "./register-set-user-password.js";
8
9
  import { registerGetDomainPowerShell } from "./register-get-domain.js";
9
10
  import { registerGetRolePowerShell } from "./register-get-role.js";
10
11
  import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
@@ -21,6 +22,8 @@ import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
21
22
  import { registerTestAccountPowerShell } from "./register-test-account.js";
22
23
  import { registerGetItemAclPowerShell } from "./register-get-item-acl.js";
23
24
  import { registerTestItemAclPowerShell } from "./register-test-item-acl.js";
25
+ import { registerAddItemAclPowerShell } from "./register-add-item-acl.js";
26
+ import { registerClearItemAclPowerShell } from "./register-clear-item-acl.js";
24
27
  export function registerSecurityPowerShell(server, config) {
25
28
  registerGetUserPowerShell(server, config);
26
29
  registerNewUserPowerShell(server, config);
@@ -29,6 +32,7 @@ export function registerSecurityPowerShell(server, config) {
29
32
  registerEnableUserPowerShell(server, config);
30
33
  registerUnlockUserPowerShell(server, config);
31
34
  registerSetUserPowerShell(server, config);
35
+ registerSetUserPasswordPowerShell(server, config);
32
36
  registerGetDomainPowerShell(server, config);
33
37
  registerGetRolePowerShell(server, config);
34
38
  registerGetRoleMemberPowerShell(server, config);
@@ -45,5 +49,7 @@ export function registerSecurityPowerShell(server, config) {
45
49
  registerTestAccountPowerShell(server, config);
46
50
  registerGetItemAclPowerShell(server, config);
47
51
  registerTestItemAclPowerShell(server, config);
52
+ registerAddItemAclPowerShell(server, config);
53
+ registerClearItemAclPowerShell(server, config);
48
54
  }
49
55
  //# 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,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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B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,kCAAkC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,+BAA+B,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;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"}
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,iCAAiC,EAAE,MAAM,iCAAi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
+ export declare function registerSetUserPasswordPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerSetUserPasswordPowerShell(server, config) {
5
+ server.tool("security-set-user-password", "Sets a new password for a Sitecore user.", {
6
+ identity: z.string()
7
+ .describe("The identity of the user to update the password for (e.g. 'admin' or full path 'sitecore\\admin')"),
8
+ newPassword: z.string()
9
+ .describe("The new password for the user"),
10
+ resetPassword: z.boolean().optional()
11
+ .describe("If true, the user will be required to change password on next login"),
12
+ oldPassword: z.string().optional()
13
+ .describe("The old password. If provided, it will be validated before setting the new password"),
14
+ }, async (params) => {
15
+ const command = `Set-UserPassword`;
16
+ const options = {
17
+ "Identity": params.identity,
18
+ "NewPassword": params.newPassword,
19
+ };
20
+ if (params.resetPassword) {
21
+ options["Reset"] = "";
22
+ }
23
+ if (params.oldPassword) {
24
+ options["OldPassword"] = params.oldPassword;
25
+ }
26
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
27
+ });
28
+ }
29
+ //# sourceMappingURL=register-set-user-password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-set-user-password.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-set-user-password.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,iCAAiC,CAAC,MAAiB,EAAE,MAAc;IAC/E,MAAM,CAAC,IAAI,CACP,4BAA4B,EAC5B,0CAA0C,EAC1C;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,mGAAmG,CAAC;QAClH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;aAClB,QAAQ,CAAC,+BAA+B,CAAC;QAC9C,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAChC,QAAQ,CAAC,qEAAqE,CAAC;QACpF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC7B,QAAQ,CAAC,qFAAqF,CAAC;KACvG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,kBAAkB,CAAC;QACnC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,aAAa,EAAE,MAAM,CAAC,WAAW;SACpC,CAAC;QAEF,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAChD,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function prepareArgsString(parameters: Record<string, any>): string;
@@ -0,0 +1,18 @@
1
+ export function prepareArgsString(parameters) {
2
+ let scriptWithParameters = "";
3
+ if (parameters) {
4
+ for (const parameter in parameters) {
5
+ if (parameters[parameter] === "") {
6
+ scriptWithParameters += ` -${parameter}`;
7
+ }
8
+ else if (Array.isArray(parameters[parameter])) {
9
+ scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
10
+ }
11
+ else {
12
+ scriptWithParameters += ` -${parameter} "${parameters[parameter]}"`;
13
+ }
14
+ }
15
+ }
16
+ return scriptWithParameters;
17
+ }
18
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/tools/powershell/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC7D,IAAI,oBAAoB,GAAG,EAAE,CAAC;IAC9B,IAAI,UAAU,EAAE,CAAC;QACb,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC/B,oBAAoB,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,CAAC;iBACI,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBAC5C,oBAAoB,IAAI,KAAK,SAAS,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACpF,CAAC;iBAAM,CAAC;gBACJ,oBAAoB,IAAI,KAAK,SAAS,KAAK,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC;YACxE,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antonytm/mcp-sitecore-server",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A Model Context Protocol server for Sitecore",
5
5
  "files": [
6
6
  "dist",