@nimbus-dev/connectors 0.2.2 → 0.2.4
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 +5 -3
- package/connectors/apple/src/server.ts +5 -1
- package/connectors/athena/src/tools.ts +12 -10
- package/connectors/aws/src/server.ts +5 -1
- package/connectors/aws/src/tools.ts +9 -7
- package/connectors/azure/src/server.ts +5 -1
- package/connectors/azure/src/tools.ts +10 -9
- package/connectors/bitbucket/src/server.ts +5 -1
- package/connectors/circleci/src/server.ts +5 -1
- package/connectors/cloud-logging/src/tools.ts +5 -8
- package/connectors/cloudwatch/src/tools.ts +6 -5
- package/connectors/confluence/src/server.ts +5 -1
- package/connectors/fastmail/src/server.ts +5 -1
- package/connectors/gcp/src/server.ts +5 -1
- package/connectors/gcp/src/tools.ts +11 -11
- package/connectors/github/src/server.ts +2 -0
- package/connectors/github-actions/src/server.ts +5 -1
- package/connectors/gitlab/src/server.ts +5 -1
- package/connectors/gmail/src/server.ts +5 -1
- package/connectors/google-drive/src/server.ts +5 -1
- package/connectors/iac/src/server.ts +5 -1
- package/connectors/iac/src/tools.ts +83 -25
- package/connectors/imap/src/server.ts +5 -1
- package/connectors/jenkins/src/server.ts +5 -1
- package/connectors/jira/src/server.ts +5 -1
- package/connectors/kubernetes/src/server.ts +5 -1
- package/connectors/kubernetes/src/tools.ts +9 -8
- package/connectors/linear/src/server.ts +5 -1
- package/connectors/notion/src/server.ts +5 -1
- package/connectors/obsidian/src/server.ts +5 -1
- package/connectors/onedrive/src/server.ts +5 -1
- package/connectors/outlook/src/server.ts +5 -1
- package/connectors/pagerduty/src/server.ts +5 -1
- package/connectors/protonmail/src/server.ts +5 -1
- package/connectors/sagemaker/src/tools.ts +5 -5
- package/connectors/slack/src/server.ts +5 -1
- package/connectors/teams/src/server.ts +5 -1
- package/package.json +1 -1
- package/shared/audit-chain.ts +588 -28
- package/shared/cli-json-kit.ts +35 -6
- package/shared/consent-kit.ts +115 -38
- package/shared/nimbus-spawn.ts +114 -27
- package/shared/run-read-only-mcp-connector.ts +7 -1
- package/shared/safe-cli-arg.ts +119 -17
- package/shared/windows-batch-args.ts +274 -0
- package/shared/write-budget.ts +100 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
1
4
|
import { z } from "zod";
|
|
5
|
+
import { awsCliArg, cliArg } from "../../../shared/cli-json-kit.ts";
|
|
2
6
|
import type { ConsentServer } from "../../../shared/consent-kit.ts";
|
|
3
7
|
import { createWriteToolRegistrar } from "../../../shared/consent-kit.ts";
|
|
4
8
|
import {
|
|
@@ -8,6 +12,49 @@ import {
|
|
|
8
12
|
} from "../../../shared/mcp-tool-kit.ts";
|
|
9
13
|
import { runCliOkThrowing } from "../../../shared/run-cli-json.ts";
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* The most a template may be when it is deployed without an S3 bucket, which this tool does not
|
|
17
|
+
* take: `aws cloudformation deploy` refuses a larger one itself, and only after the prompt.
|
|
18
|
+
*/
|
|
19
|
+
const TEMPLATE_MAX_BYTES = 51_200;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A CloudFormation template. It reaches the AWS CLI as a file, never as an argument (see
|
|
23
|
+
* {@link withTemplateFile}), so none of the argument rules apply to it: a YAML template may well
|
|
24
|
+
* start with `---`. Its size is refused here, in the schema, because no consent can lift it: a
|
|
25
|
+
* larger template would be put to the human, spend a unit of write budget, and then fail. The
|
|
26
|
+
* character bound is the one a client is shown; no string over it can be within the byte bound.
|
|
27
|
+
*/
|
|
28
|
+
const templateDocument = z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(TEMPLATE_MAX_BYTES)
|
|
32
|
+
.refine((t) => new TextEncoder().encode(t).length <= TEMPLATE_MAX_BYTES, {
|
|
33
|
+
message: `must be at most ${String(TEMPLATE_MAX_BYTES)} bytes as UTF-8, the most aws cloudformation deploy takes without an S3 bucket`,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Run `body` with `template` written to a file of its own, removed afterwards however `body` ends.
|
|
38
|
+
*
|
|
39
|
+
* `aws cloudformation deploy` takes a template only as `--template-file`, and passing one as an
|
|
40
|
+
* argument would not work anyway: a template can run past the 32,767 characters a Windows command
|
|
41
|
+
* line holds, and an `aws` that is a batch file, as a pip-installed v1 is, has cmd.exe parse every
|
|
42
|
+
* quote in it.
|
|
43
|
+
*/
|
|
44
|
+
async function withTemplateFile<T>(
|
|
45
|
+
template: string,
|
|
46
|
+
body: (path: string) => Promise<T>,
|
|
47
|
+
): Promise<T> {
|
|
48
|
+
const dir = await mkdtemp(join(tmpdir(), "nimbus-cfn-"));
|
|
49
|
+
try {
|
|
50
|
+
const path = join(dir, "template");
|
|
51
|
+
await writeFile(path, template, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
52
|
+
return await body(path);
|
|
53
|
+
} finally {
|
|
54
|
+
await rm(dir, { recursive: true, force: true });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
11
58
|
/** Tool names exposed by this connector — for contract/introspection tests. */
|
|
12
59
|
export const IAC_TOOL_NAMES = [
|
|
13
60
|
"iac_terraform_plan",
|
|
@@ -39,11 +86,14 @@ export function registerIacTools(
|
|
|
39
86
|
reg(
|
|
40
87
|
"iac_terraform_plan",
|
|
41
88
|
"Run terraform plan in a directory.",
|
|
42
|
-
z.object({ workingDirectory:
|
|
89
|
+
z.object({ workingDirectory: cliArg }),
|
|
43
90
|
async (p) => {
|
|
44
|
-
await runCliOkThrowing(
|
|
45
|
-
|
|
46
|
-
|
|
91
|
+
await runCliOkThrowing(
|
|
92
|
+
["terraform", `-chdir=${p.workingDirectory}`, "plan", "-input=false"],
|
|
93
|
+
{
|
|
94
|
+
...processEnv,
|
|
95
|
+
},
|
|
96
|
+
);
|
|
47
97
|
return jsonResult({ ok: true });
|
|
48
98
|
},
|
|
49
99
|
);
|
|
@@ -56,10 +106,10 @@ export function registerIacTools(
|
|
|
56
106
|
scopeTargetOf: (p) => ({ kind: "dir", value: p.workingDirectory }),
|
|
57
107
|
},
|
|
58
108
|
"Run terraform apply.",
|
|
59
|
-
z.object({ workingDirectory:
|
|
109
|
+
z.object({ workingDirectory: cliArg }),
|
|
60
110
|
async (p) => {
|
|
61
111
|
await runCliOkThrowing(
|
|
62
|
-
["terraform",
|
|
112
|
+
["terraform", `-chdir=${p.workingDirectory}`, "apply", "-auto-approve", "-input=false"],
|
|
63
113
|
{ ...processEnv },
|
|
64
114
|
);
|
|
65
115
|
return jsonResult({ ok: true });
|
|
@@ -78,10 +128,10 @@ export function registerIacTools(
|
|
|
78
128
|
scopeTargetOf: (p) => ({ kind: "dir", value: p.workingDirectory }),
|
|
79
129
|
},
|
|
80
130
|
"Run terraform destroy.",
|
|
81
|
-
z.object({ workingDirectory:
|
|
131
|
+
z.object({ workingDirectory: cliArg }),
|
|
82
132
|
async (p) => {
|
|
83
133
|
await runCliOkThrowing(
|
|
84
|
-
["terraform",
|
|
134
|
+
["terraform", `-chdir=${p.workingDirectory}`, "destroy", "-auto-approve", "-input=false"],
|
|
85
135
|
{ ...processEnv },
|
|
86
136
|
);
|
|
87
137
|
return jsonResult({ ok: true });
|
|
@@ -97,23 +147,31 @@ export function registerIacTools(
|
|
|
97
147
|
},
|
|
98
148
|
"Deploy a CloudFormation stack via AWS CLI.",
|
|
99
149
|
z.object({
|
|
100
|
-
stackName:
|
|
101
|
-
templateBody:
|
|
150
|
+
stackName: awsCliArg,
|
|
151
|
+
templateBody: templateDocument,
|
|
102
152
|
}),
|
|
103
153
|
async (p) => {
|
|
104
|
-
await
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
await withTemplateFile(p.templateBody, (templateFile) =>
|
|
155
|
+
runCliOkThrowing(
|
|
156
|
+
[
|
|
157
|
+
"aws",
|
|
158
|
+
"cloudformation",
|
|
159
|
+
"deploy",
|
|
160
|
+
"--stack-name",
|
|
161
|
+
p.stackName,
|
|
162
|
+
"--template-file",
|
|
163
|
+
templateFile,
|
|
164
|
+
"--capabilities",
|
|
165
|
+
"CAPABILITY_IAM",
|
|
166
|
+
// A deploy of a template that changes nothing has done what was asked, not failed.
|
|
167
|
+
"--no-fail-on-empty-changeset",
|
|
168
|
+
],
|
|
169
|
+
// The file is UTF-8. Left to itself the CLI reads it in the locale's encoding, and on a
|
|
170
|
+
// Windows machine using cp1252 a template holding "Á" fails to decode while one holding
|
|
171
|
+
// "é" deploys as "é". AWS CLI v2 reads AWS_CLI_FILE_ENCODING and ignores PYTHONUTF8; v1,
|
|
172
|
+
// plain Python, reads PYTHONUTF8 and ignores the other. Both are set.
|
|
173
|
+
{ ...processEnv, AWS_CLI_FILE_ENCODING: "UTF-8", PYTHONUTF8: "1" },
|
|
174
|
+
),
|
|
117
175
|
);
|
|
118
176
|
return jsonResult({ ok: true });
|
|
119
177
|
},
|
|
@@ -122,7 +180,7 @@ export function registerIacTools(
|
|
|
122
180
|
reg(
|
|
123
181
|
"iac_pulumi_preview",
|
|
124
182
|
"Run pulumi preview in a stack directory.",
|
|
125
|
-
z.object({ workingDirectory:
|
|
183
|
+
z.object({ workingDirectory: cliArg }),
|
|
126
184
|
async (p) => {
|
|
127
185
|
await runCliOkThrowing(
|
|
128
186
|
["pulumi", "preview", "--cwd", p.workingDirectory, "--non-interactive"],
|
|
@@ -140,7 +198,7 @@ export function registerIacTools(
|
|
|
140
198
|
scopeTargetOf: (p) => ({ kind: "dir", value: p.workingDirectory }),
|
|
141
199
|
},
|
|
142
200
|
"Run pulumi up.",
|
|
143
|
-
z.object({ workingDirectory:
|
|
201
|
+
z.object({ workingDirectory: cliArg }),
|
|
144
202
|
async (p) => {
|
|
145
203
|
await runCliOkThrowing(
|
|
146
204
|
["pulumi", "up", "--yes", "--cwd", p.workingDirectory, "--non-interactive"],
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
12
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
13
14
|
import { envInt } from "../../../shared/imap-tool-kit.ts";
|
|
14
15
|
import { createImapFlowClient, createNodemailerMailer } from "../../../shared/imapflow-adapter.ts";
|
|
15
16
|
import { requireProcessEnv } from "../../../shared/mcp-tool-kit.ts";
|
|
@@ -22,7 +23,10 @@ const SMTPS_PORT = 465;
|
|
|
22
23
|
|
|
23
24
|
const smtpPort = envInt("IMAP_SMTP_PORT", DEFAULT_SMTP_PORT);
|
|
24
25
|
|
|
25
|
-
const server = new McpServer(
|
|
26
|
+
const server = new McpServer(
|
|
27
|
+
{ name: "nimbus-imap", version: "0.1.0" },
|
|
28
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
29
|
+
);
|
|
26
30
|
|
|
27
31
|
registerImapTools(
|
|
28
32
|
server,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerJenkinsTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const mcp = new McpServer(
|
|
6
|
+
const mcp = new McpServer(
|
|
7
|
+
{ name: "nimbus-jenkins", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerJenkinsTools(mcp);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerJiraTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-jira", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerJiraTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerKubernetesTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const mcp = new McpServer(
|
|
6
|
+
const mcp = new McpServer(
|
|
7
|
+
{ name: "nimbus-kubernetes", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerKubernetesTools(mcp);
|
|
8
12
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { cliArg } from "../../../shared/cli-json-kit.ts";
|
|
2
3
|
import type { ConsentServer } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { createWriteToolRegistrar } from "../../../shared/consent-kit.ts";
|
|
4
5
|
import {
|
|
@@ -34,7 +35,7 @@ async function kubectlJson(rest: string[]): Promise<unknown> {
|
|
|
34
35
|
return runCliJsonThrowing(cmd, kubeEnv());
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
const optionalNamespaceSchema = z.object({ namespace:
|
|
38
|
+
const optionalNamespaceSchema = z.object({ namespace: cliArg.optional() });
|
|
38
39
|
|
|
39
40
|
async function k8sListNamespacedResource(p: { namespace?: string | undefined }, resource: string) {
|
|
40
41
|
const ns = p.namespace ?? "default";
|
|
@@ -92,9 +93,9 @@ export function registerKubernetesTools(
|
|
|
92
93
|
},
|
|
93
94
|
"Restart a rollout (e.g. deployment).",
|
|
94
95
|
z.object({
|
|
95
|
-
namespace:
|
|
96
|
-
resourceType:
|
|
97
|
-
name:
|
|
96
|
+
namespace: cliArg.optional(),
|
|
97
|
+
resourceType: cliArg,
|
|
98
|
+
name: cliArg,
|
|
98
99
|
}),
|
|
99
100
|
async (p) => {
|
|
100
101
|
const ns = p.namespace ?? "default";
|
|
@@ -117,8 +118,8 @@ export function registerKubernetesTools(
|
|
|
117
118
|
},
|
|
118
119
|
"Delete a pod.",
|
|
119
120
|
z.object({
|
|
120
|
-
namespace:
|
|
121
|
-
podName:
|
|
121
|
+
namespace: cliArg.optional(),
|
|
122
|
+
podName: cliArg,
|
|
122
123
|
}),
|
|
123
124
|
async (p) => {
|
|
124
125
|
const ns = p.namespace ?? "default";
|
|
@@ -137,8 +138,8 @@ export function registerKubernetesTools(
|
|
|
137
138
|
},
|
|
138
139
|
"Scale a deployment.",
|
|
139
140
|
z.object({
|
|
140
|
-
namespace:
|
|
141
|
-
deploymentName:
|
|
141
|
+
namespace: cliArg.optional(),
|
|
142
|
+
deploymentName: cliArg,
|
|
142
143
|
replicas: z.number().int().min(0),
|
|
143
144
|
}),
|
|
144
145
|
async (p) => {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerLinearTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-linear", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerLinearTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerNotionTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-notion", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerNotionTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerObsidianTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-obsidian", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerObsidianTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerOnedriveTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-onedrive", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerOnedriveTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerOutlookTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-outlook", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerOutlookTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerPagerdutyTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const mcp = new McpServer(
|
|
6
|
+
const mcp = new McpServer(
|
|
7
|
+
{ name: "nimbus-pagerduty", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerPagerdutyTools(mcp);
|
|
8
12
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
11
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
12
13
|
import { optionalEnv } from "../../../shared/env-json-api.ts";
|
|
13
14
|
import { envInt } from "../../../shared/imap-tool-kit.ts";
|
|
14
15
|
import { createImapFlowClient, createNodemailerMailer } from "../../../shared/imapflow-adapter.ts";
|
|
@@ -28,7 +29,10 @@ const DEFAULT_SMTP_PORT = 1025;
|
|
|
28
29
|
*/
|
|
29
30
|
const BRIDGE_TLS = { secure: false, rejectUnauthorized: false } as const;
|
|
30
31
|
|
|
31
|
-
const server = new McpServer(
|
|
32
|
+
const server = new McpServer(
|
|
33
|
+
{ name: "nimbus-protonmail", version: "0.1.0" },
|
|
34
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
35
|
+
);
|
|
32
36
|
|
|
33
37
|
registerProtonmailTools(
|
|
34
38
|
server,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import {
|
|
3
3
|
asArray,
|
|
4
|
-
|
|
4
|
+
awsCliArg,
|
|
5
5
|
createCliJsonRunner,
|
|
6
6
|
isRecord,
|
|
7
7
|
strField,
|
|
@@ -13,9 +13,9 @@ import type { ZodToolRegistrar } from "../../../shared/run-read-only-mcp-connect
|
|
|
13
13
|
/**
|
|
14
14
|
* The argv-injection guard every SageMaker model name passes through on its way to the
|
|
15
15
|
* `aws sagemaker` CLI. Re-exported so this connector's own test can assert the guard rejects a
|
|
16
|
-
* `-`-prefixed value.
|
|
16
|
+
* `-`-prefixed value, and one the CLI would replace by a file's contents (`file://<path>`).
|
|
17
17
|
*/
|
|
18
|
-
export {
|
|
18
|
+
export { awsCliArg };
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Amazon SageMaker (Tier-3, metadata-only) MCP tool surface. ALL tools index
|
|
@@ -65,7 +65,7 @@ export function registerSagemakerTools(reg: ZodToolRegistrar): void {
|
|
|
65
65
|
"sagemaker_list",
|
|
66
66
|
"List Amazon SageMaker models — METADATA ONLY (`aws sagemaker list-models`). Each entry carries `ModelName`, `ModelArn`, and `CreationTime`. Optionally filter by a `nameContains` substring on the model name. Never invokes an endpoint and never fetches inference / training / model-artifact data.",
|
|
67
67
|
z.object({
|
|
68
|
-
nameContains:
|
|
68
|
+
nameContains: awsCliArg.optional(),
|
|
69
69
|
}),
|
|
70
70
|
async (p) => {
|
|
71
71
|
const args = ["list-models", "--max-results", PAGE];
|
|
@@ -80,7 +80,7 @@ export function registerSagemakerTools(reg: ZodToolRegistrar): void {
|
|
|
80
80
|
"sagemaker_get",
|
|
81
81
|
"Fetch one Amazon SageMaker model's METADATA (`aws sagemaker describe-model`). Returns the model object including `ModelName`, `ModelArn`, `PrimaryContainer` (container `Image` reference + `ModelDataUrl` S3 pointer — a URI string, NOT the model bytes), `ExecutionRoleArn`, and `CreationTime`. No inference, training, or model-artifact data is returned — registry metadata only.",
|
|
82
82
|
z.object({
|
|
83
|
-
modelName:
|
|
83
|
+
modelName: awsCliArg,
|
|
84
84
|
}),
|
|
85
85
|
async (p) => {
|
|
86
86
|
return jsonResult(await sagemakerCli(["describe-model", "--model-name", p.modelName]));
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerSlackTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-slack", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerSlackTools(server);
|
|
8
12
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CONSENT_SERVER_CAPABILITIES } from "../../../shared/consent-kit.ts";
|
|
3
4
|
import { registerTeamsTools } from "./tools.ts";
|
|
4
5
|
|
|
5
|
-
const server = new McpServer(
|
|
6
|
+
const server = new McpServer(
|
|
7
|
+
{ name: "nimbus-teams", version: "0.1.0" },
|
|
8
|
+
{ capabilities: CONSENT_SERVER_CAPABILITIES },
|
|
9
|
+
);
|
|
6
10
|
|
|
7
11
|
registerTeamsTools(server);
|
|
8
12
|
|