@iris-mcp/admin 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +248 -0
- package/LICENSE +21 -0
- package/README.md +1030 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -0
- package/dist/prompts/auditSecurityPosture.d.ts +12 -0
- package/dist/prompts/auditSecurityPosture.js +52 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.js +16 -0
- package/dist/prompts/provisionProjectEnvironment.d.ts +11 -0
- package/dist/prompts/provisionProjectEnvironment.js +48 -0
- package/dist/tools/audit.d.ts +42 -0
- package/dist/tools/audit.js +394 -0
- package/dist/tools/database.d.ts +14 -0
- package/dist/tools/database.js +179 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.js +52 -0
- package/dist/tools/ldap.d.ts +33 -0
- package/dist/tools/ldap.js +252 -0
- package/dist/tools/mapping.d.ts +15 -0
- package/dist/tools/mapping.js +175 -0
- package/dist/tools/namespace.d.ts +14 -0
- package/dist/tools/namespace.js +145 -0
- package/dist/tools/oauth.d.ts +17 -0
- package/dist/tools/oauth.js +269 -0
- package/dist/tools/permission.d.ts +13 -0
- package/dist/tools/permission.js +70 -0
- package/dist/tools/presets.d.ts +20 -0
- package/dist/tools/presets.js +84 -0
- package/dist/tools/resource.d.ts +81 -0
- package/dist/tools/resource.js +402 -0
- package/dist/tools/role.d.ts +14 -0
- package/dist/tools/role.js +139 -0
- package/dist/tools/service.d.ts +19 -0
- package/dist/tools/service.js +199 -0
- package/dist/tools/ssl.d.ts +14 -0
- package/dist/tools/ssl.js +201 -0
- package/dist/tools/user.d.ts +20 -0
- package/dist/tools/user.js +326 -0
- package/dist/tools/webapp.d.ts +20 -0
- package/dist/tools/webapp.js +268 -0
- package/dist/tools/x509.d.ts +42 -0
- package/dist/tools/x509.js +224 -0
- package/package.json +58 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role management tools for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for managing IRIS security roles via the custom REST endpoint:
|
|
5
|
+
* - {@link roleManageTool} — Create, modify, or delete a security role
|
|
6
|
+
* - {@link roleListTool} — List all security roles
|
|
7
|
+
*
|
|
8
|
+
* All tools call the custom REST service at `/api/executemcp/v2/security/role`.
|
|
9
|
+
* Operations execute in %SYS namespace on the IRIS server.
|
|
10
|
+
*/
|
|
11
|
+
import { type ToolDefinition } from "@iris-mcp/shared";
|
|
12
|
+
export declare const roleManageTool: ToolDefinition;
|
|
13
|
+
export declare const roleListTool: ToolDefinition;
|
|
14
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role management tools for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for managing IRIS security roles via the custom REST endpoint:
|
|
5
|
+
* - {@link roleManageTool} — Create, modify, or delete a security role
|
|
6
|
+
* - {@link roleListTool} — List all security roles
|
|
7
|
+
*
|
|
8
|
+
* All tools call the custom REST service at `/api/executemcp/v2/security/role`.
|
|
9
|
+
* Operations execute in %SYS namespace on the IRIS server.
|
|
10
|
+
*/
|
|
11
|
+
import { IrisApiError } from "@iris-mcp/shared";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
/** Base URL for the custom ExecuteMCPv2 REST service. */
|
|
14
|
+
const BASE_URL = "/api/executemcp/v2";
|
|
15
|
+
// ── iris_role_manage ───────────────────────────────────────────
|
|
16
|
+
export const roleManageTool = {
|
|
17
|
+
name: "iris_role_manage",
|
|
18
|
+
title: "Manage Role",
|
|
19
|
+
description: "Create, modify, or delete an IRIS security role. For 'create', name is required. " +
|
|
20
|
+
"For 'modify', only provided fields are updated. For 'delete', only the name is needed. " +
|
|
21
|
+
"Resources are specified as comma-separated resource:permission pairs (e.g., 'MyDB:RW,MyApp:U').",
|
|
22
|
+
inputSchema: z.object({
|
|
23
|
+
action: z
|
|
24
|
+
.enum(["create", "modify", "delete"])
|
|
25
|
+
.describe("Action to perform on the role"),
|
|
26
|
+
name: z
|
|
27
|
+
.string()
|
|
28
|
+
.describe("Role name (e.g., 'MyAppRole', '%Developer')"),
|
|
29
|
+
description: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Description of the role"),
|
|
33
|
+
resources: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("Comma-separated list of resource:permission pairs (e.g., 'MyDB:RW,MyApp:U')"),
|
|
37
|
+
grantedRoles: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Comma-separated list of roles granted to this role (e.g., '%Developer,%Operator')"),
|
|
41
|
+
}),
|
|
42
|
+
annotations: {
|
|
43
|
+
destructiveHint: true,
|
|
44
|
+
readOnlyHint: false,
|
|
45
|
+
idempotentHint: false,
|
|
46
|
+
openWorldHint: false,
|
|
47
|
+
},
|
|
48
|
+
scope: "SYS",
|
|
49
|
+
handler: async (args, ctx) => {
|
|
50
|
+
const { action, name, description, resources, grantedRoles } = args;
|
|
51
|
+
const body = { action, name };
|
|
52
|
+
if (description !== undefined)
|
|
53
|
+
body.description = description;
|
|
54
|
+
if (resources !== undefined)
|
|
55
|
+
body.resources = resources;
|
|
56
|
+
if (grantedRoles !== undefined)
|
|
57
|
+
body.grantedRoles = grantedRoles;
|
|
58
|
+
const path = `${BASE_URL}/security/role`;
|
|
59
|
+
try {
|
|
60
|
+
const response = await ctx.http.post(path, body);
|
|
61
|
+
const result = response.result;
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
65
|
+
],
|
|
66
|
+
structuredContent: result,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (error instanceof IrisApiError) {
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: `Error managing role '${name}': ${error.message}`,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
isError: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
// ── iris_role_list ─────────────────────────────────────────────
|
|
86
|
+
export const roleListTool = {
|
|
87
|
+
name: "iris_role_list",
|
|
88
|
+
title: "List Roles",
|
|
89
|
+
description: "List all IRIS security roles with their description, resources, and granted roles.",
|
|
90
|
+
inputSchema: z.object({
|
|
91
|
+
cursor: z
|
|
92
|
+
.string()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("Pagination cursor from a previous response's nextCursor field"),
|
|
95
|
+
}),
|
|
96
|
+
annotations: {
|
|
97
|
+
readOnlyHint: true,
|
|
98
|
+
destructiveHint: false,
|
|
99
|
+
idempotentHint: true,
|
|
100
|
+
openWorldHint: false,
|
|
101
|
+
},
|
|
102
|
+
scope: "SYS",
|
|
103
|
+
handler: async (args, ctx) => {
|
|
104
|
+
const { cursor } = args;
|
|
105
|
+
const path = `${BASE_URL}/security/role`;
|
|
106
|
+
try {
|
|
107
|
+
const response = await ctx.http.get(path);
|
|
108
|
+
const rawResult = response.result;
|
|
109
|
+
const allRoles = Array.isArray(rawResult) ? rawResult : [];
|
|
110
|
+
const { page, nextCursor } = ctx.paginate(allRoles, cursor);
|
|
111
|
+
const result = {
|
|
112
|
+
roles: page,
|
|
113
|
+
count: page.length,
|
|
114
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
content: [
|
|
118
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
119
|
+
],
|
|
120
|
+
structuredContent: result,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
if (error instanceof IrisApiError) {
|
|
125
|
+
return {
|
|
126
|
+
content: [
|
|
127
|
+
{
|
|
128
|
+
type: "text",
|
|
129
|
+
text: `Error listing roles: ${error.message}`,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
isError: true,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IRIS service configuration tool for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides {@link serviceManageTool} — a single multi-action tool to list,
|
|
5
|
+
* inspect, and toggle IRIS services and their authentication settings via the
|
|
6
|
+
* custom REST endpoint `/api/executemcp/v2/security/service`. Operations execute
|
|
7
|
+
* in the `%SYS` namespace on the IRIS server (backed by `Security.Services`).
|
|
8
|
+
*
|
|
9
|
+
* **First governed write tool in the suite (Epic 15, Story 15.1).** The `mutates`
|
|
10
|
+
* classification map below is the first real consumer of the Story 15.0
|
|
11
|
+
* `mutates`/default-seed machinery: `list`/`get` are reads (enabled by default),
|
|
12
|
+
* while `enable`/`disable`/`set` are writes that the governance layer
|
|
13
|
+
* default-DISABLES until an operator opts in via `IRIS_GOVERNANCE`. The tool does
|
|
14
|
+
* NOT declare a `server` field — the framework injects it (architecture
|
|
15
|
+
* decision D2).
|
|
16
|
+
*/
|
|
17
|
+
import { type ToolDefinition } from "@iris-mcp/shared";
|
|
18
|
+
export declare const serviceManageTool: ToolDefinition;
|
|
19
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IRIS service configuration tool for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides {@link serviceManageTool} — a single multi-action tool to list,
|
|
5
|
+
* inspect, and toggle IRIS services and their authentication settings via the
|
|
6
|
+
* custom REST endpoint `/api/executemcp/v2/security/service`. Operations execute
|
|
7
|
+
* in the `%SYS` namespace on the IRIS server (backed by `Security.Services`).
|
|
8
|
+
*
|
|
9
|
+
* **First governed write tool in the suite (Epic 15, Story 15.1).** The `mutates`
|
|
10
|
+
* classification map below is the first real consumer of the Story 15.0
|
|
11
|
+
* `mutates`/default-seed machinery: `list`/`get` are reads (enabled by default),
|
|
12
|
+
* while `enable`/`disable`/`set` are writes that the governance layer
|
|
13
|
+
* default-DISABLES until an operator opts in via `IRIS_GOVERNANCE`. The tool does
|
|
14
|
+
* NOT declare a `server` field — the framework injects it (architecture
|
|
15
|
+
* decision D2).
|
|
16
|
+
*/
|
|
17
|
+
import { IrisApiError } from "@iris-mcp/shared";
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
/** Base URL for the custom ExecuteMCPv2 REST service. */
|
|
20
|
+
const BASE_URL = "/api/executemcp/v2";
|
|
21
|
+
// ── iris_service_manage ────────────────────────────────────────
|
|
22
|
+
export const serviceManageTool = {
|
|
23
|
+
name: "iris_service_manage",
|
|
24
|
+
title: "Manage IRIS Service",
|
|
25
|
+
description: "List, inspect, and toggle IRIS services and their authentication settings " +
|
|
26
|
+
"(backed by Security.Services in %SYS). Actions: 'list' (all services), " +
|
|
27
|
+
"'get' (one service's properties — requires name), 'enable'/'disable' (toggle " +
|
|
28
|
+
"a service on/off — requires name), 'set' (update auth settings via the " +
|
|
29
|
+
"'settings' object — requires name). Use this to harden an instance, e.g. " +
|
|
30
|
+
"disable %Service_Telnet. The mutating actions (enable/disable/set) are " +
|
|
31
|
+
"opt-in under tool governance and are disabled by default until enabled via " +
|
|
32
|
+
"IRIS_GOVERNANCE. Settings fields: 'enabled' (boolean), 'autheEnabled' " +
|
|
33
|
+
"(integer auth-method bitmask), 'description', 'clientSystems' (allowed IP " +
|
|
34
|
+
"list). Service names start with '%Service_' (e.g. %Service_SQL, " +
|
|
35
|
+
"%Service_CallIn, %Service_Telnet).",
|
|
36
|
+
inputSchema: z.object({
|
|
37
|
+
action: z
|
|
38
|
+
.enum(["list", "get", "enable", "disable", "set"])
|
|
39
|
+
.describe("Action to perform on the service(s)"),
|
|
40
|
+
name: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Service name (required for get/enable/disable/set), e.g. '%Service_SQL'"),
|
|
44
|
+
settings: z
|
|
45
|
+
.object({
|
|
46
|
+
enabled: z
|
|
47
|
+
.boolean()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Whether the service is enabled"),
|
|
50
|
+
autheEnabled: z
|
|
51
|
+
.number()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Authentication methods bitmask (Security.Services.AutheEnabled)"),
|
|
54
|
+
description: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Full description of the service"),
|
|
58
|
+
clientSystems: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Allowed client IP connections (semicolon-separated list)"),
|
|
62
|
+
})
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Settings to apply for the 'set' action"),
|
|
65
|
+
namespace: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Namespace override (services are %SYS-scoped; usually omit)"),
|
|
69
|
+
cursor: z
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Pagination cursor from a previous 'list' response's nextCursor field"),
|
|
73
|
+
}),
|
|
74
|
+
annotations: {
|
|
75
|
+
// The tool can mutate (enable/disable/set). MCP annotations are tool-scoped;
|
|
76
|
+
// the per-action read/write distinction is realized through `mutates` below.
|
|
77
|
+
readOnlyHint: false,
|
|
78
|
+
destructiveHint: true,
|
|
79
|
+
idempotentHint: false,
|
|
80
|
+
openWorldHint: false,
|
|
81
|
+
},
|
|
82
|
+
scope: "SYS",
|
|
83
|
+
// Governance classification (Story 15.0 strict contract): EVERY action key is
|
|
84
|
+
// classified because none are in the frozen Epic-14 baseline. Reads default
|
|
85
|
+
// enabled; writes default DISABLED (opt-in via IRIS_GOVERNANCE).
|
|
86
|
+
mutates: {
|
|
87
|
+
list: "read",
|
|
88
|
+
get: "read",
|
|
89
|
+
enable: "write",
|
|
90
|
+
disable: "write",
|
|
91
|
+
set: "write",
|
|
92
|
+
},
|
|
93
|
+
handler: async (args, ctx) => {
|
|
94
|
+
const { action, name, settings, cursor } = args;
|
|
95
|
+
const path = `${BASE_URL}/security/service`;
|
|
96
|
+
try {
|
|
97
|
+
if (action === "list") {
|
|
98
|
+
const response = await ctx.http.get(path);
|
|
99
|
+
const rawResult = response.result;
|
|
100
|
+
const allServices = Array.isArray(rawResult) ? rawResult : [];
|
|
101
|
+
const { page, nextCursor } = ctx.paginate(allServices, cursor);
|
|
102
|
+
const result = {
|
|
103
|
+
services: page,
|
|
104
|
+
count: page.length,
|
|
105
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
content: [
|
|
109
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
110
|
+
],
|
|
111
|
+
structuredContent: result,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (action === "get") {
|
|
115
|
+
// `name` is required for get: the server's GET endpoint treats an absent
|
|
116
|
+
// ?name= as "list all", so an empty name would silently return the whole
|
|
117
|
+
// service inventory under a `get` action (wrong result shape). Reject it
|
|
118
|
+
// here so the caller gets a clear error instead of a surprising list.
|
|
119
|
+
if (name === undefined || name === "") {
|
|
120
|
+
return {
|
|
121
|
+
content: [
|
|
122
|
+
{
|
|
123
|
+
type: "text",
|
|
124
|
+
text: "Error: 'name' is required for the 'get' action (e.g. '%Service_SQL').",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
isError: true,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// GET with the service name as a query parameter; the handler returns the
|
|
131
|
+
// service's properties.
|
|
132
|
+
const getPath = `${path}?name=${encodeURIComponent(name)}`;
|
|
133
|
+
const response = await ctx.http.get(getPath);
|
|
134
|
+
const result = response.result;
|
|
135
|
+
return {
|
|
136
|
+
content: [
|
|
137
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
138
|
+
],
|
|
139
|
+
structuredContent: result,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// enable / disable / set — POST a mutating request body.
|
|
143
|
+
// `name` is required for every write action.
|
|
144
|
+
if (name === undefined || name === "") {
|
|
145
|
+
return {
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
text: `Error: 'name' is required for the '${action}' action (e.g. '%Service_SQL').`,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
isError: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// `set` must apply at least one field; an empty settings object would issue
|
|
156
|
+
// a no-op Modify that the server reports as success — reject it up front so
|
|
157
|
+
// the caller is not told a do-nothing call succeeded.
|
|
158
|
+
if (action === "set" &&
|
|
159
|
+
(settings === undefined || Object.keys(settings).length === 0)) {
|
|
160
|
+
return {
|
|
161
|
+
content: [
|
|
162
|
+
{
|
|
163
|
+
type: "text",
|
|
164
|
+
text: "Error: the 'set' action requires a non-empty 'settings' object (one or more of: enabled, autheEnabled, description, clientSystems).",
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
isError: true,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const body = { action, name };
|
|
171
|
+
if (action === "set" && settings !== undefined)
|
|
172
|
+
body.settings = settings;
|
|
173
|
+
const response = await ctx.http.post(path, body);
|
|
174
|
+
const result = response.result;
|
|
175
|
+
return {
|
|
176
|
+
content: [
|
|
177
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
178
|
+
],
|
|
179
|
+
structuredContent: result,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (error instanceof IrisApiError) {
|
|
184
|
+
const label = name ? `service '${name}'` : "services";
|
|
185
|
+
return {
|
|
186
|
+
content: [
|
|
187
|
+
{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: `Error performing '${action}' on ${label}: ${error.message}`,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
isError: true,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSL/TLS configuration management tools for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for managing IRIS SSL/TLS configurations via the custom REST endpoint:
|
|
5
|
+
* - {@link sslManageTool} — Create, modify, or delete an SSL/TLS configuration
|
|
6
|
+
* - {@link sslListTool} — List all SSL/TLS configurations
|
|
7
|
+
*
|
|
8
|
+
* All tools call the custom REST service at `/api/executemcp/v2/security/ssl`.
|
|
9
|
+
* Operations execute in %SYS namespace on the IRIS server.
|
|
10
|
+
*/
|
|
11
|
+
import { type ToolDefinition } from "@iris-mcp/shared";
|
|
12
|
+
export declare const sslManageTool: ToolDefinition;
|
|
13
|
+
export declare const sslListTool: ToolDefinition;
|
|
14
|
+
//# sourceMappingURL=ssl.d.ts.map
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSL/TLS configuration management tools for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for managing IRIS SSL/TLS configurations via the custom REST endpoint:
|
|
5
|
+
* - {@link sslManageTool} — Create, modify, or delete an SSL/TLS configuration
|
|
6
|
+
* - {@link sslListTool} — List all SSL/TLS configurations
|
|
7
|
+
*
|
|
8
|
+
* All tools call the custom REST service at `/api/executemcp/v2/security/ssl`.
|
|
9
|
+
* Operations execute in %SYS namespace on the IRIS server.
|
|
10
|
+
*/
|
|
11
|
+
import { IrisApiError } from "@iris-mcp/shared";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
/** Base URL for the custom ExecuteMCPv2 REST service. */
|
|
14
|
+
const BASE_URL = "/api/executemcp/v2";
|
|
15
|
+
// ── iris_ssl_manage ─────────────────────────────────────────────
|
|
16
|
+
export const sslManageTool = {
|
|
17
|
+
name: "iris_ssl_manage",
|
|
18
|
+
title: "Manage SSL/TLS Configuration",
|
|
19
|
+
description: "Create, modify, or delete an IRIS SSL/TLS configuration. For 'create', " +
|
|
20
|
+
"name is required. For 'modify', only provided fields are updated. " +
|
|
21
|
+
"For 'delete', only the name is needed.",
|
|
22
|
+
inputSchema: z.object({
|
|
23
|
+
action: z
|
|
24
|
+
.enum(["create", "modify", "delete"])
|
|
25
|
+
.describe("Action to perform on the SSL/TLS configuration"),
|
|
26
|
+
name: z
|
|
27
|
+
.string()
|
|
28
|
+
.max(64)
|
|
29
|
+
.describe("SSL/TLS configuration name (case-sensitive, max 64 chars)"),
|
|
30
|
+
description: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Description of the SSL/TLS configuration"),
|
|
34
|
+
certFile: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Path to the certificate file on the IRIS server"),
|
|
38
|
+
keyFile: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Path to the private key file on the IRIS server"),
|
|
42
|
+
caFile: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Path to the CA certificate file on the IRIS server"),
|
|
46
|
+
caPath: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Path to the CA certificate directory on the IRIS server"),
|
|
50
|
+
cipherList: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Allowed cipher list for TLS connections"),
|
|
54
|
+
tlsMinVersion: z
|
|
55
|
+
.number()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Minimum TLS version bit (4=TLS1.0, 8=TLS1.1, 16=TLS1.2, 32=TLS1.3)"),
|
|
58
|
+
tlsMaxVersion: z
|
|
59
|
+
.number()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Maximum TLS version bit (4=TLS1.0, 8=TLS1.1, 16=TLS1.2, 32=TLS1.3)"),
|
|
62
|
+
verifyPeer: z
|
|
63
|
+
.number()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Peer verification mode: 0=none, 1=require"),
|
|
66
|
+
verifyDepth: z
|
|
67
|
+
.number()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Certificate chain verification depth"),
|
|
70
|
+
type: z
|
|
71
|
+
.number()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Configuration type: 0=client, 1=server"),
|
|
74
|
+
enabled: z
|
|
75
|
+
.union([z.boolean(), z.number()])
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Whether the SSL/TLS configuration is enabled (1/true or 0/false)"),
|
|
78
|
+
}),
|
|
79
|
+
annotations: {
|
|
80
|
+
destructiveHint: true,
|
|
81
|
+
readOnlyHint: false,
|
|
82
|
+
idempotentHint: false,
|
|
83
|
+
openWorldHint: false,
|
|
84
|
+
},
|
|
85
|
+
scope: "SYS",
|
|
86
|
+
handler: async (args, ctx) => {
|
|
87
|
+
const { action, name, description, certFile, keyFile, caFile, caPath, cipherList, tlsMinVersion, tlsMaxVersion, verifyPeer, verifyDepth, type, enabled, } = args;
|
|
88
|
+
const body = { action, name };
|
|
89
|
+
if (description !== undefined)
|
|
90
|
+
body.description = description;
|
|
91
|
+
if (certFile !== undefined)
|
|
92
|
+
body.certFile = certFile;
|
|
93
|
+
if (keyFile !== undefined)
|
|
94
|
+
body.keyFile = keyFile;
|
|
95
|
+
if (caFile !== undefined)
|
|
96
|
+
body.caFile = caFile;
|
|
97
|
+
if (caPath !== undefined)
|
|
98
|
+
body.caPath = caPath;
|
|
99
|
+
if (cipherList !== undefined)
|
|
100
|
+
body.cipherList = cipherList;
|
|
101
|
+
// Bug #6 (pre-release BREAKING, paired with Story 11.2 server-side break):
|
|
102
|
+
// the deprecated `protocols` bitmask is replaced with separate
|
|
103
|
+
// `tlsMinVersion` + `tlsMaxVersion` %Integer fields. Server rejects
|
|
104
|
+
// `protocols` now — no compatibility shim.
|
|
105
|
+
if (tlsMinVersion !== undefined)
|
|
106
|
+
body.tlsMinVersion = tlsMinVersion;
|
|
107
|
+
if (tlsMaxVersion !== undefined)
|
|
108
|
+
body.tlsMaxVersion = tlsMaxVersion;
|
|
109
|
+
if (verifyPeer !== undefined)
|
|
110
|
+
body.verifyPeer = verifyPeer;
|
|
111
|
+
if (verifyDepth !== undefined)
|
|
112
|
+
body.verifyDepth = verifyDepth;
|
|
113
|
+
if (type !== undefined)
|
|
114
|
+
body.type = type;
|
|
115
|
+
if (enabled !== undefined)
|
|
116
|
+
body.enabled = enabled ? 1 : 0;
|
|
117
|
+
const path = `${BASE_URL}/security/ssl`;
|
|
118
|
+
try {
|
|
119
|
+
const response = await ctx.http.post(path, body);
|
|
120
|
+
const result = response.result;
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
124
|
+
],
|
|
125
|
+
structuredContent: result,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (error instanceof IrisApiError) {
|
|
130
|
+
return {
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: "text",
|
|
134
|
+
text: `Error managing SSL/TLS configuration '${name}': ${error.message}`,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
isError: true,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
// ── iris_ssl_list ──────────────────────────────────────────────
|
|
145
|
+
export const sslListTool = {
|
|
146
|
+
name: "iris_ssl_list",
|
|
147
|
+
title: "List SSL/TLS Configurations",
|
|
148
|
+
description: "List all IRIS SSL/TLS configurations. Returns configuration name, " +
|
|
149
|
+
"description, certificate paths, TLS min/max version bits " +
|
|
150
|
+
"(tlsMinVersion, tlsMaxVersion; 4=TLS1.0, 8=TLS1.1, 16=TLS1.2, 32=TLS1.3), " +
|
|
151
|
+
"verification settings, type (client/server), and enabled status.",
|
|
152
|
+
inputSchema: z.object({
|
|
153
|
+
cursor: z
|
|
154
|
+
.string()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe("Pagination cursor from a previous response's nextCursor field"),
|
|
157
|
+
}),
|
|
158
|
+
annotations: {
|
|
159
|
+
readOnlyHint: true,
|
|
160
|
+
destructiveHint: false,
|
|
161
|
+
idempotentHint: true,
|
|
162
|
+
openWorldHint: false,
|
|
163
|
+
},
|
|
164
|
+
scope: "SYS",
|
|
165
|
+
handler: async (args, ctx) => {
|
|
166
|
+
const { cursor } = args;
|
|
167
|
+
const path = `${BASE_URL}/security/ssl`;
|
|
168
|
+
try {
|
|
169
|
+
const response = await ctx.http.get(path);
|
|
170
|
+
const rawResult = response.result;
|
|
171
|
+
const allConfigs = Array.isArray(rawResult) ? rawResult : [];
|
|
172
|
+
const { page, nextCursor } = ctx.paginate(allConfigs, cursor);
|
|
173
|
+
const result = {
|
|
174
|
+
sslConfigs: page,
|
|
175
|
+
count: page.length,
|
|
176
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
177
|
+
};
|
|
178
|
+
return {
|
|
179
|
+
content: [
|
|
180
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
181
|
+
],
|
|
182
|
+
structuredContent: result,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (error instanceof IrisApiError) {
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{
|
|
190
|
+
type: "text",
|
|
191
|
+
text: `Error listing SSL/TLS configurations: ${error.message}`,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
isError: true,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=ssl.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User and password management tools for the IRIS Administration MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides four tools for managing IRIS user accounts via the custom REST endpoint:
|
|
5
|
+
* - {@link userManageTool} — Create, modify, or delete a user account
|
|
6
|
+
* - {@link userGetTool} — Get a single user or list all users
|
|
7
|
+
* - {@link userRolesTool} — Add or remove roles from a user
|
|
8
|
+
* - {@link userPasswordTool} — Change or validate a password
|
|
9
|
+
*
|
|
10
|
+
* All tools call the custom REST service at `/api/executemcp/v2/security/user`.
|
|
11
|
+
* Operations execute in %SYS namespace on the IRIS server.
|
|
12
|
+
*
|
|
13
|
+
* CRITICAL: Password values are never included in log output or error messages (NFR6).
|
|
14
|
+
*/
|
|
15
|
+
import { type ToolDefinition } from "@iris-mcp/shared";
|
|
16
|
+
export declare const userManageTool: ToolDefinition;
|
|
17
|
+
export declare const userGetTool: ToolDefinition;
|
|
18
|
+
export declare const userRolesTool: ToolDefinition;
|
|
19
|
+
export declare const userPasswordTool: ToolDefinition;
|
|
20
|
+
//# sourceMappingURL=user.d.ts.map
|