@kadoa/mcp 0.7.2 → 0.7.3
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 +3 -6
- package/dist/index.js +34 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,6 +163,7 @@ Point your client to `https://mcp.kadoa.com/mcp` with OAuth authentication.
|
|
|
163
163
|
|------|-------------|
|
|
164
164
|
| `whoami` | Show current user details, auth method, and team memberships |
|
|
165
165
|
| `team_list` | List all teams you belong to and see which is active |
|
|
166
|
+
| `list_compliance_rules` | Read the compliance rules applied to your team (robots.txt, terms of service, blocked sources, PII, and similar), with each rule's enabled status and configuration. Read-only |
|
|
166
167
|
|
|
167
168
|
Team switching (a team_switch tool) exists in the code but is currently
|
|
168
169
|
disabled and hidden from every client's tool list — a credential is fixed to
|
|
@@ -544,15 +545,13 @@ A typical feature touches three repos — **`kadoa-backend` → `kadoa-sdks` →
|
|
|
544
545
|
| Backend endpoint | `kadoa-backend/` | The HTTP API. Source of truth; the OpenAPI spec is generated from here. |
|
|
545
546
|
| SDK low-level | `kadoa-sdks/sdks/node/src/generated/api/*` | Auto-generated axios client. Raw HTTP, typed from the OpenAPI spec. **Do not hand-edit.** |
|
|
546
547
|
| SDK domain (high-level) | `kadoa-sdks/sdks/node/src/domains/<thing>/<thing>.service.ts` | Thin domain wrapper over the generated client. `client.<thing>.<action>(...)`. This is what callers use. |
|
|
547
|
-
| CLI | `kadoa-cli/src/commands/<thing>.ts` | Commander action: flag parsing, spinner, table/json output. Calls SDK domain. |
|
|
548
548
|
| MCP (this repo) | `kadoa-mcp/src/tools/<domain>.ts` | Zod input schema + tool description tuned for LLMs. Calls SDK domain. |
|
|
549
549
|
|
|
550
550
|
Mental model:
|
|
551
551
|
- **SDK** = pure function over HTTP.
|
|
552
|
-
- **CLI** = SDK + human UX (flags, table output).
|
|
553
552
|
- **MCP** = SDK + LLM UX (zod schema, prose description).
|
|
554
553
|
|
|
555
|
-
|
|
554
|
+
MCP calls SDK domain methods, never raw HTTP. Any other SDK consumer gets new features for free — as long as we keep the layering honest.
|
|
556
555
|
|
|
557
556
|
### Adding a new feature
|
|
558
557
|
|
|
@@ -560,7 +559,7 @@ CLI and MCP both call **identical** SDK domain methods. A new feature added to t
|
|
|
560
559
|
- Add or modify the HTTP endpoint.
|
|
561
560
|
- Make sure the OpenAPI spec reflects the change (paths, request/response schemas).
|
|
562
561
|
|
|
563
|
-
2. **SDK** (`kadoa-sdks`) — always do this **before** MCP
|
|
562
|
+
2. **SDK** (`kadoa-sdks`) — always do this **before** MCP work (the SDK-first rule). No bandaid `axios` calls in MCP.
|
|
564
563
|
- Regenerate the low-level client:
|
|
565
564
|
```bash
|
|
566
565
|
bun kadoa-codegen fetch-spec -e https://api.kadoa.com/openapi -f
|
|
@@ -581,8 +580,6 @@ CLI and MCP both call **identical** SDK domain methods. A new feature added to t
|
|
|
581
580
|
- If the change intentionally alters a tool's name, title, description, schema, outputSchema or annotations, regenerate the snapshot: `UPDATE_TOOLS_SNAPSHOT=1 BUN_TEST=1 bun test tests/unit/tools-list-snapshot.test.ts`, then `./node_modules/.bin/biome format --write tests/unit/fixtures/tools-list.snapshot.json`. Advertised input and output schemas are normalised by `src/tools/shared/portable-schema.ts` (no `$ref`/`$defs`, `const`, `oneOf`, `additionalProperties`, `$schema`, etc.), so strict clients such as Gemini accept them; zod validation is unchanged.
|
|
582
581
|
- Use a Conventional Commit message (`feat(mcp): ...`, `fix(mcp): ...`). Release Please will cut the next version on merge to `main`.
|
|
583
582
|
|
|
584
|
-
4. **CLI** (`kadoa-cli`), if the feature is user-facing on the command line: mirror the MCP step in `src/commands/<thing>.ts`. Same SDK call, different UX.
|
|
585
|
-
|
|
586
583
|
### Anti-patterns
|
|
587
584
|
|
|
588
585
|
- ❌ Raw `axios` calls or hand-rolled HTTP in `src/tools/`. Always go through `ctx.client.<thing>`.
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var package_default;
|
|
|
17
17
|
var init_package = __esm(() => {
|
|
18
18
|
package_default = {
|
|
19
19
|
name: "@kadoa/mcp",
|
|
20
|
-
version: "0.7.
|
|
20
|
+
version: "0.7.3",
|
|
21
21
|
description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
22
22
|
type: "module",
|
|
23
23
|
main: "dist/index.js",
|
|
@@ -1377,6 +1377,37 @@ var init_assistant = __esm(() => {
|
|
|
1377
1377
|
CLOSED_ASSISTANT_STATUSES = new Set(["failed", "errored", "aborted", "timed_out"]);
|
|
1378
1378
|
});
|
|
1379
1379
|
|
|
1380
|
+
// src/tools/compliance.ts
|
|
1381
|
+
function registerComplianceTools(server, ctx, helpers) {
|
|
1382
|
+
const { withErrorHandling } = helpers;
|
|
1383
|
+
server.registerTool("list_compliance_rules", {
|
|
1384
|
+
title: "List Compliance Rules",
|
|
1385
|
+
description: "List the compliance rules that apply to your team: rule type, name, description, whether it is enabled, and its configuration. " + "Rules are set at the organization level and apply to every team in it. " + "Use this for questions about robots.txt, terms of service, blocked sources or countries, PII handling, captchas, or why a workflow went to compliance review. " + "Read-only: it cannot change rules or grant exceptions; for that, contact Kadoa support.",
|
|
1386
|
+
inputSchema: strictSchema({}),
|
|
1387
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }
|
|
1388
|
+
}, withErrorHandling("list_compliance_rules", async () => {
|
|
1389
|
+
const response = await ctx.client.axiosInstance.get(`/v4/team/${encodeURIComponent(ctx.teamId)}/compliance-rules`, { baseURL: ctx.client.baseUrl });
|
|
1390
|
+
const rules = response.data?.complianceRules;
|
|
1391
|
+
if (!Array.isArray(rules))
|
|
1392
|
+
throw new Error("Unexpected response from the compliance rules API.");
|
|
1393
|
+
return jsonResult({
|
|
1394
|
+
complianceRules: rules.map((rule) => ({
|
|
1395
|
+
ruleType: rule.ruleType,
|
|
1396
|
+
ruleName: rule.ruleName,
|
|
1397
|
+
description: rule.description ?? "",
|
|
1398
|
+
isEnabled: rule.isEnabled,
|
|
1399
|
+
configuration: rule.configuration ?? {},
|
|
1400
|
+
...rule.updatedAt ? { updatedAt: rule.updatedAt } : {}
|
|
1401
|
+
})),
|
|
1402
|
+
note: rules.length === 0 ? `No compliance rules are configured for your team. ${NO_CHANGES_NOTE}` : NO_CHANGES_NOTE
|
|
1403
|
+
});
|
|
1404
|
+
}));
|
|
1405
|
+
}
|
|
1406
|
+
var NO_CHANGES_NOTE = "Rules are set by Kadoa for your organization and are read-only here. To change a rule or request an exception, contact Kadoa support.";
|
|
1407
|
+
var init_compliance = __esm(() => {
|
|
1408
|
+
init_schemas();
|
|
1409
|
+
});
|
|
1410
|
+
|
|
1380
1411
|
// src/notification-channels.ts
|
|
1381
1412
|
import { createHash } from "node:crypto";
|
|
1382
1413
|
function recipientKey(recipients) {
|
|
@@ -3997,11 +4028,13 @@ function registerTools(server, ctx, capabilities) {
|
|
|
3997
4028
|
registerSupportTools(server, ctx, helpers);
|
|
3998
4029
|
registerNotificationSettingsTools(server, ctx, helpers);
|
|
3999
4030
|
registerTeamTools(server, ctx, helpers);
|
|
4031
|
+
registerComplianceTools(server, ctx, helpers);
|
|
4000
4032
|
registerVariableTools(server, ctx, helpers);
|
|
4001
4033
|
registerTemplateTools(server, ctx, helpers);
|
|
4002
4034
|
}
|
|
4003
4035
|
var init_tools = __esm(() => {
|
|
4004
4036
|
init_assistant();
|
|
4037
|
+
init_compliance();
|
|
4005
4038
|
init_notifications();
|
|
4006
4039
|
init_observability();
|
|
4007
4040
|
init_scrape();
|