@antonytm/mcp-sitecore-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/README.md CHANGED
@@ -48,6 +48,18 @@
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
+
51
63
  - [ ] Sitecore CLI
52
64
 
53
65
  ## 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]}"`;
30
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/tools/powershell/client.ts"],"names":[],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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,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 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,12 @@ 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";
6
7
  import { registerGetDomainPowerShell } from "./register-get-domain.js";
7
8
  import { registerGetRolePowerShell } from "./register-get-role.js";
8
9
  import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
10
+ import { registerAddRoleMemberPowerShell } from "./register-add-role-member.js";
11
+ import { registerRemoveRoleMemberPowerShell } from "./register-remove-rolemember.js";
9
12
  import { registerLockItemPowerShell } from "./register-lock-item.js";
10
13
  import { registerUnlockItemPowerShell } from "./register-unlock-item.js";
11
14
  import { registerProtectItemPowerShell } from "./register-protect-item.js";
@@ -14,15 +17,19 @@ import { registerNewRolePowerShell } from "./register-new-role.js";
14
17
  import { registerRemoveRolePowerShell } from "./register-remove-role.js";
15
18
  import { registerNewDomainPowerShell } from "./register-new-domain.js";
16
19
  import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
20
+ import { registerTestAccountPowerShell } from "./register-test-account.js";
17
21
  export function registerSecurityPowerShell(server, config) {
18
22
  registerGetUserPowerShell(server, config);
19
23
  registerNewUserPowerShell(server, config);
20
24
  registerRemoveUserPowerShell(server, config);
21
25
  registerDisableUserPowerShell(server, config);
22
26
  registerEnableUserPowerShell(server, config);
27
+ registerUnlockUserPowerShell(server, config);
23
28
  registerGetDomainPowerShell(server, config);
24
29
  registerGetRolePowerShell(server, config);
25
30
  registerGetRoleMemberPowerShell(server, config);
31
+ registerAddRoleMemberPowerShell(server, config);
32
+ registerRemoveRoleMemberPowerShell(server, config);
26
33
  registerLockItemPowerShell(server, config);
27
34
  registerUnlockItemPowerShell(server, config);
28
35
  registerProtectItemPowerShell(server, config);
@@ -31,5 +38,6 @@ export function registerSecurityPowerShell(server, config) {
31
38
  registerRemoveRolePowerShell(server, config);
32
39
  registerNewDomainPowerShell(server, config);
33
40
  registerRemoveDomainPowerShell(server, config);
41
+ registerTestAccountPowerShell(server, config);
34
42
  }
35
43
  //# 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,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,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAA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,EAAE,MAAM,CAAC,CAAC;IAC1C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,+BAA+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;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 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 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.4.0",
4
4
  "description": "A Model Context Protocol server for Sitecore",
5
5
  "files": [
6
6
  "dist",