iit-mcp-autotask 0.54.2

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 (164) hide show
  1. package/.env.example +123 -0
  2. package/LICENSE +21 -0
  3. package/README.md +788 -0
  4. package/capabilities.json +487 -0
  5. package/dist/access/gate.d.ts +34 -0
  6. package/dist/access/gate.js +76 -0
  7. package/dist/access/grants.d.ts +20 -0
  8. package/dist/access/grants.js +35 -0
  9. package/dist/access/write-env.d.ts +41 -0
  10. package/dist/access/write-env.js +166 -0
  11. package/dist/auth.d.ts +74 -0
  12. package/dist/auth.js +129 -0
  13. package/dist/base-hosts.d.ts +38 -0
  14. package/dist/base-hosts.js +70 -0
  15. package/dist/config/load.d.ts +28 -0
  16. package/dist/config/load.js +105 -0
  17. package/dist/config/schema.d.ts +166 -0
  18. package/dist/config/schema.js +311 -0
  19. package/dist/credential.d.ts +28 -0
  20. package/dist/credential.js +32 -0
  21. package/dist/doctor.d.ts +112 -0
  22. package/dist/doctor.js +154 -0
  23. package/dist/http-guard.d.ts +57 -0
  24. package/dist/http-guard.js +134 -0
  25. package/dist/http.d.ts +50 -0
  26. package/dist/http.js +290 -0
  27. package/dist/lifecycle.d.ts +29 -0
  28. package/dist/lifecycle.js +52 -0
  29. package/dist/logger.d.ts +26 -0
  30. package/dist/logger.js +28 -0
  31. package/dist/main.d.ts +12 -0
  32. package/dist/main.js +283 -0
  33. package/dist/policy.d.ts +54 -0
  34. package/dist/policy.js +80 -0
  35. package/dist/tools/aggregate.d.ts +16 -0
  36. package/dist/tools/aggregate.js +64 -0
  37. package/dist/tools/capabilities-manifest.d.ts +4 -0
  38. package/dist/tools/capabilities-manifest.js +94 -0
  39. package/dist/tools/catalog-data.d.ts +116 -0
  40. package/dist/tools/catalog-data.js +207 -0
  41. package/dist/tools/clock.d.ts +17 -0
  42. package/dist/tools/clock.js +43 -0
  43. package/dist/tools/composites.d.ts +36 -0
  44. package/dist/tools/composites.js +305 -0
  45. package/dist/tools/context/client.d.ts +41 -0
  46. package/dist/tools/context/client.js +139 -0
  47. package/dist/tools/context/derive.d.ts +9 -0
  48. package/dist/tools/context/derive.js +32 -0
  49. package/dist/tools/context/scope.d.ts +24 -0
  50. package/dist/tools/context/scope.js +180 -0
  51. package/dist/tools/context/types.d.ts +141 -0
  52. package/dist/tools/context/types.js +2 -0
  53. package/dist/tools/dispatch.d.ts +78 -0
  54. package/dist/tools/dispatch.js +272 -0
  55. package/dist/tools/field-pointer.d.ts +25 -0
  56. package/dist/tools/field-pointer.js +45 -0
  57. package/dist/tools/guide.d.ts +30 -0
  58. package/dist/tools/guide.js +97 -0
  59. package/dist/tools/lists.d.ts +9 -0
  60. package/dist/tools/lists.js +205 -0
  61. package/dist/tools/meta.d.ts +22 -0
  62. package/dist/tools/meta.js +709 -0
  63. package/dist/tools/output-file.d.ts +26 -0
  64. package/dist/tools/output-file.js +140 -0
  65. package/dist/tools/rank.d.ts +21 -0
  66. package/dist/tools/rank.js +57 -0
  67. package/dist/tools/reasons.d.ts +33 -0
  68. package/dist/tools/reasons.js +121 -0
  69. package/dist/tools/register.d.ts +23 -0
  70. package/dist/tools/register.js +50 -0
  71. package/dist/tools/resolves.d.ts +28 -0
  72. package/dist/tools/resolves.js +399 -0
  73. package/dist/tools/results/envelope.d.ts +55 -0
  74. package/dist/tools/results/envelope.js +63 -0
  75. package/dist/tools/results/errors.d.ts +147 -0
  76. package/dist/tools/results/errors.js +384 -0
  77. package/dist/tools/results/untrusted.d.ts +129 -0
  78. package/dist/tools/results/untrusted.js +218 -0
  79. package/dist/tools/revenue-rollup.d.ts +8 -0
  80. package/dist/tools/revenue-rollup.js +112 -0
  81. package/dist/tools/schemas.d.ts +467 -0
  82. package/dist/tools/schemas.js +444 -0
  83. package/dist/tools/scope-guard.d.ts +2 -0
  84. package/dist/tools/scope-guard.js +11 -0
  85. package/dist/tools/server-version.d.ts +3 -0
  86. package/dist/tools/server-version.js +14 -0
  87. package/dist/tools/server.d.ts +92 -0
  88. package/dist/tools/server.js +170 -0
  89. package/dist/tools/surface.d.ts +37 -0
  90. package/dist/tools/surface.js +94 -0
  91. package/dist/tools/tsv.d.ts +52 -0
  92. package/dist/tools/tsv.js +95 -0
  93. package/dist/tools/write/apply.d.ts +40 -0
  94. package/dist/tools/write/apply.js +500 -0
  95. package/dist/tools/write/checks.d.ts +39 -0
  96. package/dist/tools/write/checks.js +137 -0
  97. package/dist/tools/write/common.d.ts +23 -0
  98. package/dist/tools/write/common.js +33 -0
  99. package/dist/tools/write/facts.d.ts +52 -0
  100. package/dist/tools/write/facts.js +151 -0
  101. package/dist/tools/write/outcome.d.ts +23 -0
  102. package/dist/tools/write/outcome.js +67 -0
  103. package/dist/tools/write/parse.d.ts +37 -0
  104. package/dist/tools/write/parse.js +166 -0
  105. package/dist/tools/write/payload.d.ts +44 -0
  106. package/dist/tools/write/payload.js +119 -0
  107. package/dist/tools/write/preview.d.ts +3 -0
  108. package/dist/tools/write/preview.js +317 -0
  109. package/dist/tools/write/snapshot.d.ts +68 -0
  110. package/dist/tools/write/snapshot.js +360 -0
  111. package/dist/tools/write-guidance.d.ts +174 -0
  112. package/dist/tools/write-guidance.js +317 -0
  113. package/dist/tools/write.d.ts +9 -0
  114. package/dist/tools/write.js +10 -0
  115. package/dist/write/canonical.d.ts +12 -0
  116. package/dist/write/canonical.js +31 -0
  117. package/dist/write/evaluate.d.ts +77 -0
  118. package/dist/write/evaluate.js +91 -0
  119. package/dist/write/hard-rules.d.ts +49 -0
  120. package/dist/write/hard-rules.js +48 -0
  121. package/dist/write/runtime.d.ts +37 -0
  122. package/dist/write/runtime.js +72 -0
  123. package/dist/write/store/audit-log.d.ts +13 -0
  124. package/dist/write/store/audit-log.js +25 -0
  125. package/dist/write/store/constants.d.ts +34 -0
  126. package/dist/write/store/constants.js +35 -0
  127. package/dist/write/store/files.d.ts +44 -0
  128. package/dist/write/store/files.js +157 -0
  129. package/dist/write/store/heartbeat.d.ts +9 -0
  130. package/dist/write/store/heartbeat.js +65 -0
  131. package/dist/write/store/ledger.d.ts +15 -0
  132. package/dist/write/store/ledger.js +86 -0
  133. package/dist/write/store/lifecycle.d.ts +35 -0
  134. package/dist/write/store/lifecycle.js +114 -0
  135. package/dist/write/store/lock.d.ts +97 -0
  136. package/dist/write/store/lock.js +464 -0
  137. package/dist/write/store/op-lock.d.ts +13 -0
  138. package/dist/write/store/op-lock.js +175 -0
  139. package/dist/write/store/plan-store.d.ts +7 -0
  140. package/dist/write/store/plan-store.js +48 -0
  141. package/dist/write/store/plans.d.ts +5 -0
  142. package/dist/write/store/plans.js +19 -0
  143. package/dist/write/store/types.d.ts +195 -0
  144. package/dist/write/store/types.js +2 -0
  145. package/dist/write/store.d.ts +6 -0
  146. package/dist/write/store.js +182 -0
  147. package/examples/agentgateway.write-gate.yaml +29 -0
  148. package/package.json +71 -0
  149. package/server.json +69 -0
  150. package/skills/ar-aging.md +65 -0
  151. package/skills/company-360.md +69 -0
  152. package/skills/contract-profitability.md +65 -0
  153. package/skills/crm-management.md +87 -0
  154. package/skills/filter-semantics.md +75 -0
  155. package/skills/invoice-export.md +61 -0
  156. package/skills/log-time-entry.md +77 -0
  157. package/skills/non-chargeable-work.md +67 -0
  158. package/skills/portfolio-margin.md +66 -0
  159. package/skills/recurring-revenue.md +65 -0
  160. package/skills/revenue-rollup.md +65 -0
  161. package/skills/slim-reads.md +67 -0
  162. package/skills/ticket-triage.md +64 -0
  163. package/skills/unbilled-work-review.md +66 -0
  164. package/skills/wip-hours.md +68 -0
package/.env.example ADDED
@@ -0,0 +1,123 @@
1
+ # The credentials load recipe (issue #6) — read this before your first live session.
2
+ #
3
+ # A .env value may be SINGLE-QUOTED on purpose: a secret containing `$` must be, or the shell would
4
+ # expand it. Those quotes are part of the shell syntax, NOT part of the credential:
5
+ #
6
+ # set -a; . ./.env; set +a # shell sourcing — the ONLY load recipe this server documents
7
+ # autotask-mcp doctor # confirm the shape before any live session (zero vendor calls)
8
+ #
9
+ # Do NOT load this file with a quote-preserving dotenv parser (most `dotenv` variants, a hand-rolled
10
+ # split('=')): it hands the value over with its quotes intact, and the vendor answers 401 "Bad
11
+ # credentials" — which reads like a rotated credential, on an account where repeated auth failures
12
+ # risk a lock. The server refuses such a value before dialing (CREDENTIAL_MALFORMED) and `doctor`
13
+ # reports it as `shapeOk: false`, but the fix is the load recipe.
14
+ #
15
+ # A green `doctor` makes any later 401 vendor-side (rotated, revoked or role-restricted credential).
16
+ # See README §Credentials & env files.
17
+
18
+ # iit-mcp-autotask — non-secret configuration only.
19
+ # Real credentials never live in a committed file: under stdio the process environment IS the
20
+ # trust boundary (set them in the launching environment); under http they travel per request
21
+ # in the X-Autotask-* headers injected by the gateway.
22
+
23
+ # stdio (local: Claude Code / Claude Desktop / VS Code) or http (remote MCP clients / gateway).
24
+ # The CLI defaults to http on 127.0.0.1; local clients pass --transport stdio (or set this).
25
+ MCP_TRANSPORT=stdio
26
+
27
+ # --- Credentials (stdio: required from the environment; http: optional discouraged defaults) ---
28
+ # stdio: all three are REQUIRED for a live server; without them the server still boots and serves
29
+ # the full surface in credential-less mode (initialize/tools/list work; tool calls refuse).
30
+ # http: when set, every request WITHOUT its own X-Autotask-* headers runs as this identity and the
31
+ # identity is only ever presented to the AUTOTASK_BASE_URL default origin. Left commented so a
32
+ # copied example does not set empty values.
33
+ # AUTOTASK_API_INTEGRATION_CODE=
34
+ # AUTOTASK_USERNAME=
35
+ # AUTOTASK_SECRET=
36
+ # AUTOTASK_IMPERSONATION_RESOURCE_ID=
37
+
38
+ # The Autotask origin the server talks to. stdio: REQUIRED (the zone lives in the host, e.g.
39
+ # https://webservices6.autotask.net; base path /atservicesrest is fixed). http: optional DEFAULT
40
+ # origin for requests that send no X-Autotask-Base-Url header.
41
+ # AUTOTASK_BASE_URL=https://webservices6.autotask.net
42
+
43
+ # http only. Hosts a caller may name in X-Autotask-Base-Url: comma-separated exact hostnames or
44
+ # *.suffix subdomain suffixes (no scheme/port/path). Unset alongside a set default origin -> only
45
+ # that origin is accepted. Unset with no default origin -> the server REFUSES to boot unless
46
+ # AUTOTASK_ALLOW_ANY_BASE_HOST=true. Literal private-IP origins are always refused.
47
+ # Recommended production value: the line below.
48
+ # AUTOTASK_ALLOWED_BASE_HOSTS=*.autotask.net
49
+ # AUTOTASK_ALLOW_ANY_BASE_HOST=false
50
+
51
+ # --- Profile and toolsets (0.6.0) ---
52
+ # readonly (default): reads only, no state. operator: adds autotask_write (preview), autotask_apply and
53
+ # autotask_apply_destructive (execute the previewed plan; the preview names which), governed by AUTOTASK_WRITE;
54
+ # needs the state dir and run scope below.
55
+ AUTOTASK_PROFILE=readonly
56
+ # operator: which writes are served, a mode per operation; unlisted is denied. stdio: confirm, allow,
57
+ # unattended or deny (this server asks the person). HTTP: allow or deny only (the MCP client gates).
58
+ # Grammar, hard rules and dedup: docs/write-gate.md.
59
+ # AUTOTASK_WRITE=*:deny,tickets.*:allow,time_entries.create:allow,companies.update:deny
60
+ # AUTOTASK_DEDUP=companies.create:companyName
61
+ # operator: the state dir (mode 0700; plans, ledger, audit, locks; same-version processes on one host may share it).
62
+ # AUTOTASK_STATE_DIR=/var/lib/autotask-mcp
63
+ # operator on stdio: the run scope (required), {"companyIds":[...]} or {"all":true} (any
64
+ # company). On HTTP set runScope per token instead.
65
+ # AUTOTASK_RUN_SCOPE={"companyIds":[12345]}
66
+ # operator on stdio: the principal plans and the audit log are bound to (default stdio).
67
+ # AUTOTASK_PRINCIPAL=nightly-time-entries
68
+ # The kill file: while it exists every preview and apply is denied (default <state dir>/KILL).
69
+ # AUTOTASK_KILL_FILE=/var/lib/autotask-mcp/KILL
70
+ # Optional toolsets on top of core (core is always on): a comma list of service, records, finance,
71
+ # or all. An unknown name fails boot. Unset = core only.
72
+ # AUTOTASK_TOOLSETS=service,records,finance
73
+ # IANA time zone of the people asking (their local "today"), default UTC; not the tenant's or
74
+ # the server's zone. Autotask stores UTC; the zone is reported by
75
+ # autotask_tenant_status (time) and, when not UTC, named in the server instructions. Region/city
76
+ # names only (e.g. Australia/Melbourne), kept as written (only the case of a listed name is fixed);
77
+ # fixed offsets (+10:00, Etc/GMT-10) and names without a region (EST, Japan) are refused. An invalid name
78
+ # fails boot. Time entries stay calendar days (YYYY-MM-DD), not UTC bounds.
79
+ # AUTOTASK_USER_TIMEZONE=Australia/Sydney
80
+ # Removed in 0.6.0 (ignored with a boot warning, not honoured): AUTOTASK_READ_ONLY, AUTOTASK_WRITE_POLICY, AUTOTASK_WRITE_ALLOW,
81
+ # AUTOTASK_SECRET_READS. authenticate.* (a credential-minting read) is always refused.
82
+
83
+ # --- Per-tenant read cache (in-process; never cross-tenant; never on disk) ---
84
+ # on (default): the SDK's default-on caches apply to each pooled tenant client (read ~5 min,
85
+ # reference tables ~1 h, field metadata ~5 min); repeated reads of the same record are served
86
+ # from the tenant's cache until TTL expiry. off: `cache: false` is sent — every read re-dials
87
+ # the vendor.
88
+ AUTOTASK_CACHE=on
89
+
90
+ # --- Vendor budget (the server boots the SDK in the conservative `agent` profile; overrides here) ---
91
+ # AUTOTASK_RATE_LIMIT_PER_HOUR=8000
92
+ # AUTOTASK_MAX_CONCURRENT=3
93
+ # AUTOTASK_TIMEOUT_MS=20000
94
+ # AUTOTASK_MAX_RETRIES=1
95
+
96
+ # --- output_path (stdio transport only; the one file this server may write) ---
97
+ # The root the bounded query tools' output_path option may write into. UNSET = the option refuses
98
+ # (it is off by default). Absolute, already EXISTING directory only (the server never creates the
99
+ # root) and never the filesystem root; the caller passes a path RELATIVE to it, and a traversal or a
100
+ # symlink escape is refused BEFORE anything is created. See README, Query results.
101
+ # AUTOTASK_OUTPUT_DIR=/srv/autotask-output
102
+
103
+ # --- HTTP hardening (http transport only) ---
104
+ # Bind address (the --host flag): 127.0.0.1 by default. Off loopback, the two settings below are
105
+ # required or boot fails.
106
+ # MCP_HOST=127.0.0.1
107
+ # Host header values /mcp accepts (comma-separated hostnames; DNS-rebinding defence).
108
+ # AUTOTASK_HTTP_ALLOWED_HOSTS=mcp.example.com
109
+ # Browser Origin hostnames /mcp accepts (a request without an Origin always passes).
110
+ # AUTOTASK_HTTP_ALLOWED_ORIGINS=
111
+ # Caller auth: gateway (the gateway in front authenticates and rate-limits callers) or tokens
112
+ # (this process checks bearer tokens and rate-limits per principal). tokens is required for the
113
+ # operator profile on HTTP and when this process holds Autotask credentials on HTTP.
114
+ # AUTOTASK_HTTP_AUTH=gateway
115
+ # tokens mode: a JSON file mapping the lowercase hex SHA-256 of each token to
116
+ # { "principal": "...", "profile": "readonly"|"operator", "toolsets"?: [...], "runScope"?: {...} }.
117
+ # Every operator token needs a runScope ({"companyIds":[...]} or {"all":true}).
118
+ # AUTOTASK_HTTP_TOKENS_FILE=/run/secrets/autotask-mcp-tokens.json
119
+ # AUTOTASK_HTTP_RATE_PER_MIN=60
120
+
121
+ # --- Operational ---
122
+ PORT=8080
123
+ LOG_LEVEL=info
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Max Soukhomlinov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.