@antonytm/mcp-sitecore-server 0.2.2 → 0.3.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 (31) hide show
  1. package/README.md +33 -12
  2. package/dist/tools/powershell/simple/security/register-get-role-member.d.ts +3 -0
  3. package/dist/tools/powershell/simple/security/register-get-role-member.js +31 -0
  4. package/dist/tools/powershell/simple/security/register-get-role-member.js.map +1 -0
  5. package/dist/tools/powershell/simple/security/register-lock-item.d.ts +3 -0
  6. package/dist/tools/powershell/simple/security/register-lock-item.js +56 -0
  7. package/dist/tools/powershell/simple/security/register-lock-item.js.map +1 -0
  8. package/dist/tools/powershell/simple/security/register-new-domain.d.ts +3 -0
  9. package/dist/tools/powershell/simple/security/register-new-domain.js +15 -0
  10. package/dist/tools/powershell/simple/security/register-new-domain.js.map +1 -0
  11. package/dist/tools/powershell/simple/security/register-new-role.d.ts +3 -0
  12. package/dist/tools/powershell/simple/security/register-new-role.js +16 -0
  13. package/dist/tools/powershell/simple/security/register-new-role.js.map +1 -0
  14. package/dist/tools/powershell/simple/security/register-protect-item.d.ts +3 -0
  15. package/dist/tools/powershell/simple/security/register-protect-item.js +46 -0
  16. package/dist/tools/powershell/simple/security/register-protect-item.js.map +1 -0
  17. package/dist/tools/powershell/simple/security/register-remove-domain.d.ts +3 -0
  18. package/dist/tools/powershell/simple/security/register-remove-domain.js +16 -0
  19. package/dist/tools/powershell/simple/security/register-remove-domain.js.map +1 -0
  20. package/dist/tools/powershell/simple/security/register-remove-role.d.ts +3 -0
  21. package/dist/tools/powershell/simple/security/register-remove-role.js +16 -0
  22. package/dist/tools/powershell/simple/security/register-remove-role.js.map +1 -0
  23. package/dist/tools/powershell/simple/security/register-security-powershell.js +18 -3
  24. package/dist/tools/powershell/simple/security/register-security-powershell.js.map +1 -1
  25. package/dist/tools/powershell/simple/security/register-unlock-item.d.ts +3 -0
  26. package/dist/tools/powershell/simple/security/register-unlock-item.js +52 -0
  27. package/dist/tools/powershell/simple/security/register-unlock-item.js.map +1 -0
  28. package/dist/tools/powershell/simple/security/register-unprotect-item.d.ts +3 -0
  29. package/dist/tools/powershell/simple/security/register-unprotect-item.js +46 -0
  30. package/dist/tools/powershell/simple/security/register-unprotect-item.js.map +1 -0
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -27,14 +27,27 @@
27
27
  - [x] `security-get-current-user`: returns the current user
28
28
  - [x] `security-get-user-by-identity`: returns a user by name
29
29
  - [x] `security-get-user-by-filter`: returns a user by filter
30
+ - [x] `security-new-domain`: creates a new domain
30
31
  - [x] `security-new-user`: creates a new user
32
+ - [x] `security-new-role`: creates a new role
33
+ - [x] `security-remove-domain`: removes a domain
31
34
  - [x] `security-remove-user`: removes a user
35
+ - [x] `security-remove-role`: removes a role
32
36
  - [x] `security-get-domain`: returns a domains
33
37
  - [x] `security-get-domain-by-name`: returns a domain by name
34
38
  - [x] `security-get-role-by-identity`: returns a role by name
35
39
  - [x] `security-get-role-by-filter`: returns a role by filter
40
+ - [x] `security-get-role-member`: returns members of a role
36
41
  - [x] `security-enable-user`: enables a user
37
42
  - [x] `security-disable-user`: disables a user
43
+ - [x] `security-lock-item-by-id`: locks an item by ID
44
+ - [x] `security-unlock-item-by-id`: unlocks an item by ID
45
+ - [x] `security-lock-item-by-path`: locks an item by path
46
+ - [x] `security-unlock-item-by-path`: unlocks an item by path
47
+ - [x] `security-protect-item-by-id`: protects an item by ID
48
+ - [x] `security-protect-item-by-path`: protects an item by path
49
+ - [x] `security-unprotect-item-by-id`: unprotects an item by ID
50
+ - [x] `security-unprotect-item-by-path`: unprotects an item by path
38
51
  - [ ] Sitecore CLI
39
52
 
40
53
  ## Installation
@@ -47,15 +60,19 @@ Add the following Model Context Protocol server to your Cursor, VS Code, Claud:
47
60
  "command": "npx",
48
61
  "args": ["@antonytm/mcp-sitecore-server@latest"],
49
62
  "env": {
50
- "TRANSPORT": "stdio",
51
- "GRAPHQL_ENDPOINT": "https://xmcloudcm.localhost/sitecore/api/graph/",
52
- "GRAPHQL_SCHEMAS": "edge,master,core",
53
- "GRAPHQL_API_KEY": "{6D3F291E-66A5-4703-887A-D549AF83D859}",
54
- "GRAPHQL_HEADERS": "",
55
- "ITEM_SERVICE_DOMAIN": "sitecore",
56
- "ITEM_SERVICE_USERNAME": "admin",
57
- "ITEM_SERVICE_PASSWORD": "b",
58
- "ITEM_SERVICE_SERVER_URL": "https://xmcloudcm.localhost/"
63
+ "TRANSPORT": "stdio",
64
+ "GRAPHQL_ENDPOINT": "https://xmcloudcm.localhost/sitecore/api/graph/",
65
+ "GRAPHQL_SCHEMAS": "edge,master,core",
66
+ "GRAPHQL_API_KEY": "{6D3F291E-66A5-4703-887A-D549AF83D859}",
67
+ "GRAPHQL_HEADERS": "",
68
+ "ITEM_SERVICE_DOMAIN": "sitecore",
69
+ "ITEM_SERVICE_USERNAME": "admin",
70
+ "ITEM_SERVICE_PASSWORD": "b",
71
+ "ITEM_SERVICE_SERVER_URL": "https://xmcloudcm.localhost/",
72
+ "POWERSHELL_DOMAIN": "sitecore",
73
+ "POWERSHELL_USERNAME": "admin",
74
+ "POWERSHELL_PASSWORD": "b",
75
+ "POWERSHELL_SERVER_URL": "https://xmcloudcm.localhost/",
59
76
  }
60
77
  }
61
78
  ```
@@ -67,10 +84,14 @@ Add the following Model Context Protocol server to your Cursor, VS Code, Claud:
67
84
  - `GRAPHQL_SCHEMAS`: The Sitecore schemas to use for the GraphQL API, comma-separated.
68
85
  - `GRAPHQL_API_KEY`: The API key for the GraphQL endpoint.
69
86
  - `GRAPHQL_HEADERS`: Additional headers to include in the GraphQL requests.
70
- - `ITEM_SERVICE_DOMAIN`: The domain for the Item Service API login. Default is `sitecore`.
71
- - `ITEM_SERVICE_USERNAME`: The username for the Item Service API login.
72
- - `ITEM_SERVICE_PASSWORD`: The password for the Item Service API login.
87
+ - `ITEM_SERVICE_DOMAIN`: The domain for the Item Service API authentication. Default is `sitecore`.
88
+ - `ITEM_SERVICE_USERNAME`: The username for the Item Service API authentication.
89
+ - `ITEM_SERVICE_PASSWORD`: The password for the Item Service API authentication.
73
90
  - `ITEM_SERVICE_SERVER_URL`: The base URL for the Item Service API.
91
+ - `POWERSHELL_DOMAIN`: The domain for the Sitecore PowerShell Remoting API authentication. Default is `sitecore`.
92
+ - `POWERSHELL_USERNAME`: The username for the Sitecore PowerShell Remoting API authentication.
93
+ - `POWERSHELL_PASSWORD`: The password for the Sitecore PowerShell Remoting API authentication.
94
+ - `POWERSHELL_SERVER_URL`: The base URL for the Sitecore PowerShell Remoting API.
74
95
 
75
96
  ## Resources list
76
97
 
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerGetRoleMemberPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerGetRoleMemberPowerShell(server, config) {
5
+ server.tool("security-get-role-member", "Get members of a Sitecore role.", {
6
+ identity: z.string()
7
+ .describe("The identity of the role to get members from (e.g. 'sitecore\\Author')"),
8
+ recurse: z.boolean().optional()
9
+ .describe("If set to true, gets all members recursively (including members of nested roles)"),
10
+ userOnly: z.boolean().optional()
11
+ .describe("If set to true, only gets user members (excluding roles)"),
12
+ roleOnly: z.boolean().optional()
13
+ .describe("If set to true, only gets role members (excluding users)"),
14
+ }, async (params) => {
15
+ const command = `Get-RoleMember`;
16
+ const options = {
17
+ "Identity": params.identity,
18
+ };
19
+ if (params.recurse) {
20
+ options["Recurse"] = "";
21
+ }
22
+ if (params.userOnly) {
23
+ options["UserOnly"] = "";
24
+ }
25
+ if (params.roleOnly) {
26
+ options["RoleOnly"] = "";
27
+ }
28
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
29
+ });
30
+ }
31
+ //# sourceMappingURL=register-get-role-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-get-role-member.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-get-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,iCAAiC,EACjC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,wEAAwE,CAAC;QACvF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,kFAAkF,CAAC;QACjG,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,0DAA0D,CAAC;QACzE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,0DAA0D,CAAC;KAC5E,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,gBAAgB,CAAC;QACjC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAC5B,CAAC;QAED,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,EAAE,CAAC;QAC7B,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 registerLockItemPowerShell(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 registerLockItemPowerShell(server, config) {
5
+ server.tool("security-lock-item-by-path", "Lock a Sitecore item by its path.", {
6
+ path: z.string()
7
+ .describe("The path of the item to lock (e.g. /sitecore/content/Home)"),
8
+ force: z.boolean()
9
+ .optional().describe("If set to true, will force the lock even if the item is locked by another user"),
10
+ passThru: z.boolean().optional()
11
+ .describe("If set to true, passes the processed object back to the pipeline"),
12
+ database: z.string().optional()
13
+ .describe("The database containing the item (defaults to the context database)")
14
+ }, async (params) => {
15
+ const command = `Lock-Item`;
16
+ const options = {
17
+ "Path": params.path,
18
+ };
19
+ if (params.force) {
20
+ options["Force"] = "";
21
+ }
22
+ if (params.passThru) {
23
+ options["PassThru"] = "";
24
+ }
25
+ if (params.database) {
26
+ options["Database"] = params.database;
27
+ }
28
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
29
+ });
30
+ server.tool("security-lock-item-by-id", "Lock a Sitecore item by its ID.", {
31
+ id: z.string()
32
+ .describe("The ID of the item to lock"),
33
+ force: z.boolean().optional()
34
+ .describe("If set to true, will force the lock even if the item is locked by another user"),
35
+ passThru: z.boolean().optional()
36
+ .describe("If set to true, passes the processed object back to the pipeline"),
37
+ database: z.string().optional()
38
+ .describe("The database containing the item (defaults to the context database)")
39
+ }, async (params) => {
40
+ const command = `Lock-Item`;
41
+ const options = {
42
+ "Id": params.id,
43
+ };
44
+ if (params.force) {
45
+ options["Force"] = "";
46
+ }
47
+ if (params.passThru) {
48
+ options["PassThru"] = "";
49
+ }
50
+ if (params.database) {
51
+ options["Database"] = params.database;
52
+ }
53
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
54
+ });
55
+ }
56
+ //# sourceMappingURL=register-lock-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-lock-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-lock-item.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,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,MAAM,CAAC,IAAI,CACP,4BAA4B,EAC5B,mCAAmC,EACnC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,4DAA4D,CAAC;QAC3E,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;aACb,QAAQ,EAAE,CAAC,QAAQ,CAAC,gFAAgF,CAAC;QAC1G,QAAQ,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,WAAW,CAAC;QAC5B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAA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AC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerNewDomainPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerNewDomainPowerShell(server, config) {
5
+ server.tool("security-new-domain", "Creates a new Sitecore domain.", {
6
+ name: z.string().describe("The name of the domain to create"),
7
+ }, async (params) => {
8
+ const command = `New-Domain`;
9
+ const options = {
10
+ "Name": params.name,
11
+ };
12
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
13
+ });
14
+ }
15
+ //# sourceMappingURL=register-new-domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-new-domain.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-new-domain.ts"],"names":[],"mappings":"AAGA,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,2BAA2B,CAAC,MAAiB,EAAE,MAAc;IACzE,MAAM,CAAC,IAAI,CACP,qBAAqB,EACrB,gCAAgC,EAChC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,YAAY,CAAC;QAC7B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,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 registerNewRolePowerShell(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 registerNewRolePowerShell(server, config) {
5
+ server.tool("security-new-role", "Creates a new Sitecore role.", {
6
+ identity: z.string()
7
+ .describe("The identity of the role to create (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
8
+ }, async (params) => {
9
+ const command = `New-Role`;
10
+ const options = {
11
+ "Identity": params.identity,
12
+ };
13
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
14
+ });
15
+ }
16
+ //# sourceMappingURL=register-new-role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-new-role.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-new-role.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,8BAA8B,EAC9B;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,4FAA4F,CAAC;KAC1G,EACL,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,UAAU,CAAC;QAC3B,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"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerProtectItemPowerShell(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 registerProtectItemPowerShell(server, config) {
5
+ server.tool("security-protect-item-by-path", "Protect a Sitecore item by its path.", {
6
+ path: z.string()
7
+ .describe("The path of the item to protect (e.g. /sitecore/content/Home)"),
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 = `Protect-Item`;
14
+ const options = {
15
+ "Path": params.path,
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-protect-item-by-id", "Protect a Sitecore item by its ID.", {
26
+ id: z.string()
27
+ .describe("The ID of the item to protect"),
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 = `Protect-Item`;
34
+ const options = {
35
+ "Id": params.id,
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-protect-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-protect-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-protect-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,K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CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,IAAI,EAAE,MAAM,CAAC,EAAE;SAClB,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"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerRemoveDomainPowerShell(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 registerRemoveDomainPowerShell(server, config) {
5
+ server.tool("security-remove-domain", "Removes a Sitecore domain.", {
6
+ name: z.string()
7
+ .describe("The name of the domain to remove"),
8
+ }, async (params) => {
9
+ const command = `Remove-Domain`;
10
+ const options = {
11
+ "Name": params.name,
12
+ };
13
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
14
+ });
15
+ }
16
+ //# sourceMappingURL=register-remove-domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-remove-domain.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-domain.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,8BAA8B,CAAC,MAAiB,EAAE,MAAc;IAC5E,MAAM,CAAC,IAAI,CACP,wBAAwB,EACxB,4BAA4B,EAC5B;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,kCAAkC,CAAC;KACpD,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,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 registerRemoveRolePowerShell(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 registerRemoveRolePowerShell(server, config) {
5
+ server.tool("security-remove-role", "Removes a Sitecore role.", {
6
+ identity: z.string()
7
+ .describe("The identity of the role to remove (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
8
+ }, async (params) => {
9
+ const command = `Remove-Role`;
10
+ const options = {
11
+ "Identity": params.identity,
12
+ };
13
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
14
+ });
15
+ }
16
+ //# sourceMappingURL=register-remove-role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-remove-role.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-role.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,0BAA0B,EAC1B;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,4FAA4F,CAAC;KAC9G,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"}
@@ -1,6 +1,3 @@
1
- import { z } from "zod";
2
- import { safeMcpResponse } from "../../../../helper.js";
3
- import { register } from "module";
4
1
  import { registerGetUserPowerShell } from "./register-get-user.js";
5
2
  import { registerNewUserPowerShell } from "./register-new-user.js";
6
3
  import { registerRemoveUserPowerShell } from "./register-remove-user.js";
@@ -8,6 +5,15 @@ import { registerDisableUserPowerShell } from "./register-disable-user.js";
8
5
  import { registerEnableUserPowerShell } from "./register-enable-user.js";
9
6
  import { registerGetDomainPowerShell } from "./register-get-domain.js";
10
7
  import { registerGetRolePowerShell } from "./register-get-role.js";
8
+ import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
9
+ import { registerLockItemPowerShell } from "./register-lock-item.js";
10
+ import { registerUnlockItemPowerShell } from "./register-unlock-item.js";
11
+ import { registerProtectItemPowerShell } from "./register-protect-item.js";
12
+ import { registerUnprotectItemPowerShell } from "./register-unprotect-item.js";
13
+ import { registerNewRolePowerShell } from "./register-new-role.js";
14
+ import { registerRemoveRolePowerShell } from "./register-remove-role.js";
15
+ import { registerNewDomainPowerShell } from "./register-new-domain.js";
16
+ import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
11
17
  export function registerSecurityPowerShell(server, config) {
12
18
  registerGetUserPowerShell(server, config);
13
19
  registerNewUserPowerShell(server, config);
@@ -16,5 +22,14 @@ export function registerSecurityPowerShell(server, config) {
16
22
  registerEnableUserPowerShell(server, config);
17
23
  registerGetDomainPowerShell(server, config);
18
24
  registerGetRolePowerShell(server, config);
25
+ registerGetRoleMemberPowerShell(server, config);
26
+ registerLockItemPowerShell(server, config);
27
+ registerUnlockItemPowerShell(server, config);
28
+ registerProtectItemPowerShell(server, config);
29
+ registerUnprotectItemPowerShell(server, config);
30
+ registerNewRolePowerShell(server, config);
31
+ registerRemoveRolePowerShell(server, config);
32
+ registerNewDomainPowerShell(server, config);
33
+ registerRemoveDomainPowerShell(server, config);
19
34
  }
20
35
  //# 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,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,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;AAEnE,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,yBAAyB,CAAC,MAAM,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,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9C,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,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,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAE7E,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,yBAAyB,CAAC,MAAM,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,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,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;AACnD,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 registerUnlockItemPowerShell(server: McpServer, config: Config): void;
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function registerUnlockItemPowerShell(server, config) {
5
+ server.tool("security-unlock-item-by-id", "Unlocks a Sitecore item by its ID.", {
6
+ id: z.string().describe("The ID of the item to unlock"),
7
+ force: z.boolean().optional().describe("When specified the item is unlocked regardless of the owner"),
8
+ passThru: z.boolean().optional().describe("When specified returns the item to the pipeline"),
9
+ database: z.string().optional().describe("The database containing the item"),
10
+ }, async (params) => {
11
+ const command = `Unlock-Item`;
12
+ const options = {
13
+ "ID": params.id,
14
+ };
15
+ if (params.force) {
16
+ options["Force"] = "";
17
+ }
18
+ if (params.passThru) {
19
+ options["PassThru"] = "";
20
+ }
21
+ if (params.database) {
22
+ options["Database"] = params.database;
23
+ }
24
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
25
+ });
26
+ server.tool("security-unlock-item-by-path", "Unlocks a Sitecore item by its path.", {
27
+ path: z.string()
28
+ .describe("The path to the item to unlock"),
29
+ force: z.boolean().optional()
30
+ .describe("When specified the item is unlocked regardless of the owner"),
31
+ passThru: z.boolean().optional()
32
+ .describe("When specified returns the item to the pipeline"),
33
+ database: z.string().optional()
34
+ .describe("The database containing the item"),
35
+ }, async (params) => {
36
+ const command = `Unlock-Item`;
37
+ const options = {
38
+ "Path": params.path,
39
+ };
40
+ if (params.force) {
41
+ options["Force"] = "";
42
+ }
43
+ if (params.passThru) {
44
+ options["PassThru"] = "";
45
+ }
46
+ if (params.database) {
47
+ options["Database"] = params.database;
48
+ }
49
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
50
+ });
51
+ }
52
+ //# sourceMappingURL=register-unlock-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-unlock-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unlock-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,M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C,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aACxB,QAAQ,CAAC,6DAA6D,CAAC;QAC5E,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,iDAAiD,CAAC;QAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,kCAAkC,CAAC;KACpD,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,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"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function registerUnprotectItemPowerShell(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 registerUnprotectItemPowerShell(server, config) {
5
+ server.tool("security-unprotect-item-by-path", "Unprotect a Sitecore item by its path.", {
6
+ path: z.string()
7
+ .describe("The path of the item to unprotect (e.g. /sitecore/content/Home)"),
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 = `Unprotect-Item`;
14
+ const options = {
15
+ "Path": params.path,
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-unprotect-item-by-id", "Unprotect a Sitecore item by its ID.", {
26
+ id: z.string()
27
+ .describe("The ID of the item to unprotect"),
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 = `Unprotect-Item`;
34
+ const options = {
35
+ "Id": params.id,
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-unprotect-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-unprotect-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unprotect-item.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,iCAAiC,EACjC,wCAAwC,EACxC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,iEAAiE,CAAC;QAChF,QAAQ,EAAE,CAAC,CAA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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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antonytm/mcp-sitecore-server",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "A Model Context Protocol server for Sitecore",
5
5
  "files": [
6
6
  "dist",