@anychat-ai/mcp 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -49,7 +49,7 @@ Flags: `--profile core|full` picks the tool set (default `full`, see [Profiles](
49
49
 
50
50
  ## Tools
51
51
 
52
- 191 tools, a 1:1 projection of the [Agent API](https://docs.anychat.ai/reference/agent-api/) grouped as the reference is (orient → Definition → Capabilities → Channels → People → Campaigns → Tests → Testers → Activity → Org → Docs). `npx -y @anychat-ai/mcp tools` prints the live table.
52
+ 195 tools, a 1:1 projection of the [Agent API](https://docs.anychat.ai/reference/agent-api/) grouped as the reference is (orient → Definition → Capabilities → Channels → People → Campaigns → Tests → Testers → Emulator → Activity → Org → Docs). `npx -y @anychat-ai/mcp tools` prints the live table.
53
53
 
54
54
  Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` tools change configuration; `destructive` tools (deletes, outreach sends to real people, provisioning requests, imports over an existing agent, secret rotation) are `destructiveHint` so your host asks before running them.
55
55
 
@@ -57,8 +57,8 @@ Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` too
57
57
 
58
58
  Every tool definition (name, description, input schema) is sent to the model on every call, so a big table has a real per-turn cost. Two profiles trade breadth for weight:
59
59
 
60
- - **`full`** (default) — all 183 tools.
61
- - **`core`** — 72 tools, the everyday set: `whoami`; agents (list / get / create / update / export / import, apply template, catalogs); the whole Definition (identity, personality, standing instructions, guardrails, rules, goals, playbooks, message templates, `lint_agent`); the media library (list / add / update / delete); tool bindings (list / upsert); scheduling config; People field definitions; outreach config; Things (read); Facts (read / replace); business info (read / replace); channels (list / get / request / bind, early access, launch); people (list / get / update, send outreach, list segments); testers (list); conversations / messages / logs / activity; org; docs. About half the tokens of `full`.
60
+ - **`full`** (default) — all 195 tools.
61
+ - **`core`** — 74 tools, the everyday set: `whoami`; agents (list / get / create / update / export / import, apply template, catalogs); the whole Definition (identity, personality, standing instructions, guardrails, rules, goals, playbooks, message templates, `lint_agent`); the media library (list / add / update / delete); tool bindings (list / upsert); scheduling config; People field definitions; outreach config; Things (read); Facts (read / replace); business info (read / replace); channels (list / get / request / bind, early access, launch); people (list / get / update, send outreach, list segments); testers (list); emulator links (list / create); conversations / messages / logs / activity; org; docs. About half the tokens of `full`.
62
62
 
63
63
  Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })` in code; the `Profile` column below shows which set each tool belongs to, and `npx -y @anychat-ai/mcp tools --profile core` lists just that set. Nothing else changes: `full` stays the default, and the `core` set only ever grows — a tool leaves it only when the route behind it is retired.
64
64
 
@@ -241,6 +241,10 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
241
241
  | `set_tester_disabled` | write | `agents:write` | full | Disable or enable tester |
242
242
  | `regenerate_tester_link` | destructive | `agents:write` | full | Regenerate tester sign-in link |
243
243
  | `remove_tester` | destructive | `agents:write` | full | Remove tester |
244
+ | `list_emulator_links` | read | `agents:read` | core | List standalone emulator links |
245
+ | `create_emulator_link` | destructive | `agents:write` | core | Create a standalone emulator link |
246
+ | `revoke_emulator_link` | destructive | `agents:write` | full | Revoke a standalone emulator link |
247
+ | `create_emulator_grant` | destructive | `agents:read` | full | Open the emulator now (short-lived grant) |
244
248
  | `list_messages` | read | `messages:read` | core | List messages |
245
249
  | `list_sessions` | read | `messages:read` | core | List sessions |
246
250
  | `list_users` | read | `messages:read` | full | List users |
@@ -0,0 +1 @@
1
+ export declare const emulatorTools: import("../tool").AnyTool[];
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emulatorTools = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_1 = require("../tool");
6
+ /**
7
+ * Emulator group — the sandbox emulator outside the console: standalone
8
+ * emulator links (share with a colleague who has no console account;
9
+ * revocable) and short-lived session grants (open the emulator page for
10
+ * an agent right now). Mirrors the "Emulator links" section of the API
11
+ * reference. Everything here is Sandbox: nothing done through a link or
12
+ * grant reaches a real customer.
13
+ *
14
+ * The create responses carry the link `url` exactly once. It is a
15
+ * credential for talking to the agent, so the tools that mint one are
16
+ * `destructive` (hosts prompt) and tell the model to hand it to the
17
+ * operator rather than paste it around.
18
+ */
19
+ const URL_HANDLING = 'The response includes the url exactly once (a list never repeats it): give it to the operator to share — do not paste it anywhere else unprompted.';
20
+ const agentIdField = zod_1.z.string();
21
+ const linkIdField = zod_1.z.string().min(1).describe('Link id from list_emulator_links');
22
+ function emulatorPath(agentId, resource, suffix = '') {
23
+ return `/agents/${encodeURIComponent(agentId)}/${resource}${suffix}`;
24
+ }
25
+ exports.emulatorTools = [
26
+ (0, tool_1.defineTool)({
27
+ name: 'list_emulator_links',
28
+ title: 'List standalone emulator links',
29
+ description: 'List the active standalone emulator links of an agent: id, label, expiresAt, createdAt, createdBy. A link lets someone without a console account talk to the agent in the sandbox emulator (RCS, Apple Messages, WhatsApp or SMS look) — nothing they do reaches a real customer. Expired and revoked links are not listed; the link url is never included (it is returned once, on create). Maps to GET /v1/orgs/{org}/agents/{agent}/emulator-links.',
30
+ kind: 'read',
31
+ scope: 'agents:read',
32
+ roleFloor: 'viewer',
33
+ profile: 'core',
34
+ input: { agentId: agentIdField },
35
+ run: async ({ client }, { agentId }) => client.get(await client.orgPath(emulatorPath(agentId, 'emulator-links'))),
36
+ }),
37
+ (0, tool_1.defineTool)({
38
+ name: 'create_emulator_link',
39
+ title: 'Create a standalone emulator link',
40
+ description: `Create a shareable sandbox emulator link for an agent — for a colleague, client or reviewer who works with the team but not in the console. It opens the emulator page for this one agent with no sign-in; conversations are sandbox conversations (kept beside the real ones, never counted, no real effects). ttlDays 1–90 (default 14); label is an optional note. ${URL_HANDLING} Revoke it any time with revoke_emulator_link. Maps to POST /v1/orgs/{org}/agents/{agent}/emulator-links.`,
41
+ kind: 'destructive',
42
+ scope: 'agents:write',
43
+ roleFloor: 'editor',
44
+ profile: 'core',
45
+ input: {
46
+ agentId: agentIdField,
47
+ ttlDays: zod_1.z
48
+ .number()
49
+ .int()
50
+ .min(1)
51
+ .max(90)
52
+ .optional()
53
+ .describe('Days until the link expires (default 14)'),
54
+ label: zod_1.z.string().max(200).optional().describe('Note, e.g. "Marketing review"'),
55
+ },
56
+ run: async ({ client }, { agentId, ttlDays, label }) => client.post(await client.orgPath(emulatorPath(agentId, 'emulator-links')), {
57
+ ...(ttlDays !== undefined ? { ttlDays } : {}),
58
+ ...(label !== undefined ? { label } : {}),
59
+ }),
60
+ }),
61
+ (0, tool_1.defineTool)({
62
+ name: 'revoke_emulator_link',
63
+ title: 'Revoke a standalone emulator link',
64
+ description: 'Revoke a standalone emulator link: its url stops working immediately for everyone who has it. Irreversible — create a new link instead. 404 agent.emulator_link.not_found if the id is not a link of this agent. Maps to DELETE /v1/orgs/{org}/agents/{agent}/emulator-links/{id}.',
65
+ kind: 'destructive',
66
+ scope: 'agents:write',
67
+ roleFloor: 'editor',
68
+ input: { agentId: agentIdField, linkId: linkIdField },
69
+ run: async ({ client }, { agentId, linkId }) => {
70
+ const removed = await client.delete(await client.orgPath(emulatorPath(agentId, 'emulator-links', `/${encodeURIComponent(linkId)}`)));
71
+ return removed ?? { ok: true, revoked: linkId };
72
+ },
73
+ }),
74
+ (0, tool_1.defineTool)({
75
+ name: 'create_emulator_grant',
76
+ title: 'Open the emulator now (short-lived grant)',
77
+ description: `Mint a short-lived session grant for an agent's sandbox emulator and get the page url to open it right now — for the operator themselves, not for sharing (share with create_emulator_link instead). ttlSec 60–3600 (default 1800); the grant cannot be revoked and is not listed anywhere. Returns { grant, expiresAt, url }. ${URL_HANDLING} Maps to POST /v1/orgs/{org}/agents/{agent}/emulator-grants.`,
78
+ kind: 'destructive',
79
+ scope: 'agents:read',
80
+ roleFloor: 'viewer',
81
+ input: {
82
+ agentId: agentIdField,
83
+ ttlSec: zod_1.z
84
+ .number()
85
+ .int()
86
+ .min(60)
87
+ .max(3600)
88
+ .optional()
89
+ .describe('Seconds until the grant expires (default 1800)'),
90
+ },
91
+ run: async ({ client }, { agentId, ttlSec }) => client.post(await client.orgPath(emulatorPath(agentId, 'emulator-grants')), ttlSec !== undefined ? { ttlSec } : {}),
92
+ }),
93
+ ];
94
+ //# sourceMappingURL=emulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC;;;;;;;;;;;;GAYG;AAEH,MAAM,YAAY,GAChB,oJAAoJ,CAAC;AAEvJ,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC;AAChC,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;AAEnF,SAAS,YAAY,CAAC,OAAe,EAAE,QAAgB,EAAE,MAAM,GAAG,EAAE;IAClE,OAAO,WAAW,kBAAkB,CAAC,OAAO,CAAC,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;AACvE,CAAC;AAEY,QAAA,aAAa,GAAG;IAC3B,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,wbAAwb;QAC1b,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;QAChC,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CACrC,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;KAC5E,CAAC;IAEF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,mCAAmC;QAC1C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AAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;YAC7C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,MAAM,CACjC,MAAM,MAAM,CAAC,OAAO,CAClB,YAAY,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAC1E,CACF,CAAC;YACF,OAAO,OAAO,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAClD,CAAC;KACF,CAAC;IAEF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,2CAA2C;QAClD,WAAW,EAAE,kUAAkU,YAAY,8DAA8D;QACzZ,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE;YACL,OAAO,EAAE,YAAY;YACrB,MAAM,EAAE,OAAC;iBACN,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,EAAE,CAAC;iBACP,GAAG,CAAC,IAAI,CAAC;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,gDAAgD,CAAC;SAC9D;QACD,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAC7C,MAAM,CAAC,IAAI,CACT,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAC9D,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CACvC;KACJ,CAAC;CACH,CAAC"}
@@ -2,7 +2,7 @@ import { AnyTool, ToolProfile } from '../tool';
2
2
  /**
3
3
  * The tool table, in the order hosts list them. Grouped as the API reference
4
4
  * is: orient → Definition → Capabilities → Channels → People → Campaigns →
5
- * Tests → Testers → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
5
+ * Tests → Testers → Emulator → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
6
6
  */
7
7
  export declare const allTools: AnyTool[];
8
8
  export declare const toolsByName: ReadonlyMap<string, AnyTool>;
@@ -9,6 +9,7 @@ const capabilities_1 = require("./capabilities");
9
9
  const channels_1 = require("./channels");
10
10
  const definition_1 = require("./definition");
11
11
  const docs_1 = require("./docs");
12
+ const emulator_1 = require("./emulator");
12
13
  const tests_1 = require("./tests");
13
14
  const goals_1 = require("./goals");
14
15
  const media_1 = require("./media");
@@ -19,7 +20,7 @@ const testers_1 = require("./testers");
19
20
  /**
20
21
  * The tool table, in the order hosts list them. Grouped as the API reference
21
22
  * is: orient → Definition → Capabilities → Channels → People → Campaigns →
22
- * Tests → Testers → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
23
+ * Tests → Testers → Emulator → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
23
24
  */
24
25
  exports.allTools = [
25
26
  ...me_1.meTools,
@@ -33,6 +34,7 @@ exports.allTools = [
33
34
  ...campaigns_1.campaignTools,
34
35
  ...tests_1.testTools,
35
36
  ...testers_1.testerTools,
37
+ ...emulator_1.emulatorTools,
36
38
  ...activity_1.activityTools,
37
39
  ...org_1.orgTools,
38
40
  ...docs_1.docsTools,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AA8CA,0CAKC;AAlDD,yCAA2C;AAC3C,qCAAsC;AACtC,2CAA4C;AAC5C,iDAAiD;AACjD,yCAA0C;AAC1C,6CAA+C;AAC/C,iCAAmC;AACnC,mCAAoC;AACpC,mCAAoC;AACpC,mCAAqC;AACrC,6BAA+B;AAC/B,+BAAiC;AACjC,qCAAuC;AACvC,uCAAwC;AAExC;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,GAAG,YAAO;IACV,GAAG,mBAAU;IACb,GAAG,4BAAe;IAClB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,cAAQ;IACX,GAAG,gBAAS;CACb,CAAC;AAEW,QAAA,WAAW,GAAiC,IAAI,GAAG,CAC9D,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAC/B,CAAC;AAEF;;;GAGG;AACH,SAAgB,eAAe,CAC7B,OAAoB,EACpB,QAA4B,gBAAQ;IAEpC,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;AACnF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anychat-ai/mcp",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "Anychat MCP server — drive your Anychat workspace (agents, playbooks, channels, people, outreach) from Claude Code, Claude Desktop, Cursor, or any MCP host.",
5
5
  "keywords": [
6
6
  "anychat",