@tryfinch/finch-api-mcp 6.31.0 → 8.0.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 (549) hide show
  1. package/README.md +46 -259
  2. package/code-tool-types.d.mts +16 -0
  3. package/code-tool-types.d.mts.map +1 -0
  4. package/code-tool-types.d.ts +16 -0
  5. package/code-tool-types.d.ts.map +1 -0
  6. package/code-tool-types.js +4 -0
  7. package/code-tool-types.js.map +1 -0
  8. package/code-tool-types.mjs +3 -0
  9. package/code-tool-types.mjs.map +1 -0
  10. package/code-tool.d.mts +12 -0
  11. package/code-tool.d.mts.map +1 -0
  12. package/code-tool.d.ts +12 -0
  13. package/code-tool.d.ts.map +1 -0
  14. package/code-tool.js +55 -0
  15. package/code-tool.js.map +1 -0
  16. package/code-tool.mjs +52 -0
  17. package/code-tool.mjs.map +1 -0
  18. package/docs-search-tool.d.mts +50 -0
  19. package/docs-search-tool.d.mts.map +1 -0
  20. package/docs-search-tool.d.ts +50 -0
  21. package/docs-search-tool.d.ts.map +1 -0
  22. package/docs-search-tool.js +51 -0
  23. package/docs-search-tool.js.map +1 -0
  24. package/docs-search-tool.mjs +47 -0
  25. package/docs-search-tool.mjs.map +1 -0
  26. package/headers.d.mts +4 -0
  27. package/headers.d.mts.map +1 -0
  28. package/headers.d.ts +4 -0
  29. package/headers.d.ts.map +1 -0
  30. package/headers.js +31 -0
  31. package/headers.js.map +1 -0
  32. package/headers.mjs +27 -0
  33. package/headers.mjs.map +1 -0
  34. package/http.d.mts +9 -0
  35. package/http.d.mts.map +1 -0
  36. package/http.d.ts +9 -0
  37. package/http.d.ts.map +1 -0
  38. package/http.js +91 -0
  39. package/http.js.map +1 -0
  40. package/http.mjs +83 -0
  41. package/http.mjs.map +1 -0
  42. package/index.d.mts +1 -0
  43. package/index.d.ts +1 -0
  44. package/index.js +14 -45
  45. package/index.js.map +1 -1
  46. package/index.mjs +17 -47
  47. package/index.mjs.map +1 -1
  48. package/options.d.mts +10 -10
  49. package/options.d.mts.map +1 -1
  50. package/options.d.ts +10 -10
  51. package/options.d.ts.map +1 -1
  52. package/options.js +42 -307
  53. package/options.js.map +1 -1
  54. package/options.mjs +40 -306
  55. package/options.mjs.map +1 -1
  56. package/package.json +121 -12
  57. package/server.d.mts +11 -19
  58. package/server.d.mts.map +1 -1
  59. package/server.d.ts +11 -19
  60. package/server.d.ts.map +1 -1
  61. package/server.js +67 -49
  62. package/server.js.map +1 -1
  63. package/server.mjs +65 -47
  64. package/server.mjs.map +1 -1
  65. package/src/code-tool-types.ts +18 -0
  66. package/src/code-tool.ts +65 -0
  67. package/src/docs-search-tool.ts +59 -0
  68. package/src/headers.ts +35 -0
  69. package/src/http.ts +109 -0
  70. package/src/index.ts +21 -62
  71. package/src/options.ts +57 -326
  72. package/src/server.ts +85 -65
  73. package/src/stdio.ts +12 -0
  74. package/src/types.ts +115 -0
  75. package/stdio.d.mts +2 -0
  76. package/stdio.d.mts.map +1 -0
  77. package/stdio.d.ts +2 -0
  78. package/stdio.d.ts.map +1 -0
  79. package/stdio.js +14 -0
  80. package/stdio.js.map +1 -0
  81. package/stdio.mjs +10 -0
  82. package/stdio.mjs.map +1 -0
  83. package/types.d.mts +52 -0
  84. package/types.d.mts.map +1 -0
  85. package/types.d.ts +52 -0
  86. package/types.d.ts.map +1 -0
  87. package/types.js +58 -0
  88. package/types.js.map +1 -0
  89. package/types.mjs +53 -0
  90. package/types.mjs.map +1 -0
  91. package/compat.d.mts +0 -52
  92. package/compat.d.mts.map +0 -1
  93. package/compat.d.ts +0 -52
  94. package/compat.d.ts.map +0 -1
  95. package/compat.js +0 -342
  96. package/compat.js.map +0 -1
  97. package/compat.mjs +0 -332
  98. package/compat.mjs.map +0 -1
  99. package/dynamic-tools.d.mts +0 -12
  100. package/dynamic-tools.d.mts.map +0 -1
  101. package/dynamic-tools.d.ts +0 -12
  102. package/dynamic-tools.d.ts.map +0 -1
  103. package/dynamic-tools.js +0 -133
  104. package/dynamic-tools.js.map +0 -1
  105. package/dynamic-tools.mjs +0 -130
  106. package/dynamic-tools.mjs.map +0 -1
  107. package/src/compat.ts +0 -429
  108. package/src/dynamic-tools.ts +0 -152
  109. package/src/tools/access-tokens/create-access-tokens.ts +0 -40
  110. package/src/tools/account/disconnect-account.ts +0 -26
  111. package/src/tools/account/introspect-account.ts +0 -26
  112. package/src/tools/connect/sessions/new-connect-sessions.ts +0 -83
  113. package/src/tools/connect/sessions/reauthenticate-connect-sessions.ts +0 -60
  114. package/src/tools/hris/benefits/create-hris-benefits.ts +0 -102
  115. package/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts +0 -101
  116. package/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts +0 -31
  117. package/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts +0 -36
  118. package/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts +0 -38
  119. package/src/tools/hris/benefits/list-hris-benefits.ts +0 -26
  120. package/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts +0 -26
  121. package/src/tools/hris/benefits/retrieve-hris-benefits.ts +0 -31
  122. package/src/tools/hris/benefits/update-hris-benefits.ts +0 -35
  123. package/src/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.ts +0 -58
  124. package/src/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.ts +0 -78
  125. package/src/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.ts +0 -32
  126. package/src/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.ts +0 -27
  127. package/src/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.ts +0 -35
  128. package/src/tools/hris/company/retrieve-hris-company.ts +0 -26
  129. package/src/tools/hris/directory/list-hris-directory.ts +0 -36
  130. package/src/tools/hris/directory/list-individuals-hris-directory.ts +0 -36
  131. package/src/tools/hris/documents/list-hris-documents.ts +0 -53
  132. package/src/tools/hris/documents/retreive-hris-documents.ts +0 -32
  133. package/src/tools/hris/employments/retrieve-many-hris-employments.ts +0 -43
  134. package/src/tools/hris/individuals/retrieve-many-hris-individuals.ts +0 -52
  135. package/src/tools/hris/pay-statements/retrieve-many-hris-pay-statements.ts +0 -51
  136. package/src/tools/hris/payments/list-hris-payments.ts +0 -38
  137. package/src/tools/index.ts +0 -175
  138. package/src/tools/jobs/automated/create-jobs-automated.ts +0 -59
  139. package/src/tools/jobs/automated/list-jobs-automated.ts +0 -37
  140. package/src/tools/jobs/automated/retrieve-jobs-automated.ts +0 -31
  141. package/src/tools/jobs/manual/retrieve-jobs-manual.ts +0 -32
  142. package/src/tools/payroll/pay-groups/list-payroll-pay-groups.ts +0 -37
  143. package/src/tools/payroll/pay-groups/retrieve-payroll-pay-groups.ts +0 -31
  144. package/src/tools/providers/list-providers.ts +0 -26
  145. package/src/tools/request-forwarding/forward-request-forwarding.ts +0 -54
  146. package/src/tools/sandbox/company/update-sandbox-company.ts +0 -164
  147. package/src/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.ts +0 -48
  148. package/src/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.ts +0 -39
  149. package/src/tools/sandbox/connections/create-sandbox-connections.ts +0 -48
  150. package/src/tools/sandbox/directory/create-sandbox-directory.ts +0 -303
  151. package/src/tools/sandbox/employment/update-sandbox-employment.ts +0 -223
  152. package/src/tools/sandbox/individual/update-sandbox-individual.ts +0 -154
  153. package/src/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.ts +0 -26
  154. package/src/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.ts +0 -36
  155. package/src/tools/sandbox/jobs/create-sandbox-jobs.ts +0 -33
  156. package/src/tools/sandbox/payment/create-sandbox-payment.ts +0 -308
  157. package/src/tools.ts +0 -1
  158. package/tools/access-tokens/create-access-tokens.d.mts +0 -32
  159. package/tools/access-tokens/create-access-tokens.d.mts.map +0 -1
  160. package/tools/access-tokens/create-access-tokens.d.ts +0 -32
  161. package/tools/access-tokens/create-access-tokens.d.ts.map +0 -1
  162. package/tools/access-tokens/create-access-tokens.js +0 -37
  163. package/tools/access-tokens/create-access-tokens.js.map +0 -1
  164. package/tools/access-tokens/create-access-tokens.mjs +0 -33
  165. package/tools/access-tokens/create-access-tokens.mjs.map +0 -1
  166. package/tools/account/disconnect-account.d.mts +0 -32
  167. package/tools/account/disconnect-account.d.mts.map +0 -1
  168. package/tools/account/disconnect-account.d.ts +0 -32
  169. package/tools/account/disconnect-account.d.ts.map +0 -1
  170. package/tools/account/disconnect-account.js +0 -23
  171. package/tools/account/disconnect-account.js.map +0 -1
  172. package/tools/account/disconnect-account.mjs +0 -19
  173. package/tools/account/disconnect-account.mjs.map +0 -1
  174. package/tools/account/introspect-account.d.mts +0 -32
  175. package/tools/account/introspect-account.d.mts.map +0 -1
  176. package/tools/account/introspect-account.d.ts +0 -32
  177. package/tools/account/introspect-account.d.ts.map +0 -1
  178. package/tools/account/introspect-account.js +0 -23
  179. package/tools/account/introspect-account.js.map +0 -1
  180. package/tools/account/introspect-account.mjs +0 -19
  181. package/tools/account/introspect-account.mjs.map +0 -1
  182. package/tools/connect/sessions/new-connect-sessions.d.mts +0 -32
  183. package/tools/connect/sessions/new-connect-sessions.d.mts.map +0 -1
  184. package/tools/connect/sessions/new-connect-sessions.d.ts +0 -32
  185. package/tools/connect/sessions/new-connect-sessions.d.ts.map +0 -1
  186. package/tools/connect/sessions/new-connect-sessions.js +0 -80
  187. package/tools/connect/sessions/new-connect-sessions.js.map +0 -1
  188. package/tools/connect/sessions/new-connect-sessions.mjs +0 -76
  189. package/tools/connect/sessions/new-connect-sessions.mjs.map +0 -1
  190. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts +0 -32
  191. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts.map +0 -1
  192. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts +0 -32
  193. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts.map +0 -1
  194. package/tools/connect/sessions/reauthenticate-connect-sessions.js +0 -57
  195. package/tools/connect/sessions/reauthenticate-connect-sessions.js.map +0 -1
  196. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs +0 -53
  197. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs.map +0 -1
  198. package/tools/hris/benefits/create-hris-benefits.d.mts +0 -32
  199. package/tools/hris/benefits/create-hris-benefits.d.mts.map +0 -1
  200. package/tools/hris/benefits/create-hris-benefits.d.ts +0 -32
  201. package/tools/hris/benefits/create-hris-benefits.d.ts.map +0 -1
  202. package/tools/hris/benefits/create-hris-benefits.js +0 -97
  203. package/tools/hris/benefits/create-hris-benefits.js.map +0 -1
  204. package/tools/hris/benefits/create-hris-benefits.mjs +0 -93
  205. package/tools/hris/benefits/create-hris-benefits.mjs.map +0 -1
  206. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts +0 -32
  207. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts.map +0 -1
  208. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts +0 -32
  209. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts.map +0 -1
  210. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js +0 -94
  211. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js.map +0 -1
  212. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs +0 -90
  213. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs.map +0 -1
  214. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts +0 -32
  215. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts.map +0 -1
  216. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts +0 -32
  217. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts.map +0 -1
  218. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js +0 -28
  219. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js.map +0 -1
  220. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs +0 -24
  221. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs.map +0 -1
  222. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts +0 -32
  223. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts.map +0 -1
  224. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts +0 -32
  225. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts.map +0 -1
  226. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js +0 -32
  227. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js.map +0 -1
  228. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs +0 -28
  229. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs.map +0 -1
  230. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts +0 -32
  231. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts.map +0 -1
  232. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts +0 -32
  233. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts.map +0 -1
  234. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js +0 -35
  235. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js.map +0 -1
  236. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs +0 -31
  237. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs.map +0 -1
  238. package/tools/hris/benefits/list-hris-benefits.d.mts +0 -32
  239. package/tools/hris/benefits/list-hris-benefits.d.mts.map +0 -1
  240. package/tools/hris/benefits/list-hris-benefits.d.ts +0 -32
  241. package/tools/hris/benefits/list-hris-benefits.d.ts.map +0 -1
  242. package/tools/hris/benefits/list-hris-benefits.js +0 -23
  243. package/tools/hris/benefits/list-hris-benefits.js.map +0 -1
  244. package/tools/hris/benefits/list-hris-benefits.mjs +0 -19
  245. package/tools/hris/benefits/list-hris-benefits.mjs.map +0 -1
  246. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts +0 -32
  247. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts.map +0 -1
  248. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts +0 -32
  249. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts.map +0 -1
  250. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js +0 -23
  251. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js.map +0 -1
  252. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs +0 -19
  253. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs.map +0 -1
  254. package/tools/hris/benefits/retrieve-hris-benefits.d.mts +0 -32
  255. package/tools/hris/benefits/retrieve-hris-benefits.d.mts.map +0 -1
  256. package/tools/hris/benefits/retrieve-hris-benefits.d.ts +0 -32
  257. package/tools/hris/benefits/retrieve-hris-benefits.d.ts.map +0 -1
  258. package/tools/hris/benefits/retrieve-hris-benefits.js +0 -28
  259. package/tools/hris/benefits/retrieve-hris-benefits.js.map +0 -1
  260. package/tools/hris/benefits/retrieve-hris-benefits.mjs +0 -24
  261. package/tools/hris/benefits/retrieve-hris-benefits.mjs.map +0 -1
  262. package/tools/hris/benefits/update-hris-benefits.d.mts +0 -32
  263. package/tools/hris/benefits/update-hris-benefits.d.mts.map +0 -1
  264. package/tools/hris/benefits/update-hris-benefits.d.ts +0 -32
  265. package/tools/hris/benefits/update-hris-benefits.d.ts.map +0 -1
  266. package/tools/hris/benefits/update-hris-benefits.js +0 -32
  267. package/tools/hris/benefits/update-hris-benefits.js.map +0 -1
  268. package/tools/hris/benefits/update-hris-benefits.mjs +0 -28
  269. package/tools/hris/benefits/update-hris-benefits.mjs.map +0 -1
  270. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts +0 -32
  271. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts.map +0 -1
  272. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts +0 -32
  273. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts.map +0 -1
  274. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js +0 -51
  275. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js.map +0 -1
  276. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs +0 -47
  277. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs.map +0 -1
  278. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts +0 -32
  279. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  280. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts +0 -32
  281. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  282. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js +0 -73
  283. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js.map +0 -1
  284. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs +0 -69
  285. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs.map +0 -1
  286. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts +0 -32
  287. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  288. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts +0 -32
  289. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  290. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js +0 -28
  291. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js.map +0 -1
  292. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs +0 -24
  293. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs.map +0 -1
  294. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts +0 -32
  295. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  296. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts +0 -32
  297. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  298. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js +0 -23
  299. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js.map +0 -1
  300. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs +0 -19
  301. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs.map +0 -1
  302. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts +0 -32
  303. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  304. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts +0 -32
  305. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  306. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js +0 -31
  307. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js.map +0 -1
  308. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs +0 -27
  309. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs.map +0 -1
  310. package/tools/hris/company/retrieve-hris-company.d.mts +0 -32
  311. package/tools/hris/company/retrieve-hris-company.d.mts.map +0 -1
  312. package/tools/hris/company/retrieve-hris-company.d.ts +0 -32
  313. package/tools/hris/company/retrieve-hris-company.d.ts.map +0 -1
  314. package/tools/hris/company/retrieve-hris-company.js +0 -23
  315. package/tools/hris/company/retrieve-hris-company.js.map +0 -1
  316. package/tools/hris/company/retrieve-hris-company.mjs +0 -19
  317. package/tools/hris/company/retrieve-hris-company.mjs.map +0 -1
  318. package/tools/hris/directory/list-hris-directory.d.mts +0 -32
  319. package/tools/hris/directory/list-hris-directory.d.mts.map +0 -1
  320. package/tools/hris/directory/list-hris-directory.d.ts +0 -32
  321. package/tools/hris/directory/list-hris-directory.d.ts.map +0 -1
  322. package/tools/hris/directory/list-hris-directory.js +0 -33
  323. package/tools/hris/directory/list-hris-directory.js.map +0 -1
  324. package/tools/hris/directory/list-hris-directory.mjs +0 -29
  325. package/tools/hris/directory/list-hris-directory.mjs.map +0 -1
  326. package/tools/hris/directory/list-individuals-hris-directory.d.mts +0 -32
  327. package/tools/hris/directory/list-individuals-hris-directory.d.mts.map +0 -1
  328. package/tools/hris/directory/list-individuals-hris-directory.d.ts +0 -32
  329. package/tools/hris/directory/list-individuals-hris-directory.d.ts.map +0 -1
  330. package/tools/hris/directory/list-individuals-hris-directory.js +0 -33
  331. package/tools/hris/directory/list-individuals-hris-directory.js.map +0 -1
  332. package/tools/hris/directory/list-individuals-hris-directory.mjs +0 -29
  333. package/tools/hris/directory/list-individuals-hris-directory.mjs.map +0 -1
  334. package/tools/hris/documents/list-hris-documents.d.mts +0 -32
  335. package/tools/hris/documents/list-hris-documents.d.mts.map +0 -1
  336. package/tools/hris/documents/list-hris-documents.d.ts +0 -32
  337. package/tools/hris/documents/list-hris-documents.d.ts.map +0 -1
  338. package/tools/hris/documents/list-hris-documents.js +0 -48
  339. package/tools/hris/documents/list-hris-documents.js.map +0 -1
  340. package/tools/hris/documents/list-hris-documents.mjs +0 -44
  341. package/tools/hris/documents/list-hris-documents.mjs.map +0 -1
  342. package/tools/hris/documents/retreive-hris-documents.d.mts +0 -32
  343. package/tools/hris/documents/retreive-hris-documents.d.mts.map +0 -1
  344. package/tools/hris/documents/retreive-hris-documents.d.ts +0 -32
  345. package/tools/hris/documents/retreive-hris-documents.d.ts.map +0 -1
  346. package/tools/hris/documents/retreive-hris-documents.js +0 -28
  347. package/tools/hris/documents/retreive-hris-documents.js.map +0 -1
  348. package/tools/hris/documents/retreive-hris-documents.mjs +0 -24
  349. package/tools/hris/documents/retreive-hris-documents.mjs.map +0 -1
  350. package/tools/hris/employments/retrieve-many-hris-employments.d.mts +0 -32
  351. package/tools/hris/employments/retrieve-many-hris-employments.d.mts.map +0 -1
  352. package/tools/hris/employments/retrieve-many-hris-employments.d.ts +0 -32
  353. package/tools/hris/employments/retrieve-many-hris-employments.d.ts.map +0 -1
  354. package/tools/hris/employments/retrieve-many-hris-employments.js +0 -39
  355. package/tools/hris/employments/retrieve-many-hris-employments.js.map +0 -1
  356. package/tools/hris/employments/retrieve-many-hris-employments.mjs +0 -35
  357. package/tools/hris/employments/retrieve-many-hris-employments.mjs.map +0 -1
  358. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts +0 -32
  359. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts.map +0 -1
  360. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts +0 -32
  361. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts.map +0 -1
  362. package/tools/hris/individuals/retrieve-many-hris-individuals.js +0 -49
  363. package/tools/hris/individuals/retrieve-many-hris-individuals.js.map +0 -1
  364. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs +0 -45
  365. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs.map +0 -1
  366. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts +0 -32
  367. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts.map +0 -1
  368. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts +0 -32
  369. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts.map +0 -1
  370. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js +0 -47
  371. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js.map +0 -1
  372. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs +0 -43
  373. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs.map +0 -1
  374. package/tools/hris/payments/list-hris-payments.d.mts +0 -32
  375. package/tools/hris/payments/list-hris-payments.d.mts.map +0 -1
  376. package/tools/hris/payments/list-hris-payments.d.ts +0 -32
  377. package/tools/hris/payments/list-hris-payments.d.ts.map +0 -1
  378. package/tools/hris/payments/list-hris-payments.js +0 -35
  379. package/tools/hris/payments/list-hris-payments.js.map +0 -1
  380. package/tools/hris/payments/list-hris-payments.mjs +0 -31
  381. package/tools/hris/payments/list-hris-payments.mjs.map +0 -1
  382. package/tools/index.d.mts +0 -21
  383. package/tools/index.d.mts.map +0 -1
  384. package/tools/index.d.ts +0 -21
  385. package/tools/index.d.ts.map +0 -1
  386. package/tools/index.js +0 -146
  387. package/tools/index.js.map +0 -1
  388. package/tools/index.mjs +0 -139
  389. package/tools/index.mjs.map +0 -1
  390. package/tools/jobs/automated/create-jobs-automated.d.mts +0 -32
  391. package/tools/jobs/automated/create-jobs-automated.d.mts.map +0 -1
  392. package/tools/jobs/automated/create-jobs-automated.d.ts +0 -32
  393. package/tools/jobs/automated/create-jobs-automated.d.ts.map +0 -1
  394. package/tools/jobs/automated/create-jobs-automated.js +0 -55
  395. package/tools/jobs/automated/create-jobs-automated.js.map +0 -1
  396. package/tools/jobs/automated/create-jobs-automated.mjs +0 -51
  397. package/tools/jobs/automated/create-jobs-automated.mjs.map +0 -1
  398. package/tools/jobs/automated/list-jobs-automated.d.mts +0 -32
  399. package/tools/jobs/automated/list-jobs-automated.d.mts.map +0 -1
  400. package/tools/jobs/automated/list-jobs-automated.d.ts +0 -32
  401. package/tools/jobs/automated/list-jobs-automated.d.ts.map +0 -1
  402. package/tools/jobs/automated/list-jobs-automated.js +0 -33
  403. package/tools/jobs/automated/list-jobs-automated.js.map +0 -1
  404. package/tools/jobs/automated/list-jobs-automated.mjs +0 -29
  405. package/tools/jobs/automated/list-jobs-automated.mjs.map +0 -1
  406. package/tools/jobs/automated/retrieve-jobs-automated.d.mts +0 -32
  407. package/tools/jobs/automated/retrieve-jobs-automated.d.mts.map +0 -1
  408. package/tools/jobs/automated/retrieve-jobs-automated.d.ts +0 -32
  409. package/tools/jobs/automated/retrieve-jobs-automated.d.ts.map +0 -1
  410. package/tools/jobs/automated/retrieve-jobs-automated.js +0 -28
  411. package/tools/jobs/automated/retrieve-jobs-automated.js.map +0 -1
  412. package/tools/jobs/automated/retrieve-jobs-automated.mjs +0 -24
  413. package/tools/jobs/automated/retrieve-jobs-automated.mjs.map +0 -1
  414. package/tools/jobs/manual/retrieve-jobs-manual.d.mts +0 -32
  415. package/tools/jobs/manual/retrieve-jobs-manual.d.mts.map +0 -1
  416. package/tools/jobs/manual/retrieve-jobs-manual.d.ts +0 -32
  417. package/tools/jobs/manual/retrieve-jobs-manual.d.ts.map +0 -1
  418. package/tools/jobs/manual/retrieve-jobs-manual.js +0 -28
  419. package/tools/jobs/manual/retrieve-jobs-manual.js.map +0 -1
  420. package/tools/jobs/manual/retrieve-jobs-manual.mjs +0 -24
  421. package/tools/jobs/manual/retrieve-jobs-manual.mjs.map +0 -1
  422. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts +0 -32
  423. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts.map +0 -1
  424. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts +0 -32
  425. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts.map +0 -1
  426. package/tools/payroll/pay-groups/list-payroll-pay-groups.js +0 -34
  427. package/tools/payroll/pay-groups/list-payroll-pay-groups.js.map +0 -1
  428. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs +0 -30
  429. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs.map +0 -1
  430. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts +0 -32
  431. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts.map +0 -1
  432. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts +0 -32
  433. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts.map +0 -1
  434. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js +0 -28
  435. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js.map +0 -1
  436. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs +0 -24
  437. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs.map +0 -1
  438. package/tools/providers/list-providers.d.mts +0 -32
  439. package/tools/providers/list-providers.d.mts.map +0 -1
  440. package/tools/providers/list-providers.d.ts +0 -32
  441. package/tools/providers/list-providers.d.ts.map +0 -1
  442. package/tools/providers/list-providers.js +0 -23
  443. package/tools/providers/list-providers.js.map +0 -1
  444. package/tools/providers/list-providers.mjs +0 -19
  445. package/tools/providers/list-providers.mjs.map +0 -1
  446. package/tools/request-forwarding/forward-request-forwarding.d.mts +0 -32
  447. package/tools/request-forwarding/forward-request-forwarding.d.mts.map +0 -1
  448. package/tools/request-forwarding/forward-request-forwarding.d.ts +0 -32
  449. package/tools/request-forwarding/forward-request-forwarding.d.ts.map +0 -1
  450. package/tools/request-forwarding/forward-request-forwarding.js +0 -45
  451. package/tools/request-forwarding/forward-request-forwarding.js.map +0 -1
  452. package/tools/request-forwarding/forward-request-forwarding.mjs +0 -41
  453. package/tools/request-forwarding/forward-request-forwarding.mjs.map +0 -1
  454. package/tools/sandbox/company/update-sandbox-company.d.mts +0 -32
  455. package/tools/sandbox/company/update-sandbox-company.d.mts.map +0 -1
  456. package/tools/sandbox/company/update-sandbox-company.d.ts +0 -32
  457. package/tools/sandbox/company/update-sandbox-company.d.ts.map +0 -1
  458. package/tools/sandbox/company/update-sandbox-company.js +0 -159
  459. package/tools/sandbox/company/update-sandbox-company.js.map +0 -1
  460. package/tools/sandbox/company/update-sandbox-company.mjs +0 -155
  461. package/tools/sandbox/company/update-sandbox-company.mjs.map +0 -1
  462. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts +0 -32
  463. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts.map +0 -1
  464. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts +0 -32
  465. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts.map +0 -1
  466. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js +0 -44
  467. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js.map +0 -1
  468. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs +0 -40
  469. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs.map +0 -1
  470. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts +0 -32
  471. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts.map +0 -1
  472. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts +0 -32
  473. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts.map +0 -1
  474. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js +0 -35
  475. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js.map +0 -1
  476. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs +0 -31
  477. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs.map +0 -1
  478. package/tools/sandbox/connections/create-sandbox-connections.d.mts +0 -32
  479. package/tools/sandbox/connections/create-sandbox-connections.d.mts.map +0 -1
  480. package/tools/sandbox/connections/create-sandbox-connections.d.ts +0 -32
  481. package/tools/sandbox/connections/create-sandbox-connections.d.ts.map +0 -1
  482. package/tools/sandbox/connections/create-sandbox-connections.js +0 -44
  483. package/tools/sandbox/connections/create-sandbox-connections.js.map +0 -1
  484. package/tools/sandbox/connections/create-sandbox-connections.mjs +0 -40
  485. package/tools/sandbox/connections/create-sandbox-connections.mjs.map +0 -1
  486. package/tools/sandbox/directory/create-sandbox-directory.d.mts +0 -32
  487. package/tools/sandbox/directory/create-sandbox-directory.d.mts.map +0 -1
  488. package/tools/sandbox/directory/create-sandbox-directory.d.ts +0 -32
  489. package/tools/sandbox/directory/create-sandbox-directory.d.ts.map +0 -1
  490. package/tools/sandbox/directory/create-sandbox-directory.js +0 -292
  491. package/tools/sandbox/directory/create-sandbox-directory.js.map +0 -1
  492. package/tools/sandbox/directory/create-sandbox-directory.mjs +0 -288
  493. package/tools/sandbox/directory/create-sandbox-directory.mjs.map +0 -1
  494. package/tools/sandbox/employment/update-sandbox-employment.d.mts +0 -32
  495. package/tools/sandbox/employment/update-sandbox-employment.d.mts.map +0 -1
  496. package/tools/sandbox/employment/update-sandbox-employment.d.ts +0 -32
  497. package/tools/sandbox/employment/update-sandbox-employment.d.ts.map +0 -1
  498. package/tools/sandbox/employment/update-sandbox-employment.js +0 -215
  499. package/tools/sandbox/employment/update-sandbox-employment.js.map +0 -1
  500. package/tools/sandbox/employment/update-sandbox-employment.mjs +0 -211
  501. package/tools/sandbox/employment/update-sandbox-employment.mjs.map +0 -1
  502. package/tools/sandbox/individual/update-sandbox-individual.d.mts +0 -32
  503. package/tools/sandbox/individual/update-sandbox-individual.d.mts.map +0 -1
  504. package/tools/sandbox/individual/update-sandbox-individual.d.ts +0 -32
  505. package/tools/sandbox/individual/update-sandbox-individual.d.ts.map +0 -1
  506. package/tools/sandbox/individual/update-sandbox-individual.js +0 -149
  507. package/tools/sandbox/individual/update-sandbox-individual.js.map +0 -1
  508. package/tools/sandbox/individual/update-sandbox-individual.mjs +0 -145
  509. package/tools/sandbox/individual/update-sandbox-individual.mjs.map +0 -1
  510. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts +0 -32
  511. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts.map +0 -1
  512. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts +0 -32
  513. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts.map +0 -1
  514. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js +0 -23
  515. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js.map +0 -1
  516. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs +0 -19
  517. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs.map +0 -1
  518. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts +0 -32
  519. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts.map +0 -1
  520. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts +0 -32
  521. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts.map +0 -1
  522. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js +0 -33
  523. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js.map +0 -1
  524. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs +0 -29
  525. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs.map +0 -1
  526. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts +0 -32
  527. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts.map +0 -1
  528. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts +0 -32
  529. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts.map +0 -1
  530. package/tools/sandbox/jobs/create-sandbox-jobs.js +0 -30
  531. package/tools/sandbox/jobs/create-sandbox-jobs.js.map +0 -1
  532. package/tools/sandbox/jobs/create-sandbox-jobs.mjs +0 -26
  533. package/tools/sandbox/jobs/create-sandbox-jobs.mjs.map +0 -1
  534. package/tools/sandbox/payment/create-sandbox-payment.d.mts +0 -32
  535. package/tools/sandbox/payment/create-sandbox-payment.d.mts.map +0 -1
  536. package/tools/sandbox/payment/create-sandbox-payment.d.ts +0 -32
  537. package/tools/sandbox/payment/create-sandbox-payment.d.ts.map +0 -1
  538. package/tools/sandbox/payment/create-sandbox-payment.js +0 -300
  539. package/tools/sandbox/payment/create-sandbox-payment.js.map +0 -1
  540. package/tools/sandbox/payment/create-sandbox-payment.mjs +0 -296
  541. package/tools/sandbox/payment/create-sandbox-payment.mjs.map +0 -1
  542. package/tools.d.mts +0 -2
  543. package/tools.d.mts.map +0 -1
  544. package/tools.d.ts +0 -2
  545. package/tools.d.ts.map +0 -1
  546. package/tools.js +0 -18
  547. package/tools.js.map +0 -1
  548. package/tools.mjs +0 -2
  549. package/tools.mjs.map +0 -1
package/src/http.ts ADDED
@@ -0,0 +1,109 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
4
+ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
5
+
6
+ import express from 'express';
7
+ import { McpOptions } from './options';
8
+ import { ClientOptions, initMcpServer, newMcpServer } from './server';
9
+ import { parseAuthHeaders } from './headers';
10
+
11
+ const newServer = ({
12
+ clientOptions,
13
+ req,
14
+ res,
15
+ }: {
16
+ clientOptions: ClientOptions;
17
+ req: express.Request;
18
+ res: express.Response;
19
+ }): McpServer | null => {
20
+ const server = newMcpServer();
21
+
22
+ try {
23
+ const authOptions = parseAuthHeaders(req);
24
+ initMcpServer({
25
+ server: server,
26
+ clientOptions: {
27
+ ...clientOptions,
28
+ ...authOptions,
29
+ },
30
+ });
31
+ } catch (error) {
32
+ res.status(401).json({
33
+ jsonrpc: '2.0',
34
+ error: {
35
+ code: -32000,
36
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
37
+ },
38
+ });
39
+ return null;
40
+ }
41
+
42
+ return server;
43
+ };
44
+
45
+ const post =
46
+ (options: { clientOptions: ClientOptions; mcpOptions: McpOptions }) =>
47
+ async (req: express.Request, res: express.Response) => {
48
+ const server = newServer({ ...options, req, res });
49
+ // If we return null, we already set the authorization error.
50
+ if (server === null) return;
51
+ const transport = new StreamableHTTPServerTransport({
52
+ // Stateless server
53
+ sessionIdGenerator: undefined,
54
+ });
55
+ await server.connect(transport);
56
+ await transport.handleRequest(req, res, req.body);
57
+ };
58
+
59
+ const get = async (req: express.Request, res: express.Response) => {
60
+ res.status(405).json({
61
+ jsonrpc: '2.0',
62
+ error: {
63
+ code: -32000,
64
+ message: 'Method not supported',
65
+ },
66
+ });
67
+ };
68
+
69
+ const del = async (req: express.Request, res: express.Response) => {
70
+ res.status(405).json({
71
+ jsonrpc: '2.0',
72
+ error: {
73
+ code: -32000,
74
+ message: 'Method not supported',
75
+ },
76
+ });
77
+ };
78
+
79
+ export const streamableHTTPApp = ({
80
+ clientOptions = {},
81
+ mcpOptions = {},
82
+ }: {
83
+ clientOptions?: ClientOptions;
84
+ mcpOptions?: McpOptions;
85
+ }): express.Express => {
86
+ const app = express();
87
+ app.set('query parser', 'extended');
88
+ app.use(express.json());
89
+
90
+ app.get('/', get);
91
+ app.post('/', post({ clientOptions, mcpOptions }));
92
+ app.delete('/', del);
93
+
94
+ return app;
95
+ };
96
+
97
+ export const launchStreamableHTTPServer = async (options: McpOptions, port: number | string | undefined) => {
98
+ const app = streamableHTTPApp({ mcpOptions: options });
99
+ const server = app.listen(port);
100
+ const address = server.address();
101
+
102
+ if (typeof address === 'string') {
103
+ console.error(`MCP Server running on streamable HTTP at ${address}`);
104
+ } else if (address !== null) {
105
+ console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
106
+ } else {
107
+ console.error(`MCP Server running on streamable HTTP on port ${port}`);
108
+ }
109
+ };
package/src/index.ts CHANGED
@@ -1,28 +1,29 @@
1
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
- import { init, selectTools, server } from './server';
3
- import { Endpoint, endpoints } from './tools';
4
- import { ParsedOptions, parseOptions } from './options';
1
+ #!/usr/bin/env node
2
+
3
+ import { selectTools } from './server';
4
+ import { McpOptions, parseCLIOptions } from './options';
5
+ import { launchStdioServer } from './stdio';
6
+ import { launchStreamableHTTPServer } from './http';
7
+ import type { McpTool } from './types';
5
8
 
6
9
  async function main() {
7
10
  const options = parseOptionsOrError();
8
11
 
9
- if (options.list) {
10
- listAllTools();
11
- return;
12
- }
13
-
14
- const includedTools = selectToolsOrError(endpoints, options);
12
+ const selectedTools = await selectToolsOrError(options);
15
13
 
16
14
  console.error(
17
- `MCP Server starting with ${includedTools.length} tools:`,
18
- includedTools.map((e) => e.tool.name),
15
+ `MCP Server starting with ${selectedTools.length} tools:`,
16
+ selectedTools.map((e) => e.tool.name),
19
17
  );
20
18
 
21
- init({ server, endpoints: includedTools });
22
-
23
- const transport = new StdioServerTransport();
24
- await server.connect(transport);
25
- console.error('MCP Server running on stdio');
19
+ switch (options.transport) {
20
+ case 'stdio':
21
+ await launchStdioServer();
22
+ break;
23
+ case 'http':
24
+ await launchStreamableHTTPServer(options, options.port ?? options.socket);
25
+ break;
26
+ }
26
27
  }
27
28
 
28
29
  if (require.main === module) {
@@ -34,16 +35,16 @@ if (require.main === module) {
34
35
 
35
36
  function parseOptionsOrError() {
36
37
  try {
37
- return parseOptions();
38
+ return parseCLIOptions();
38
39
  } catch (error) {
39
40
  console.error('Error parsing options:', error);
40
41
  process.exit(1);
41
42
  }
42
43
  }
43
44
 
44
- function selectToolsOrError(endpoints: Endpoint[], options: ParsedOptions) {
45
+ async function selectToolsOrError(options: McpOptions): Promise<McpTool[]> {
45
46
  try {
46
- const includedTools = selectTools(endpoints, options);
47
+ const includedTools = selectTools(options);
47
48
  if (includedTools.length === 0) {
48
49
  console.error('No tools match the provided filters.');
49
50
  process.exit(1);
@@ -58,45 +59,3 @@ function selectToolsOrError(endpoints: Endpoint[], options: ParsedOptions) {
58
59
  process.exit(1);
59
60
  }
60
61
  }
61
-
62
- function listAllTools() {
63
- if (endpoints.length === 0) {
64
- console.log('No tools available.');
65
- return;
66
- }
67
- console.log('Available tools:\n');
68
-
69
- // Group endpoints by resource
70
- const resourceGroups = new Map<string, typeof endpoints>();
71
-
72
- for (const endpoint of endpoints) {
73
- const resource = endpoint.metadata.resource;
74
- if (!resourceGroups.has(resource)) {
75
- resourceGroups.set(resource, []);
76
- }
77
- resourceGroups.get(resource)!.push(endpoint);
78
- }
79
-
80
- // Sort resources alphabetically
81
- const sortedResources = Array.from(resourceGroups.keys()).sort();
82
-
83
- // Display hierarchically by resource
84
- for (const resource of sortedResources) {
85
- console.log(`Resource: ${resource}`);
86
-
87
- const resourceEndpoints = resourceGroups.get(resource)!;
88
- // Sort endpoints by tool name
89
- resourceEndpoints.sort((a, b) => a.tool.name.localeCompare(b.tool.name));
90
-
91
- for (const endpoint of resourceEndpoints) {
92
- const {
93
- tool,
94
- metadata: { operation, tags },
95
- } = endpoint;
96
-
97
- console.log(` - ${tool.name} (${operation}) ${tags.length > 0 ? `tags: ${tags.join(', ')}` : ''}`);
98
- console.log(` Description: ${tool.description}`);
99
- }
100
- console.log('');
101
- }
102
- }
package/src/options.ts CHANGED
@@ -1,361 +1,92 @@
1
+ import qs from 'qs';
1
2
  import yargs from 'yargs';
2
3
  import { hideBin } from 'yargs/helpers';
3
- import { endpoints, Filter } from './tools';
4
- import { ClientCapabilities } from './compat';
4
+ import z from 'zod';
5
5
 
6
- type ClientType = 'openai-agents' | 'claude' | 'claude-code' | 'cursor';
7
-
8
- // Client presets for compatibility
9
- // Note that these could change over time as models get better, so this is
10
- // a best effort.
11
- const CLIENT_PRESETS: Record<ClientType, ClientCapabilities> = {
12
- 'openai-agents': {
13
- topLevelUnions: false,
14
- validJson: true,
15
- refs: true,
16
- unions: true,
17
- formats: true,
18
- toolNameLength: undefined,
19
- },
20
- claude: {
21
- topLevelUnions: true,
22
- validJson: false,
23
- refs: true,
24
- unions: true,
25
- formats: true,
26
- toolNameLength: undefined,
27
- },
28
- 'claude-code': {
29
- topLevelUnions: false,
30
- validJson: true,
31
- refs: true,
32
- unions: true,
33
- formats: true,
34
- toolNameLength: undefined,
35
- },
36
- cursor: {
37
- topLevelUnions: false,
38
- validJson: true,
39
- refs: false,
40
- unions: false,
41
- formats: false,
42
- toolNameLength: 50,
43
- },
6
+ export type CLIOptions = McpOptions & {
7
+ transport: 'stdio' | 'http';
8
+ port: number | undefined;
9
+ socket: string | undefined;
44
10
  };
45
11
 
46
- export interface ParsedOptions {
47
- includeDynamicTools: boolean | undefined;
48
- includeAllTools: boolean | undefined;
49
- filters: Filter[];
50
- capabilities: ClientCapabilities;
51
- list: boolean;
52
- }
53
-
54
- const CAPABILITY_CHOICES = [
55
- 'top-level-unions',
56
- 'valid-json',
57
- 'refs',
58
- 'unions',
59
- 'formats',
60
- 'tool-name-length',
61
- ] as const;
62
-
63
- type Capability = (typeof CAPABILITY_CHOICES)[number];
64
-
65
- function parseCapabilityValue(cap: string): { name: Capability; value?: number } {
66
- if (cap.startsWith('tool-name-length=')) {
67
- const parts = cap.split('=');
68
- if (parts.length === 2) {
69
- const length = parseInt(parts[1]!, 10);
70
- if (!isNaN(length)) {
71
- return { name: 'tool-name-length', value: length };
72
- }
73
- throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
74
- }
75
- throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
76
- }
77
- if (!CAPABILITY_CHOICES.includes(cap as Capability)) {
78
- throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
79
- }
80
- return { name: cap as Capability };
81
- }
12
+ export type McpOptions = {
13
+ includeDocsTools?: boolean | undefined;
14
+ };
82
15
 
83
- export function parseOptions(): ParsedOptions {
16
+ export function parseCLIOptions(): CLIOptions {
84
17
  const opts = yargs(hideBin(process.argv))
85
18
  .option('tools', {
86
19
  type: 'string',
87
20
  array: true,
88
- choices: ['dynamic', 'all'],
21
+ choices: ['code', 'docs'],
89
22
  description: 'Use dynamic tools or all tools',
90
23
  })
91
24
  .option('no-tools', {
92
25
  type: 'string',
93
26
  array: true,
94
- choices: ['dynamic', 'all'],
27
+ choices: ['code', 'docs'],
95
28
  description: 'Do not use any dynamic or all tools',
96
29
  })
97
- .option('tool', {
98
- type: 'string',
99
- array: true,
100
- description: 'Include tools matching the specified names',
101
- })
102
- .option('resource', {
103
- type: 'string',
104
- array: true,
105
- description: 'Include tools matching the specified resources',
106
- })
107
- .option('operation', {
108
- type: 'string',
109
- array: true,
110
- choices: ['read', 'write'],
111
- description: 'Include tools matching the specified operations',
112
- })
113
- .option('tag', {
114
- type: 'string',
115
- array: true,
116
- description: 'Include tools with the specified tags',
117
- })
118
- .option('no-tool', {
30
+ .option('transport', {
119
31
  type: 'string',
120
- array: true,
121
- description: 'Exclude tools matching the specified names',
32
+ choices: ['stdio', 'http'],
33
+ default: 'stdio',
34
+ description: 'What transport to use; stdio for local servers or http for remote servers',
122
35
  })
123
- .option('no-resource', {
124
- type: 'string',
125
- array: true,
126
- description: 'Exclude tools matching the specified resources',
36
+ .option('port', {
37
+ type: 'number',
38
+ description: 'Port to serve on if using http transport',
127
39
  })
128
- .option('no-operation', {
40
+ .option('socket', {
129
41
  type: 'string',
130
- array: true,
131
- description: 'Exclude tools matching the specified operations',
132
- })
133
- .option('no-tag', {
134
- type: 'string',
135
- array: true,
136
- description: 'Exclude tools with the specified tags',
137
- })
138
- .option('list', {
139
- type: 'boolean',
140
- description: 'List all tools and exit',
141
- })
142
- .option('client', {
143
- type: 'string',
144
- choices: Object.keys(CLIENT_PRESETS),
145
- description: 'Specify the MCP client being used',
146
- })
147
- .option('capability', {
148
- type: 'string',
149
- array: true,
150
- description: 'Specify client capabilities',
151
- coerce: (values: string[]) => {
152
- return values.flatMap((v) => v.split(','));
153
- },
154
- })
155
- .option('no-capability', {
156
- type: 'string',
157
- array: true,
158
- description: 'Unset client capabilities',
159
- choices: CAPABILITY_CHOICES,
160
- coerce: (values: string[]) => {
161
- return values.flatMap((v) => v.split(','));
162
- },
163
- })
164
- .option('describe-capabilities', {
165
- type: 'boolean',
166
- description: 'Print detailed explanation of client capabilities and exit',
42
+ description: 'Unix socket to serve on if using http transport',
167
43
  })
168
44
  .help();
169
45
 
170
- for (const [command, desc] of examples()) {
171
- opts.example(command, desc);
172
- }
173
-
174
46
  const argv = opts.parseSync();
175
47
 
176
- // Handle describe-capabilities flag
177
- if (argv.describeCapabilities) {
178
- console.log(getCapabilitiesExplanation());
179
- process.exit(0);
180
- }
181
-
182
- const filters: Filter[] = [];
183
-
184
- // Helper function to support comma-separated values
185
- const splitValues = (values: string[] | undefined): string[] => {
186
- if (!values) return [];
187
- return values.flatMap((v) => v.split(','));
188
- };
189
-
190
- for (const tag of splitValues(argv.tag)) {
191
- filters.push({ type: 'tag', op: 'include', value: tag });
192
- }
193
-
194
- for (const tag of splitValues(argv.noTag)) {
195
- filters.push({ type: 'tag', op: 'exclude', value: tag });
196
- }
197
-
198
- for (const resource of splitValues(argv.resource)) {
199
- filters.push({ type: 'resource', op: 'include', value: resource });
200
- }
201
-
202
- for (const resource of splitValues(argv.noResource)) {
203
- filters.push({ type: 'resource', op: 'exclude', value: resource });
204
- }
205
-
206
- for (const tool of splitValues(argv.tool)) {
207
- filters.push({ type: 'tool', op: 'include', value: tool });
208
- }
209
-
210
- for (const tool of splitValues(argv.noTool)) {
211
- filters.push({ type: 'tool', op: 'exclude', value: tool });
212
- }
213
-
214
- for (const operation of splitValues(argv.operation)) {
215
- filters.push({ type: 'operation', op: 'include', value: operation });
216
- }
217
-
218
- for (const operation of splitValues(argv.noOperation)) {
219
- filters.push({ type: 'operation', op: 'exclude', value: operation });
220
- }
221
-
222
- // Parse client capabilities
223
- const clientCapabilities: ClientCapabilities = {
224
- topLevelUnions: true,
225
- validJson: true,
226
- refs: true,
227
- unions: true,
228
- formats: true,
229
- toolNameLength: undefined,
230
- };
231
-
232
- // Apply client preset if specified
233
- if (typeof argv.client === 'string') {
234
- const clientKey = argv.client as ClientType;
235
- if (CLIENT_PRESETS[clientKey]) {
236
- Object.assign(clientCapabilities, CLIENT_PRESETS[clientKey]);
237
- }
238
- }
48
+ const shouldIncludeToolType = (toolType: 'code' | 'docs') =>
49
+ argv.noTools?.includes(toolType) ? false
50
+ : argv.tools?.includes(toolType) ? true
51
+ : undefined;
239
52
 
240
- // Apply individual capability overrides
241
- if (Array.isArray(argv.capability)) {
242
- for (const cap of argv.capability) {
243
- const parsedCap = parseCapabilityValue(cap);
244
- if (parsedCap.name === 'top-level-unions') {
245
- clientCapabilities.topLevelUnions = true;
246
- } else if (parsedCap.name === 'valid-json') {
247
- clientCapabilities.validJson = true;
248
- } else if (parsedCap.name === 'refs') {
249
- clientCapabilities.refs = true;
250
- } else if (parsedCap.name === 'unions') {
251
- clientCapabilities.unions = true;
252
- } else if (parsedCap.name === 'formats') {
253
- clientCapabilities.formats = true;
254
- } else if (parsedCap.name === 'tool-name-length') {
255
- clientCapabilities.toolNameLength = parsedCap.value;
256
- }
257
- }
258
- }
53
+ const includeDocsTools = shouldIncludeToolType('docs');
259
54
 
260
- // Handle no-capability options to unset capabilities
261
- if (Array.isArray(argv.noCapability)) {
262
- for (const cap of argv.noCapability) {
263
- if (cap === 'top-level-unions') {
264
- clientCapabilities.topLevelUnions = false;
265
- } else if (cap === 'valid-json') {
266
- clientCapabilities.validJson = false;
267
- } else if (cap === 'refs') {
268
- clientCapabilities.refs = false;
269
- } else if (cap === 'unions') {
270
- clientCapabilities.unions = false;
271
- } else if (cap === 'formats') {
272
- clientCapabilities.formats = false;
273
- } else if (cap === 'tool-name-length') {
274
- clientCapabilities.toolNameLength = undefined;
275
- }
276
- }
277
- }
278
-
279
- const explicitTools = Boolean(argv.tools || argv.noTools);
280
- const includeDynamicTools =
281
- explicitTools ? argv.tools?.includes('dynamic') && !argv.noTools?.includes('dynamic') : undefined;
282
- const includeAllTools =
283
- explicitTools ? argv.tools?.includes('all') && !argv.noTools?.includes('all') : undefined;
55
+ const transport = argv.transport as 'stdio' | 'http';
284
56
 
285
57
  return {
286
- includeDynamicTools,
287
- includeAllTools,
288
- filters,
289
- capabilities: clientCapabilities,
290
- list: argv.list || false,
58
+ includeDocsTools,
59
+ transport,
60
+ port: argv.port,
61
+ socket: argv.socket,
291
62
  };
292
63
  }
293
64
 
294
- function getCapabilitiesExplanation(): string {
295
- return `
296
- Client Capabilities Explanation:
297
-
298
- Different Language Models (LLMs) and the MCP clients that use them have varying limitations in how they handle tool schemas. Capability flags allow you to inform the MCP server about these limitations.
299
-
300
- When a capability flag is set to false, the MCP server will automatically adjust the tool schemas to work around that limitation, ensuring broader compatibility.
301
-
302
- Available Capabilities:
303
-
304
- # top-level-unions
305
- Some clients/LLMs do not support JSON schemas with a union type (anyOf) at the root level. If a client lacks this capability, the MCP server splits tools with top-level unions into multiple separate tools, one for each variant in the union.
306
-
307
- # refs
308
- Some clients/LLMs do not support $ref pointers for schema reuse. If a client lacks this capability, the MCP server automatically inlines all references ($defs) directly into the schema. Properties that would cause circular references are removed during this process.
309
-
310
- # valid-json
311
- Some clients/LLMs may incorrectly send arguments as a JSON-encoded string instead of a proper JSON object. If a client *has* this capability, the MCP server will attempt to parse string values as JSON if the initial validation against the schema fails.
312
-
313
- # unions
314
- Some clients/LLMs do not support union types (anyOf) in JSON schemas. If a client lacks this capability, the MCP server removes all anyOf fields and uses only the first variant as the schema.
315
-
316
- # formats
317
- Some clients/LLMs do not support the 'format' keyword in JSON Schema specifications. If a client lacks this capability, the MCP server removes all format fields and appends the format information to the field's description in parentheses.
318
-
319
- # tool-name-length=N
320
- Some clients/LLMs impose a maximum length on tool names. If this capability is set, the MCP server will automatically truncate tool names exceeding the specified length (N), ensuring uniqueness by appending numbers if necessary.
321
-
322
- Client Presets (--client):
323
- Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
324
-
325
- Current presets:
326
- ${JSON.stringify(CLIENT_PRESETS, null, 2)}
327
- `;
328
- }
329
-
330
- function examples(): [string, string][] {
331
- const firstEndpoint = endpoints[0]!;
332
- const secondEndpoint =
333
- endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
334
- const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
335
- const otherEndpoint = secondEndpoint || firstEndpoint;
65
+ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
66
+ z.preprocess(
67
+ (val) =>
68
+ Array.isArray(val) ? val
69
+ : val ? [val]
70
+ : val,
71
+ z.array(zodType).optional(),
72
+ );
73
+
74
+ const QueryOptions = z.object({
75
+ tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to use'),
76
+ no_tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to not use.'),
77
+ tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
78
+ });
79
+
80
+ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions {
81
+ const queryObject = typeof query === 'string' ? qs.parse(query) : query;
82
+ const queryOptions = QueryOptions.parse(queryObject);
83
+
84
+ let docsTools: boolean | undefined =
85
+ queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
86
+ : queryOptions.tools?.includes('docs') ? true
87
+ : defaultOptions.includeDocsTools;
336
88
 
337
- return [
338
- [
339
- `--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
340
- 'Include tools by name',
341
- ],
342
- [
343
- `--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
344
- 'Filter by resource and operation',
345
- ],
346
- [
347
- `--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
348
- 'Use resource wildcards and exclusions',
349
- ],
350
- [`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
351
- [
352
- `--capability="top-level-unions" --capability="tool-name-length=40"`,
353
- 'Specify individual client capabilities',
354
- ],
355
- [
356
- `--client="cursor" --no-capability="tool-name-length"`,
357
- 'Use cursor client preset but remove tool name length limit',
358
- ],
359
- ...(tag ? [[`--tag="${tag}"`, 'Filter based on tags'] as [string, string]] : []),
360
- ];
89
+ return {
90
+ includeDocsTools: docsTools,
91
+ };
361
92
  }