@lhremote/mcp 0.0.0 → 0.2.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.
Files changed (299) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +58 -0
  3. package/dist/helpers.d.ts +59 -0
  4. package/dist/helpers.d.ts.map +1 -0
  5. package/dist/helpers.js +90 -0
  6. package/dist/helpers.js.map +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/server.d.ts +6 -0
  12. package/dist/server.d.ts.map +1 -0
  13. package/dist/server.js +16 -0
  14. package/dist/server.js.map +1 -0
  15. package/dist/server.test.d.ts +2 -0
  16. package/dist/server.test.d.ts.map +1 -0
  17. package/dist/server.test.js +85 -0
  18. package/dist/server.test.js.map +1 -0
  19. package/dist/stdio.d.ts +7 -0
  20. package/dist/stdio.d.ts.map +1 -0
  21. package/dist/stdio.js +37 -0
  22. package/dist/stdio.js.map +1 -0
  23. package/dist/tools/campaign-add-action.d.ts +4 -0
  24. package/dist/tools/campaign-add-action.d.ts.map +1 -0
  25. package/dist/tools/campaign-add-action.js +63 -0
  26. package/dist/tools/campaign-add-action.js.map +1 -0
  27. package/dist/tools/campaign-add-action.test.d.ts +2 -0
  28. package/dist/tools/campaign-add-action.test.d.ts.map +1 -0
  29. package/dist/tools/campaign-add-action.test.js +107 -0
  30. package/dist/tools/campaign-add-action.test.js.map +1 -0
  31. package/dist/tools/campaign-create.d.ts +4 -0
  32. package/dist/tools/campaign-create.d.ts.map +1 -0
  33. package/dist/tools/campaign-create.js +44 -0
  34. package/dist/tools/campaign-create.js.map +1 -0
  35. package/dist/tools/campaign-create.test.d.ts +2 -0
  36. package/dist/tools/campaign-create.test.d.ts.map +1 -0
  37. package/dist/tools/campaign-create.test.js +163 -0
  38. package/dist/tools/campaign-create.test.js.map +1 -0
  39. package/dist/tools/campaign-delete.d.ts +4 -0
  40. package/dist/tools/campaign-delete.d.ts.map +1 -0
  41. package/dist/tools/campaign-delete.js +28 -0
  42. package/dist/tools/campaign-delete.js.map +1 -0
  43. package/dist/tools/campaign-delete.test.d.ts +2 -0
  44. package/dist/tools/campaign-delete.test.d.ts.map +1 -0
  45. package/dist/tools/campaign-delete.test.js +87 -0
  46. package/dist/tools/campaign-delete.test.js.map +1 -0
  47. package/dist/tools/campaign-exclude-add.d.ts +4 -0
  48. package/dist/tools/campaign-exclude-add.d.ts.map +1 -0
  49. package/dist/tools/campaign-exclude-add.js +44 -0
  50. package/dist/tools/campaign-exclude-add.js.map +1 -0
  51. package/dist/tools/campaign-exclude-add.test.d.ts +2 -0
  52. package/dist/tools/campaign-exclude-add.test.d.ts.map +1 -0
  53. package/dist/tools/campaign-exclude-add.test.js +161 -0
  54. package/dist/tools/campaign-exclude-add.test.js.map +1 -0
  55. package/dist/tools/campaign-exclude-list.d.ts +4 -0
  56. package/dist/tools/campaign-exclude-list.d.ts.map +1 -0
  57. package/dist/tools/campaign-exclude-list.js +40 -0
  58. package/dist/tools/campaign-exclude-list.js.map +1 -0
  59. package/dist/tools/campaign-exclude-list.test.d.ts +2 -0
  60. package/dist/tools/campaign-exclude-list.test.d.ts.map +1 -0
  61. package/dist/tools/campaign-exclude-list.test.js +183 -0
  62. package/dist/tools/campaign-exclude-list.test.js.map +1 -0
  63. package/dist/tools/campaign-exclude-remove.d.ts +4 -0
  64. package/dist/tools/campaign-exclude-remove.d.ts.map +1 -0
  65. package/dist/tools/campaign-exclude-remove.js +44 -0
  66. package/dist/tools/campaign-exclude-remove.js.map +1 -0
  67. package/dist/tools/campaign-exclude-remove.test.d.ts +2 -0
  68. package/dist/tools/campaign-exclude-remove.test.d.ts.map +1 -0
  69. package/dist/tools/campaign-exclude-remove.test.js +161 -0
  70. package/dist/tools/campaign-exclude-remove.test.js.map +1 -0
  71. package/dist/tools/campaign-export.d.ts +4 -0
  72. package/dist/tools/campaign-export.d.ts.map +1 -0
  73. package/dist/tools/campaign-export.js +30 -0
  74. package/dist/tools/campaign-export.js.map +1 -0
  75. package/dist/tools/campaign-export.test.d.ts +2 -0
  76. package/dist/tools/campaign-export.test.d.ts.map +1 -0
  77. package/dist/tools/campaign-export.test.js +80 -0
  78. package/dist/tools/campaign-export.test.js.map +1 -0
  79. package/dist/tools/campaign-get.d.ts +4 -0
  80. package/dist/tools/campaign-get.d.ts.map +1 -0
  81. package/dist/tools/campaign-get.js +25 -0
  82. package/dist/tools/campaign-get.js.map +1 -0
  83. package/dist/tools/campaign-get.test.d.ts +2 -0
  84. package/dist/tools/campaign-get.test.d.ts.map +1 -0
  85. package/dist/tools/campaign-get.test.js +90 -0
  86. package/dist/tools/campaign-get.test.js.map +1 -0
  87. package/dist/tools/campaign-list.d.ts +4 -0
  88. package/dist/tools/campaign-list.d.ts.map +1 -0
  89. package/dist/tools/campaign-list.js +25 -0
  90. package/dist/tools/campaign-list.js.map +1 -0
  91. package/dist/tools/campaign-list.test.d.ts +2 -0
  92. package/dist/tools/campaign-list.test.d.ts.map +1 -0
  93. package/dist/tools/campaign-list.test.js +90 -0
  94. package/dist/tools/campaign-list.test.js.map +1 -0
  95. package/dist/tools/campaign-move-next.d.ts +4 -0
  96. package/dist/tools/campaign-move-next.d.ts.map +1 -0
  97. package/dist/tools/campaign-move-next.js +40 -0
  98. package/dist/tools/campaign-move-next.js.map +1 -0
  99. package/dist/tools/campaign-move-next.test.d.ts +2 -0
  100. package/dist/tools/campaign-move-next.test.d.ts.map +1 -0
  101. package/dist/tools/campaign-move-next.test.js +138 -0
  102. package/dist/tools/campaign-move-next.test.js.map +1 -0
  103. package/dist/tools/campaign-remove-action.d.ts +4 -0
  104. package/dist/tools/campaign-remove-action.d.ts.map +1 -0
  105. package/dist/tools/campaign-remove-action.js +36 -0
  106. package/dist/tools/campaign-remove-action.js.map +1 -0
  107. package/dist/tools/campaign-remove-action.test.d.ts +2 -0
  108. package/dist/tools/campaign-remove-action.test.d.ts.map +1 -0
  109. package/dist/tools/campaign-remove-action.test.js +130 -0
  110. package/dist/tools/campaign-remove-action.test.js.map +1 -0
  111. package/dist/tools/campaign-reorder-actions.d.ts +4 -0
  112. package/dist/tools/campaign-reorder-actions.d.ts.map +1 -0
  113. package/dist/tools/campaign-reorder-actions.js +35 -0
  114. package/dist/tools/campaign-reorder-actions.js.map +1 -0
  115. package/dist/tools/campaign-reorder-actions.test.d.ts +2 -0
  116. package/dist/tools/campaign-reorder-actions.test.d.ts.map +1 -0
  117. package/dist/tools/campaign-reorder-actions.test.js +146 -0
  118. package/dist/tools/campaign-reorder-actions.test.js.map +1 -0
  119. package/dist/tools/campaign-retry.d.ts +4 -0
  120. package/dist/tools/campaign-retry.d.ts.map +1 -0
  121. package/dist/tools/campaign-retry.js +29 -0
  122. package/dist/tools/campaign-retry.js.map +1 -0
  123. package/dist/tools/campaign-retry.test.d.ts +2 -0
  124. package/dist/tools/campaign-retry.test.d.ts.map +1 -0
  125. package/dist/tools/campaign-retry.test.js +91 -0
  126. package/dist/tools/campaign-retry.test.js.map +1 -0
  127. package/dist/tools/campaign-start.d.ts +4 -0
  128. package/dist/tools/campaign-start.d.ts.map +1 -0
  129. package/dist/tools/campaign-start.js +35 -0
  130. package/dist/tools/campaign-start.js.map +1 -0
  131. package/dist/tools/campaign-start.test.d.ts +2 -0
  132. package/dist/tools/campaign-start.test.d.ts.map +1 -0
  133. package/dist/tools/campaign-start.test.js +115 -0
  134. package/dist/tools/campaign-start.test.js.map +1 -0
  135. package/dist/tools/campaign-statistics.d.ts +4 -0
  136. package/dist/tools/campaign-statistics.d.ts.map +1 -0
  137. package/dist/tools/campaign-statistics.js +41 -0
  138. package/dist/tools/campaign-statistics.js.map +1 -0
  139. package/dist/tools/campaign-statistics.test.d.ts +2 -0
  140. package/dist/tools/campaign-statistics.test.d.ts.map +1 -0
  141. package/dist/tools/campaign-statistics.test.js +177 -0
  142. package/dist/tools/campaign-statistics.test.js.map +1 -0
  143. package/dist/tools/campaign-status.d.ts +4 -0
  144. package/dist/tools/campaign-status.d.ts.map +1 -0
  145. package/dist/tools/campaign-status.js +47 -0
  146. package/dist/tools/campaign-status.js.map +1 -0
  147. package/dist/tools/campaign-status.test.d.ts +2 -0
  148. package/dist/tools/campaign-status.test.d.ts.map +1 -0
  149. package/dist/tools/campaign-status.test.js +275 -0
  150. package/dist/tools/campaign-status.test.js.map +1 -0
  151. package/dist/tools/campaign-stop.d.ts +4 -0
  152. package/dist/tools/campaign-stop.d.ts.map +1 -0
  153. package/dist/tools/campaign-stop.js +28 -0
  154. package/dist/tools/campaign-stop.js.map +1 -0
  155. package/dist/tools/campaign-stop.test.d.ts +2 -0
  156. package/dist/tools/campaign-stop.test.d.ts.map +1 -0
  157. package/dist/tools/campaign-stop.test.js +91 -0
  158. package/dist/tools/campaign-stop.test.js.map +1 -0
  159. package/dist/tools/campaign-update.d.ts +4 -0
  160. package/dist/tools/campaign-update.d.ts.map +1 -0
  161. package/dist/tools/campaign-update.js +43 -0
  162. package/dist/tools/campaign-update.js.map +1 -0
  163. package/dist/tools/campaign-update.test.d.ts +2 -0
  164. package/dist/tools/campaign-update.test.d.ts.map +1 -0
  165. package/dist/tools/campaign-update.test.js +117 -0
  166. package/dist/tools/campaign-update.test.js.map +1 -0
  167. package/dist/tools/check-replies.d.ts +4 -0
  168. package/dist/tools/check-replies.d.ts.map +1 -0
  169. package/dist/tools/check-replies.js +24 -0
  170. package/dist/tools/check-replies.js.map +1 -0
  171. package/dist/tools/check-replies.test.d.ts +2 -0
  172. package/dist/tools/check-replies.test.d.ts.map +1 -0
  173. package/dist/tools/check-replies.test.js +192 -0
  174. package/dist/tools/check-replies.test.js.map +1 -0
  175. package/dist/tools/check-status.d.ts +4 -0
  176. package/dist/tools/check-status.d.ts.map +1 -0
  177. package/dist/tools/check-status.js +19 -0
  178. package/dist/tools/check-status.js.map +1 -0
  179. package/dist/tools/check-status.test.d.ts +2 -0
  180. package/dist/tools/check-status.test.d.ts.map +1 -0
  181. package/dist/tools/check-status.test.js +88 -0
  182. package/dist/tools/check-status.test.js.map +1 -0
  183. package/dist/tools/describe-actions.d.ts +4 -0
  184. package/dist/tools/describe-actions.d.ts.map +1 -0
  185. package/dist/tools/describe-actions.js +30 -0
  186. package/dist/tools/describe-actions.js.map +1 -0
  187. package/dist/tools/describe-actions.test.d.ts +2 -0
  188. package/dist/tools/describe-actions.test.d.ts.map +1 -0
  189. package/dist/tools/describe-actions.test.js +120 -0
  190. package/dist/tools/describe-actions.test.js.map +1 -0
  191. package/dist/tools/find-app.d.ts +4 -0
  192. package/dist/tools/find-app.d.ts.map +1 -0
  193. package/dist/tools/find-app.js +20 -0
  194. package/dist/tools/find-app.js.map +1 -0
  195. package/dist/tools/find-app.test.d.ts +2 -0
  196. package/dist/tools/find-app.test.d.ts.map +1 -0
  197. package/dist/tools/find-app.test.js +65 -0
  198. package/dist/tools/find-app.test.js.map +1 -0
  199. package/dist/tools/import-people-from-urls.d.ts +4 -0
  200. package/dist/tools/import-people-from-urls.d.ts.map +1 -0
  201. package/dist/tools/import-people-from-urls.js +32 -0
  202. package/dist/tools/import-people-from-urls.js.map +1 -0
  203. package/dist/tools/import-people-from-urls.test.d.ts +2 -0
  204. package/dist/tools/import-people-from-urls.test.d.ts.map +1 -0
  205. package/dist/tools/import-people-from-urls.test.js +136 -0
  206. package/dist/tools/import-people-from-urls.test.js.map +1 -0
  207. package/dist/tools/index.d.ts +36 -0
  208. package/dist/tools/index.d.ts.map +1 -0
  209. package/dist/tools/index.js +70 -0
  210. package/dist/tools/index.js.map +1 -0
  211. package/dist/tools/index.test.d.ts +2 -0
  212. package/dist/tools/index.test.d.ts.map +1 -0
  213. package/dist/tools/index.test.js +22 -0
  214. package/dist/tools/index.test.js.map +1 -0
  215. package/dist/tools/launch-app.d.ts +4 -0
  216. package/dist/tools/launch-app.d.ts.map +1 -0
  217. package/dist/tools/launch-app.js +30 -0
  218. package/dist/tools/launch-app.js.map +1 -0
  219. package/dist/tools/launch-app.test.d.ts +2 -0
  220. package/dist/tools/launch-app.test.d.ts.map +1 -0
  221. package/dist/tools/launch-app.test.js +104 -0
  222. package/dist/tools/launch-app.test.js.map +1 -0
  223. package/dist/tools/list-accounts.d.ts +4 -0
  224. package/dist/tools/list-accounts.d.ts.map +1 -0
  225. package/dist/tools/list-accounts.js +29 -0
  226. package/dist/tools/list-accounts.js.map +1 -0
  227. package/dist/tools/list-accounts.test.d.ts +2 -0
  228. package/dist/tools/list-accounts.test.d.ts.map +1 -0
  229. package/dist/tools/list-accounts.test.js +101 -0
  230. package/dist/tools/list-accounts.test.js.map +1 -0
  231. package/dist/tools/query-messages.d.ts +4 -0
  232. package/dist/tools/query-messages.d.ts.map +1 -0
  233. package/dist/tools/query-messages.integration.test.d.ts +2 -0
  234. package/dist/tools/query-messages.integration.test.d.ts.map +1 -0
  235. package/dist/tools/query-messages.integration.test.js +119 -0
  236. package/dist/tools/query-messages.integration.test.js.map +1 -0
  237. package/dist/tools/query-messages.js +55 -0
  238. package/dist/tools/query-messages.js.map +1 -0
  239. package/dist/tools/query-messages.test.d.ts +2 -0
  240. package/dist/tools/query-messages.test.d.ts.map +1 -0
  241. package/dist/tools/query-messages.test.js +211 -0
  242. package/dist/tools/query-messages.test.js.map +1 -0
  243. package/dist/tools/query-profile.d.ts +4 -0
  244. package/dist/tools/query-profile.d.ts.map +1 -0
  245. package/dist/tools/query-profile.js +49 -0
  246. package/dist/tools/query-profile.js.map +1 -0
  247. package/dist/tools/query-profile.test.d.ts +2 -0
  248. package/dist/tools/query-profile.test.d.ts.map +1 -0
  249. package/dist/tools/query-profile.test.js +275 -0
  250. package/dist/tools/query-profile.test.js.map +1 -0
  251. package/dist/tools/query-profiles.d.ts +4 -0
  252. package/dist/tools/query-profiles.d.ts.map +1 -0
  253. package/dist/tools/query-profiles.js +67 -0
  254. package/dist/tools/query-profiles.js.map +1 -0
  255. package/dist/tools/query-profiles.test.d.ts +2 -0
  256. package/dist/tools/query-profiles.test.d.ts.map +1 -0
  257. package/dist/tools/query-profiles.test.js +239 -0
  258. package/dist/tools/query-profiles.test.js.map +1 -0
  259. package/dist/tools/quit-app.d.ts +4 -0
  260. package/dist/tools/quit-app.d.ts.map +1 -0
  261. package/dist/tools/quit-app.js +27 -0
  262. package/dist/tools/quit-app.js.map +1 -0
  263. package/dist/tools/quit-app.test.d.ts +2 -0
  264. package/dist/tools/quit-app.test.d.ts.map +1 -0
  265. package/dist/tools/quit-app.test.js +67 -0
  266. package/dist/tools/quit-app.test.js.map +1 -0
  267. package/dist/tools/scrape-messaging-history.d.ts +4 -0
  268. package/dist/tools/scrape-messaging-history.d.ts.map +1 -0
  269. package/dist/tools/scrape-messaging-history.js +19 -0
  270. package/dist/tools/scrape-messaging-history.js.map +1 -0
  271. package/dist/tools/scrape-messaging-history.test.d.ts +2 -0
  272. package/dist/tools/scrape-messaging-history.test.d.ts.map +1 -0
  273. package/dist/tools/scrape-messaging-history.test.js +114 -0
  274. package/dist/tools/scrape-messaging-history.test.js.map +1 -0
  275. package/dist/tools/start-instance.d.ts +4 -0
  276. package/dist/tools/start-instance.d.ts.map +1 -0
  277. package/dist/tools/start-instance.js +53 -0
  278. package/dist/tools/start-instance.js.map +1 -0
  279. package/dist/tools/start-instance.test.d.ts +2 -0
  280. package/dist/tools/start-instance.test.d.ts.map +1 -0
  281. package/dist/tools/start-instance.test.js +234 -0
  282. package/dist/tools/start-instance.test.js.map +1 -0
  283. package/dist/tools/stop-instance.d.ts +4 -0
  284. package/dist/tools/stop-instance.d.ts.map +1 -0
  285. package/dist/tools/stop-instance.js +47 -0
  286. package/dist/tools/stop-instance.js.map +1 -0
  287. package/dist/tools/stop-instance.test.d.ts +2 -0
  288. package/dist/tools/stop-instance.test.d.ts.map +1 -0
  289. package/dist/tools/stop-instance.test.js +179 -0
  290. package/dist/tools/stop-instance.test.js.map +1 -0
  291. package/dist/tools/testing/infrastructure-errors.d.ts +18 -0
  292. package/dist/tools/testing/infrastructure-errors.d.ts.map +1 -0
  293. package/dist/tools/testing/infrastructure-errors.js +59 -0
  294. package/dist/tools/testing/infrastructure-errors.js.map +1 -0
  295. package/dist/tools/testing/mock-server.d.ts +10 -0
  296. package/dist/tools/testing/mock-server.d.ts.map +1 -0
  297. package/dist/tools/testing/mock-server.js +33 -0
  298. package/dist/tools/testing/mock-server.js.map +1 -0
  299. package/package.json +38 -14
@@ -0,0 +1,24 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { checkReplies, } from "@lhremote/core";
4
+ import { z } from "zod";
5
+ import { cdpConnectionSchema, mcpCatchAll, mcpSuccess } from "../helpers.js";
6
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#check-replies | check-replies} MCP tool. */
7
+ export function registerCheckReplies(server) {
8
+ server.tool("check-replies", "Trigger LinkedHelper to check for new message replies on LinkedIn, then return any new messages found. If `since` is omitted, returns messages from the last 24 hours.", {
9
+ since: z
10
+ .string()
11
+ .optional()
12
+ .describe("ISO timestamp; only return messages after this time. If omitted, returns messages from the last 24 hours"),
13
+ ...cdpConnectionSchema,
14
+ }, async ({ since, cdpPort, cdpHost, allowRemote }) => {
15
+ try {
16
+ const result = await checkReplies({ since, cdpPort, cdpHost, allowRemote });
17
+ return mcpSuccess(JSON.stringify(result, null, 2));
18
+ }
19
+ catch (error) {
20
+ return mcpCatchAll(error, "Failed to check replies");
21
+ }
22
+ });
23
+ }
24
+ //# sourceMappingURL=check-replies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-replies.js","sourceRoot":"","sources":["../../src/tools/check-replies.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EACL,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7E,6GAA6G;AAC7G,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,eAAe,EACf,wKAAwK,EACxK;QACE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,0GAA0G,CAC3G;QACH,GAAG,mBAAmB;KACvB,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;YAC5E,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-replies.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-replies.test.d.ts","sourceRoot":"","sources":["../../src/tools/check-replies.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,192 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ vi.mock("@lhremote/core", async (importOriginal) => {
5
+ const actual = await importOriginal();
6
+ return {
7
+ ...actual,
8
+ checkReplies: vi.fn(),
9
+ };
10
+ });
11
+ import { AccountResolutionError, checkReplies, } from "@lhremote/core";
12
+ import { registerCheckReplies } from "./check-replies.js";
13
+ import { describeInfrastructureErrors } from "./testing/infrastructure-errors.js";
14
+ import { createMockServer } from "./testing/mock-server.js";
15
+ const MOCK_CONVERSATIONS = [
16
+ {
17
+ chatId: 123,
18
+ personId: 456,
19
+ personName: "Jane Doe",
20
+ messages: [
21
+ {
22
+ id: 789,
23
+ type: "MEMBER_TO_MEMBER",
24
+ text: "Thanks for reaching out!",
25
+ subject: null,
26
+ sendAt: "2025-01-15T10:30:00Z",
27
+ attachmentsCount: 0,
28
+ senderPersonId: 456,
29
+ senderFirstName: "Jane",
30
+ senderLastName: "Doe",
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ chatId: 124,
36
+ personId: 790,
37
+ personName: "John Smith",
38
+ messages: [
39
+ {
40
+ id: 791,
41
+ type: "MEMBER_TO_MEMBER",
42
+ text: "Let's schedule a call",
43
+ subject: null,
44
+ sendAt: "2025-01-15T11:00:00Z",
45
+ attachmentsCount: 0,
46
+ senderPersonId: 790,
47
+ senderFirstName: "John",
48
+ senderLastName: "Smith",
49
+ },
50
+ {
51
+ id: 792,
52
+ type: "MEMBER_TO_MEMBER",
53
+ text: "How about Thursday?",
54
+ subject: null,
55
+ sendAt: "2025-01-15T11:05:00Z",
56
+ attachmentsCount: 0,
57
+ senderPersonId: 790,
58
+ senderFirstName: "John",
59
+ senderLastName: "Smith",
60
+ },
61
+ ],
62
+ },
63
+ ];
64
+ describe("registerCheckReplies", () => {
65
+ beforeEach(() => {
66
+ vi.clearAllMocks();
67
+ });
68
+ afterEach(() => {
69
+ vi.restoreAllMocks();
70
+ });
71
+ it("registers a tool named check-replies", () => {
72
+ const { server } = createMockServer();
73
+ registerCheckReplies(server);
74
+ expect(server.tool).toHaveBeenCalledOnce();
75
+ expect(server.tool).toHaveBeenCalledWith("check-replies", expect.any(String), expect.any(Object), expect.any(Function));
76
+ });
77
+ it("returns new messages on success", async () => {
78
+ const { server, getHandler } = createMockServer();
79
+ registerCheckReplies(server);
80
+ vi.mocked(checkReplies).mockResolvedValue({
81
+ newMessages: MOCK_CONVERSATIONS,
82
+ totalNew: 3,
83
+ checkedAt: "2025-01-15T12:00:00.000Z",
84
+ });
85
+ const handler = getHandler("check-replies");
86
+ const result = await handler({ cdpPort: 9222 });
87
+ expect(result).toEqual({
88
+ content: [
89
+ {
90
+ type: "text",
91
+ text: JSON.stringify({
92
+ newMessages: MOCK_CONVERSATIONS,
93
+ totalNew: 3,
94
+ checkedAt: "2025-01-15T12:00:00.000Z",
95
+ }, null, 2),
96
+ },
97
+ ],
98
+ });
99
+ });
100
+ it("passes correct arguments to operation", async () => {
101
+ const { server, getHandler } = createMockServer();
102
+ registerCheckReplies(server);
103
+ vi.mocked(checkReplies).mockResolvedValue({
104
+ newMessages: [],
105
+ totalNew: 0,
106
+ checkedAt: "2025-01-15T12:00:00.000Z",
107
+ });
108
+ const handler = getHandler("check-replies");
109
+ await handler({ since: "2025-01-14T00:00:00Z", cdpPort: 9222 });
110
+ expect(checkReplies).toHaveBeenCalledWith(expect.objectContaining({ since: "2025-01-14T00:00:00Z", cdpPort: 9222 }));
111
+ });
112
+ it("passes since as undefined when omitted", async () => {
113
+ const { server, getHandler } = createMockServer();
114
+ registerCheckReplies(server);
115
+ vi.mocked(checkReplies).mockResolvedValue({
116
+ newMessages: [],
117
+ totalNew: 0,
118
+ checkedAt: "2025-01-15T12:00:00.000Z",
119
+ });
120
+ const handler = getHandler("check-replies");
121
+ await handler({ cdpPort: 9222 });
122
+ expect(checkReplies).toHaveBeenCalledWith(expect.objectContaining({ cdpPort: 9222 }));
123
+ });
124
+ it("returns empty results when no new messages", async () => {
125
+ const { server, getHandler } = createMockServer();
126
+ registerCheckReplies(server);
127
+ vi.mocked(checkReplies).mockResolvedValue({
128
+ newMessages: [],
129
+ totalNew: 0,
130
+ checkedAt: "2025-01-15T12:00:00.000Z",
131
+ });
132
+ const handler = getHandler("check-replies");
133
+ const result = await handler({ cdpPort: 9222 });
134
+ expect(result).toEqual({
135
+ content: [
136
+ {
137
+ type: "text",
138
+ text: JSON.stringify({
139
+ newMessages: [],
140
+ totalNew: 0,
141
+ checkedAt: "2025-01-15T12:00:00.000Z",
142
+ }, null, 2),
143
+ },
144
+ ],
145
+ });
146
+ });
147
+ it("returns error when no accounts found", async () => {
148
+ const { server, getHandler } = createMockServer();
149
+ registerCheckReplies(server);
150
+ vi.mocked(checkReplies).mockRejectedValue(new AccountResolutionError("no-accounts"));
151
+ const handler = getHandler("check-replies");
152
+ const result = await handler({ cdpPort: 9222 });
153
+ expect(result).toEqual({
154
+ isError: true,
155
+ content: [{ type: "text", text: "No accounts found." }],
156
+ });
157
+ });
158
+ it("returns error when multiple accounts found", async () => {
159
+ const { server, getHandler } = createMockServer();
160
+ registerCheckReplies(server);
161
+ vi.mocked(checkReplies).mockRejectedValue(new AccountResolutionError("multiple-accounts"));
162
+ const handler = getHandler("check-replies");
163
+ const result = await handler({ cdpPort: 9222 });
164
+ expect(result).toEqual({
165
+ isError: true,
166
+ content: [
167
+ {
168
+ type: "text",
169
+ text: "Multiple accounts found. Cannot determine which instance to use.",
170
+ },
171
+ ],
172
+ });
173
+ });
174
+ it("returns error on unexpected failure", async () => {
175
+ const { server, getHandler } = createMockServer();
176
+ registerCheckReplies(server);
177
+ vi.mocked(checkReplies).mockRejectedValue(new Error("action timed out"));
178
+ const handler = getHandler("check-replies");
179
+ const result = await handler({ cdpPort: 9222 });
180
+ expect(result).toEqual({
181
+ isError: true,
182
+ content: [
183
+ {
184
+ type: "text",
185
+ text: "Failed to check replies: action timed out",
186
+ },
187
+ ],
188
+ });
189
+ });
190
+ describeInfrastructureErrors(registerCheckReplies, "check-replies", () => ({ cdpPort: 9222 }), (error) => vi.mocked(checkReplies).mockRejectedValue(error), "Failed to check replies");
191
+ });
192
+ //# sourceMappingURL=check-replies.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-replies.test.js","sourceRoot":"","sources":["../../src/tools/check-replies.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,EAAE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gB,EAAE,CAAC;QAClD,oBAAoB,CAAC,MAAM,CAAC,CAAC;QAE7B,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,CACvC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAC9B,CAAC;QAEF,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAEhD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,2CAA2C;iBAClD;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,4BAA4B,CAC1B,oBAAoB,EACpB,eAAe,EACf,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EACzB,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC3D,yBAAyB,CAC1B,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#check-status | check-status} MCP tool. */
3
+ export declare function registerCheckStatus(server: McpServer): void;
4
+ //# sourceMappingURL=check-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-status.d.ts","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,2GAA2G;AAC3G,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiB3D"}
@@ -0,0 +1,19 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { checkStatus } from "@lhremote/core";
4
+ import { buildCdpOptions, cdpConnectionSchema, mcpCatchAll, mcpSuccess } from "../helpers.js";
5
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#check-status | check-status} MCP tool. */
6
+ export function registerCheckStatus(server) {
7
+ server.tool("check-status", "Check LinkedHelper connection status, running instances, and database health", {
8
+ ...cdpConnectionSchema,
9
+ }, async ({ cdpPort, cdpHost, allowRemote }) => {
10
+ try {
11
+ const report = await checkStatus(cdpPort, buildCdpOptions({ cdpHost, allowRemote }));
12
+ return mcpSuccess(JSON.stringify(report, null, 2));
13
+ }
14
+ catch (error) {
15
+ return mcpCatchAll(error, "Failed to check status");
16
+ }
17
+ });
18
+ }
19
+ //# sourceMappingURL=check-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-status.js","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE9F,2GAA2G;AAC3G,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,cAAc,EACd,8EAA8E,EAC9E;QACE,GAAG,mBAAmB;KACvB,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;YAErF,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-status.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-status.test.d.ts","sourceRoot":"","sources":["../../src/tools/check-status.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ vi.mock("@lhremote/core", async (importOriginal) => {
5
+ const actual = await importOriginal();
6
+ return {
7
+ ...actual,
8
+ checkStatus: vi.fn(),
9
+ };
10
+ });
11
+ import { checkStatus } from "@lhremote/core";
12
+ import { registerCheckStatus } from "./check-status.js";
13
+ import { createMockServer } from "./testing/mock-server.js";
14
+ const mockedCheckStatus = vi.mocked(checkStatus);
15
+ describe("registerCheckStatus", () => {
16
+ beforeEach(() => {
17
+ vi.clearAllMocks();
18
+ });
19
+ afterEach(() => {
20
+ vi.restoreAllMocks();
21
+ });
22
+ it("registers a tool named check-status", () => {
23
+ const { server } = createMockServer();
24
+ registerCheckStatus(server);
25
+ expect(server.tool).toHaveBeenCalledOnce();
26
+ expect(server.tool).toHaveBeenCalledWith("check-status", expect.any(String), expect.any(Object), expect.any(Function));
27
+ });
28
+ it("returns status report as JSON", async () => {
29
+ const { server, getHandler } = createMockServer();
30
+ registerCheckStatus(server);
31
+ const report = {
32
+ launcher: { reachable: true, port: 9222 },
33
+ instances: [
34
+ { accountId: 1, accountName: "Alice", cdpPort: 54321 },
35
+ ],
36
+ databases: [
37
+ { accountId: 1, path: "/path/to/db.db", profileCount: 100 },
38
+ ],
39
+ };
40
+ mockedCheckStatus.mockResolvedValue(report);
41
+ const handler = getHandler("check-status");
42
+ const result = (await handler({ cdpPort: 9222 }));
43
+ expect(JSON.parse(result.content[0].text)).toEqual(report);
44
+ });
45
+ it("returns status when launcher is not reachable", async () => {
46
+ const { server, getHandler } = createMockServer();
47
+ registerCheckStatus(server);
48
+ const report = {
49
+ launcher: { reachable: false, port: 9222 },
50
+ instances: [],
51
+ databases: [],
52
+ };
53
+ mockedCheckStatus.mockResolvedValue(report);
54
+ const handler = getHandler("check-status");
55
+ const result = (await handler({ cdpPort: 9222 }));
56
+ const parsed = JSON.parse(result.content[0].text);
57
+ expect(parsed.launcher.reachable).toBe(false);
58
+ });
59
+ it("passes cdpPort to checkStatus", async () => {
60
+ const { server, getHandler } = createMockServer();
61
+ registerCheckStatus(server);
62
+ mockedCheckStatus.mockResolvedValue({
63
+ launcher: { reachable: false, port: 4567 },
64
+ instances: [],
65
+ databases: [],
66
+ });
67
+ const handler = getHandler("check-status");
68
+ await handler({ cdpPort: 4567 });
69
+ expect(mockedCheckStatus).toHaveBeenCalledWith(4567, {});
70
+ });
71
+ it("returns error when checkStatus throws", async () => {
72
+ const { server, getHandler } = createMockServer();
73
+ registerCheckStatus(server);
74
+ mockedCheckStatus.mockRejectedValue(new Error("unexpected failure"));
75
+ const handler = getHandler("check-status");
76
+ const result = await handler({ cdpPort: 9222 });
77
+ expect(result).toEqual({
78
+ isError: true,
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: "Failed to check status: unexpected failure",
83
+ },
84
+ ],
85
+ });
86
+ });
87
+ });
88
+ //# sourceMappingURL=check-status.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-status.test.js","sourceRoot":"","sources":["../../src/tools/check-status.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,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AAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,4CAA4C;iBACnD;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#describe-actions | describe-actions} MCP tool. */
3
+ export declare function registerDescribeActions(server: McpServer): void;
4
+ //# sourceMappingURL=describe-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-actions.d.ts","sourceRoot":"","sources":["../../src/tools/describe-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,mHAAmH;AACnH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+B/D"}
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { getActionTypeCatalog, getActionTypeInfo } from "@lhremote/core";
4
+ import { z } from "zod";
5
+ import { mcpError, mcpSuccess } from "../helpers.js";
6
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#describe-actions | describe-actions} MCP tool. */
7
+ export function registerDescribeActions(server) {
8
+ server.tool("describe-actions", "List available LinkedHelper action types with descriptions and configuration schemas. Use this to discover what actions can be included in campaigns.", {
9
+ category: z
10
+ .enum(["people", "messaging", "engagement", "crm", "workflow", "all"])
11
+ .optional()
12
+ .default("all")
13
+ .describe("Filter by action category"),
14
+ actionType: z
15
+ .string()
16
+ .optional()
17
+ .describe("Get detailed info for a specific action type"),
18
+ }, async ({ category, actionType }) => {
19
+ if (actionType !== undefined) {
20
+ const info = getActionTypeInfo(actionType);
21
+ if (info === undefined) {
22
+ return mcpError(`Unknown action type: ${actionType}`);
23
+ }
24
+ return mcpSuccess(JSON.stringify(info, null, 2));
25
+ }
26
+ const catalog = getActionTypeCatalog(category === "all" ? undefined : category);
27
+ return mcpSuccess(JSON.stringify(catalog, null, 2));
28
+ });
29
+ }
30
+ //# sourceMappingURL=describe-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-actions.js","sourceRoot":"","sources":["../../src/tools/describe-actions.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAErD,mHAAmH;AACnH,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,uJAAuJ,EACvJ;QACE,QAAQ,EAAE,CAAC;aACR,IAAI,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;aACrE,QAAQ,EAAE;aACV,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,2BAA2B,CAAC;QACxC,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8CAA8C,CAAC;KAC5D,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;QACjC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;YAC3C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,QAAQ,CAAC,wBAAwB,UAAU,EAAE,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,MAAM,OAAO,GAAG,oBAAoB,CAClC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAC1C,CAAC;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=describe-actions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-actions.test.d.ts","sourceRoot":"","sources":["../../src/tools/describe-actions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,120 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ vi.mock("@lhremote/core", async (importOriginal) => {
5
+ const actual = await importOriginal();
6
+ return {
7
+ ...actual,
8
+ getActionTypeCatalog: vi.fn(),
9
+ getActionTypeInfo: vi.fn(),
10
+ };
11
+ });
12
+ import { getActionTypeCatalog, getActionTypeInfo, } from "@lhremote/core";
13
+ import { registerDescribeActions } from "./describe-actions.js";
14
+ import { createMockServer } from "./testing/mock-server.js";
15
+ const mockedGetActionTypeCatalog = vi.mocked(getActionTypeCatalog);
16
+ const mockedGetActionTypeInfo = vi.mocked(getActionTypeInfo);
17
+ describe("registerDescribeActions", () => {
18
+ beforeEach(() => {
19
+ vi.clearAllMocks();
20
+ });
21
+ afterEach(() => {
22
+ vi.restoreAllMocks();
23
+ });
24
+ it("registers a tool named describe-actions", () => {
25
+ const { server } = createMockServer();
26
+ registerDescribeActions(server);
27
+ expect(server.tool).toHaveBeenCalledOnce();
28
+ expect(server.tool).toHaveBeenCalledWith("describe-actions", expect.any(String), expect.any(Object), expect.any(Function));
29
+ });
30
+ it("returns full catalog when no params", async () => {
31
+ const { server, getHandler } = createMockServer();
32
+ registerDescribeActions(server);
33
+ const catalog = {
34
+ actionTypes: [
35
+ {
36
+ name: "VisitAndExtract",
37
+ description: "Visit a LinkedIn profile and extract data.",
38
+ category: "people",
39
+ configSchema: {},
40
+ },
41
+ {
42
+ name: "Follow",
43
+ description: "Follow a LinkedIn profile.",
44
+ category: "engagement",
45
+ configSchema: {},
46
+ },
47
+ ],
48
+ };
49
+ mockedGetActionTypeCatalog.mockReturnValue(catalog);
50
+ const handler = getHandler("describe-actions");
51
+ const result = (await handler({ category: "all" }));
52
+ expect(mockedGetActionTypeCatalog).toHaveBeenCalledWith(undefined);
53
+ expect(JSON.parse(result.content[0].text)).toEqual(catalog);
54
+ });
55
+ it("filters by category", async () => {
56
+ const { server, getHandler } = createMockServer();
57
+ registerDescribeActions(server);
58
+ const catalog = {
59
+ actionTypes: [
60
+ {
61
+ name: "Follow",
62
+ description: "Follow a LinkedIn profile.",
63
+ category: "engagement",
64
+ configSchema: {},
65
+ },
66
+ ],
67
+ };
68
+ mockedGetActionTypeCatalog.mockReturnValue(catalog);
69
+ const handler = getHandler("describe-actions");
70
+ const result = (await handler({ category: "engagement" }));
71
+ expect(mockedGetActionTypeCatalog).toHaveBeenCalledWith("engagement");
72
+ expect(JSON.parse(result.content[0].text)).toEqual(catalog);
73
+ });
74
+ it("returns specific action type info", async () => {
75
+ const { server, getHandler } = createMockServer();
76
+ registerDescribeActions(server);
77
+ const info = {
78
+ name: "VisitAndExtract",
79
+ description: "Visit a LinkedIn profile and extract data.",
80
+ category: "people",
81
+ configSchema: {
82
+ extractCurrentOrganizations: {
83
+ type: "boolean",
84
+ required: false,
85
+ description: "Whether to extract full profile data.",
86
+ default: true,
87
+ },
88
+ },
89
+ example: { extractCurrentOrganizations: true },
90
+ };
91
+ mockedGetActionTypeInfo.mockReturnValue(info);
92
+ const handler = getHandler("describe-actions");
93
+ const result = (await handler({
94
+ category: "all",
95
+ actionType: "VisitAndExtract",
96
+ }));
97
+ expect(mockedGetActionTypeInfo).toHaveBeenCalledWith("VisitAndExtract");
98
+ expect(JSON.parse(result.content[0].text)).toEqual(info);
99
+ });
100
+ it("returns error for unknown action type", async () => {
101
+ const { server, getHandler } = createMockServer();
102
+ registerDescribeActions(server);
103
+ mockedGetActionTypeInfo.mockReturnValue(undefined);
104
+ const handler = getHandler("describe-actions");
105
+ const result = await handler({
106
+ category: "all",
107
+ actionType: "NonExistent",
108
+ });
109
+ expect(result).toEqual({
110
+ isError: true,
111
+ content: [
112
+ {
113
+ type: "text",
114
+ text: "Unknown action type: NonExistent",
115
+ },
116
+ ],
117
+ });
118
+ });
119
+ });
120
+ //# sourceMappingURL=describe-actions.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-actions.test.js","sourceRoot":"","sources":["../../src/tools/describe-actions.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IACjD,MAAM,MAAM,GAAG,MAAM,cAAc,EAAmC,CAAC;IACvE,OAAO;QACL,GAAG,MAAM;QACT,oBAAoB,EAAE,EAAE,CAAC,EAAE,EAAE;QAC7B,iBAAiB,EAAE,EAAE,CAAC,EAAE,EAAE;KAC3B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAGL,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,0BAA0B,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACnE,MAAM,uBAAuB,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;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AM,CAAC,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kCAAkC;iBACzC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#find-app | find-app} MCP tool. */
3
+ export declare function registerFindApp(server: McpServer): void;
4
+ //# sourceMappingURL=find-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-app.d.ts","sourceRoot":"","sources":["../../src/tools/find-app.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmBvD"}
@@ -0,0 +1,20 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { findApp } from "@lhremote/core";
4
+ import { mcpCatchAll, mcpSuccess } from "../helpers.js";
5
+ /** Register the {@link https://github.com/alexey-pelykh/lhremote#find-app | find-app} MCP tool. */
6
+ export function registerFindApp(server) {
7
+ server.tool("find-app", "Detect running LinkedHelper application instances and their CDP connection details", {}, async () => {
8
+ try {
9
+ const apps = await findApp();
10
+ if (apps.length === 0) {
11
+ return mcpSuccess("No running LinkedHelper instances found");
12
+ }
13
+ return mcpSuccess(JSON.stringify(apps, null, 2));
14
+ }
15
+ catch (error) {
16
+ return mcpCatchAll(error, "Failed to find LinkedHelper");
17
+ }
18
+ });
19
+ }
20
+ //# sourceMappingURL=find-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-app.js","sourceRoot":"","sources":["../../src/tools/find-app.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,IAAI,CACT,UAAU,EACV,oFAAoF,EACpF,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE,CAAC;YAE7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtB,OAAO,UAAU,CAAC,yCAAyC,CAAC,CAAC;YAC/D,CAAC;YAED,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=find-app.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-app.test.d.ts","sourceRoot":"","sources":["../../src/tools/find-app.test.ts"],"names":[],"mappings":""}