@codeqr/ts-mcp 0.9.0 → 0.24.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 (488) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +16 -218
  3. package/auth.d.mts +6 -0
  4. package/auth.d.mts.map +1 -0
  5. package/auth.d.ts +6 -0
  6. package/auth.d.ts.map +1 -0
  7. package/auth.js +37 -0
  8. package/auth.js.map +1 -0
  9. package/{headers.mjs → auth.mjs} +16 -2
  10. package/auth.mjs.map +1 -0
  11. package/code-tool-paths.cjs +8 -0
  12. package/code-tool-paths.cjs.map +1 -0
  13. package/code-tool-paths.d.cts +2 -0
  14. package/code-tool-paths.d.cts.map +1 -0
  15. package/code-tool-types.d.mts +7 -9
  16. package/code-tool-types.d.mts.map +1 -1
  17. package/code-tool-types.d.ts +7 -9
  18. package/code-tool-types.d.ts.map +1 -1
  19. package/code-tool-worker.d.mts +5 -0
  20. package/code-tool-worker.d.mts.map +1 -0
  21. package/code-tool-worker.d.ts +5 -0
  22. package/code-tool-worker.d.ts.map +1 -0
  23. package/code-tool-worker.js +291 -0
  24. package/code-tool-worker.js.map +1 -0
  25. package/code-tool-worker.mjs +253 -0
  26. package/code-tool-worker.mjs.map +1 -0
  27. package/code-tool.d.mts +12 -45
  28. package/code-tool.d.mts.map +1 -1
  29. package/code-tool.d.ts +12 -45
  30. package/code-tool.d.ts.map +1 -1
  31. package/code-tool.js +264 -27
  32. package/code-tool.js.map +1 -1
  33. package/code-tool.mjs +231 -27
  34. package/code-tool.mjs.map +1 -1
  35. package/docs-search-tool.d.mts +12 -3
  36. package/docs-search-tool.d.mts.map +1 -1
  37. package/docs-search-tool.d.ts +12 -3
  38. package/docs-search-tool.d.ts.map +1 -1
  39. package/docs-search-tool.js +23 -10
  40. package/docs-search-tool.js.map +1 -1
  41. package/docs-search-tool.mjs +22 -10
  42. package/docs-search-tool.mjs.map +1 -1
  43. package/http.d.mts +6 -3
  44. package/http.d.mts.map +1 -1
  45. package/http.d.ts +6 -3
  46. package/http.d.ts.map +1 -1
  47. package/http.js +130 -48
  48. package/http.js.map +1 -1
  49. package/http.mjs +130 -48
  50. package/http.mjs.map +1 -1
  51. package/index.js +19 -50
  52. package/index.js.map +1 -1
  53. package/index.mjs +19 -50
  54. package/index.mjs.map +1 -1
  55. package/instructions.d.mts +5 -0
  56. package/instructions.d.mts.map +1 -0
  57. package/instructions.d.ts +5 -0
  58. package/instructions.d.ts.map +1 -0
  59. package/instructions.js +45 -0
  60. package/instructions.js.map +1 -0
  61. package/instructions.mjs +39 -0
  62. package/instructions.mjs.map +1 -0
  63. package/local-docs-search.d.mts +28 -0
  64. package/local-docs-search.d.mts.map +1 -0
  65. package/local-docs-search.d.ts +28 -0
  66. package/local-docs-search.d.ts.map +1 -0
  67. package/local-docs-search.js +1259 -0
  68. package/local-docs-search.js.map +1 -0
  69. package/local-docs-search.mjs +1219 -0
  70. package/local-docs-search.mjs.map +1 -0
  71. package/logger.d.mts +7 -0
  72. package/logger.d.mts.map +1 -0
  73. package/logger.d.ts +7 -0
  74. package/logger.d.ts.map +1 -0
  75. package/logger.js +29 -0
  76. package/logger.js.map +1 -0
  77. package/logger.mjs +22 -0
  78. package/logger.mjs.map +1 -0
  79. package/methods.d.mts +10 -0
  80. package/methods.d.mts.map +1 -0
  81. package/methods.d.ts +10 -0
  82. package/methods.d.ts.map +1 -0
  83. package/methods.js +215 -0
  84. package/methods.js.map +1 -0
  85. package/methods.mjs +211 -0
  86. package/methods.mjs.map +1 -0
  87. package/options.d.mts +12 -9
  88. package/options.d.mts.map +1 -1
  89. package/options.d.ts +12 -9
  90. package/options.d.ts.map +1 -1
  91. package/options.js +67 -353
  92. package/options.js.map +1 -1
  93. package/options.mjs +67 -353
  94. package/options.mjs.map +1 -1
  95. package/package.json +94 -60
  96. package/server.d.mts +19 -16
  97. package/server.d.mts.map +1 -1
  98. package/server.d.ts +19 -16
  99. package/server.d.ts.map +1 -1
  100. package/server.js +95 -101
  101. package/server.js.map +1 -1
  102. package/server.mjs +94 -96
  103. package/server.mjs.map +1 -1
  104. package/src/{headers.ts → auth.ts} +18 -1
  105. package/src/code-tool-paths.cts +5 -0
  106. package/src/code-tool-types.ts +8 -9
  107. package/src/code-tool-worker.ts +304 -0
  108. package/src/code-tool.ts +292 -36
  109. package/src/docs-search-tool.ts +34 -14
  110. package/src/http.ts +154 -54
  111. package/src/index.ts +22 -63
  112. package/src/instructions.ts +57 -0
  113. package/src/local-docs-search.ts +1368 -0
  114. package/src/logger.ts +28 -0
  115. package/src/methods.ts +236 -0
  116. package/src/options.ts +90 -378
  117. package/src/server.ts +118 -117
  118. package/src/stdio.ts +9 -5
  119. package/src/{tools/types.ts → types.ts} +16 -5
  120. package/src/util.ts +25 -0
  121. package/stdio.d.mts +1 -1
  122. package/stdio.d.mts.map +1 -1
  123. package/stdio.d.ts +1 -1
  124. package/stdio.d.ts.map +1 -1
  125. package/stdio.js +8 -4
  126. package/stdio.js.map +1 -1
  127. package/stdio.mjs +8 -4
  128. package/stdio.mjs.map +1 -1
  129. package/{tools/types.d.mts → types.d.mts} +15 -2
  130. package/types.d.mts.map +1 -0
  131. package/{tools/types.d.ts → types.d.ts} +15 -2
  132. package/types.d.ts.map +1 -0
  133. package/types.js.map +1 -0
  134. package/types.mjs.map +1 -0
  135. package/util.d.mts +4 -0
  136. package/util.d.mts.map +1 -0
  137. package/util.d.ts +4 -0
  138. package/util.d.ts.map +1 -0
  139. package/util.js +30 -0
  140. package/util.js.map +1 -0
  141. package/util.mjs +24 -0
  142. package/util.mjs.map +1 -0
  143. package/compat.d.mts +0 -58
  144. package/compat.d.mts.map +0 -1
  145. package/compat.d.ts +0 -58
  146. package/compat.d.ts.map +0 -1
  147. package/compat.js +0 -387
  148. package/compat.js.map +0 -1
  149. package/compat.mjs +0 -378
  150. package/compat.mjs.map +0 -1
  151. package/dynamic-tools.d.mts +0 -12
  152. package/dynamic-tools.d.mts.map +0 -1
  153. package/dynamic-tools.d.ts +0 -12
  154. package/dynamic-tools.d.ts.map +0 -1
  155. package/dynamic-tools.js +0 -135
  156. package/dynamic-tools.js.map +0 -1
  157. package/dynamic-tools.mjs +0 -132
  158. package/dynamic-tools.mjs.map +0 -1
  159. package/filtering.d.mts +0 -3
  160. package/filtering.d.mts.map +0 -1
  161. package/filtering.d.ts +0 -3
  162. package/filtering.d.ts.map +0 -1
  163. package/filtering.js +0 -24
  164. package/filtering.js.map +0 -1
  165. package/filtering.mjs +0 -16
  166. package/filtering.mjs.map +0 -1
  167. package/headers.d.mts +0 -4
  168. package/headers.d.mts.map +0 -1
  169. package/headers.d.ts +0 -4
  170. package/headers.d.ts.map +0 -1
  171. package/headers.js +0 -22
  172. package/headers.js.map +0 -1
  173. package/headers.mjs.map +0 -1
  174. package/src/compat.ts +0 -483
  175. package/src/dynamic-tools.ts +0 -153
  176. package/src/filtering.ts +0 -18
  177. package/src/tools/analytics/retrieve-analytics.ts +0 -441
  178. package/src/tools/domains/create-domains.ts +0 -75
  179. package/src/tools/domains/delete-domains.ts +0 -55
  180. package/src/tools/domains/list-domains.ts +0 -68
  181. package/src/tools/domains/update-domains.ts +0 -79
  182. package/src/tools/events/list-events.ts +0 -421
  183. package/src/tools/index.ts +0 -133
  184. package/src/tools/links/bulk/create-links-bulk.ts +0 -966
  185. package/src/tools/links/bulk/delete-links-bulk.ts +0 -59
  186. package/src/tools/links/count-links.ts +0 -957
  187. package/src/tools/links/create-links.ts +0 -957
  188. package/src/tools/links/delete-links.ts +0 -56
  189. package/src/tools/links/list-links.ts +0 -980
  190. package/src/tools/links/retrieve-info-links.ts +0 -75
  191. package/src/tools/links/update-links.ts +0 -964
  192. package/src/tools/links/upsert-links.ts +0 -958
  193. package/src/tools/projects/list-projects.ts +0 -51
  194. package/src/tools/projects/retrieve-projects.ts +0 -56
  195. package/src/tools/qrcodes/bulk/create-qrcodes-bulk.ts +0 -1077
  196. package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +0 -59
  197. package/src/tools/qrcodes/count-qrcodes.ts +0 -220
  198. package/src/tools/qrcodes/create-qrcodes.ts +0 -1067
  199. package/src/tools/qrcodes/delete-qrcodes.ts +0 -56
  200. package/src/tools/qrcodes/list-qrcodes.ts +0 -221
  201. package/src/tools/qrcodes/retrieve-qrcodes.ts +0 -67
  202. package/src/tools/qrcodes/update-qrcodes.ts +0 -1074
  203. package/src/tools/qrcodes/upsert-qrcodes.ts +0 -1068
  204. package/src/tools/tags/create-tags.ts +0 -59
  205. package/src/tools/tags/delete-tags.ts +0 -55
  206. package/src/tools/tags/list-tags.ts +0 -87
  207. package/src/tools/tags/update-tags.ts +0 -63
  208. package/src/tools/track/track-lead-track.ts +0 -93
  209. package/src/tools/track/track-sale-track.ts +0 -108
  210. package/src/tools.ts +0 -1
  211. package/tools/analytics/retrieve-analytics.d.mts +0 -51
  212. package/tools/analytics/retrieve-analytics.d.mts.map +0 -1
  213. package/tools/analytics/retrieve-analytics.d.ts +0 -51
  214. package/tools/analytics/retrieve-analytics.d.ts.map +0 -1
  215. package/tools/analytics/retrieve-analytics.js +0 -438
  216. package/tools/analytics/retrieve-analytics.js.map +0 -1
  217. package/tools/analytics/retrieve-analytics.mjs +0 -431
  218. package/tools/analytics/retrieve-analytics.mjs.map +0 -1
  219. package/tools/domains/create-domains.d.mts +0 -51
  220. package/tools/domains/create-domains.d.mts.map +0 -1
  221. package/tools/domains/create-domains.d.ts +0 -51
  222. package/tools/domains/create-domains.d.ts.map +0 -1
  223. package/tools/domains/create-domains.js +0 -74
  224. package/tools/domains/create-domains.js.map +0 -1
  225. package/tools/domains/create-domains.mjs +0 -67
  226. package/tools/domains/create-domains.mjs.map +0 -1
  227. package/tools/domains/delete-domains.d.mts +0 -51
  228. package/tools/domains/delete-domains.d.mts.map +0 -1
  229. package/tools/domains/delete-domains.d.ts +0 -51
  230. package/tools/domains/delete-domains.d.ts.map +0 -1
  231. package/tools/domains/delete-domains.js +0 -55
  232. package/tools/domains/delete-domains.js.map +0 -1
  233. package/tools/domains/delete-domains.mjs +0 -48
  234. package/tools/domains/delete-domains.mjs.map +0 -1
  235. package/tools/domains/list-domains.d.mts +0 -51
  236. package/tools/domains/list-domains.d.mts.map +0 -1
  237. package/tools/domains/list-domains.d.ts +0 -51
  238. package/tools/domains/list-domains.d.ts.map +0 -1
  239. package/tools/domains/list-domains.js +0 -67
  240. package/tools/domains/list-domains.js.map +0 -1
  241. package/tools/domains/list-domains.mjs +0 -60
  242. package/tools/domains/list-domains.mjs.map +0 -1
  243. package/tools/domains/update-domains.d.mts +0 -51
  244. package/tools/domains/update-domains.d.mts.map +0 -1
  245. package/tools/domains/update-domains.d.ts +0 -51
  246. package/tools/domains/update-domains.d.ts.map +0 -1
  247. package/tools/domains/update-domains.js +0 -78
  248. package/tools/domains/update-domains.js.map +0 -1
  249. package/tools/domains/update-domains.mjs +0 -71
  250. package/tools/domains/update-domains.mjs.map +0 -1
  251. package/tools/events/list-events.d.mts +0 -51
  252. package/tools/events/list-events.d.mts.map +0 -1
  253. package/tools/events/list-events.d.ts +0 -51
  254. package/tools/events/list-events.d.ts.map +0 -1
  255. package/tools/events/list-events.js +0 -418
  256. package/tools/events/list-events.js.map +0 -1
  257. package/tools/events/list-events.mjs +0 -411
  258. package/tools/events/list-events.mjs.map +0 -1
  259. package/tools/index.d.mts +0 -10
  260. package/tools/index.d.mts.map +0 -1
  261. package/tools/index.d.ts +0 -10
  262. package/tools/index.d.ts.map +0 -1
  263. package/tools/index.js +0 -117
  264. package/tools/index.js.map +0 -1
  265. package/tools/index.mjs +0 -110
  266. package/tools/index.mjs.map +0 -1
  267. package/tools/links/bulk/create-links-bulk.d.mts +0 -51
  268. package/tools/links/bulk/create-links-bulk.d.mts.map +0 -1
  269. package/tools/links/bulk/create-links-bulk.d.ts +0 -51
  270. package/tools/links/bulk/create-links-bulk.d.ts.map +0 -1
  271. package/tools/links/bulk/create-links-bulk.js +0 -956
  272. package/tools/links/bulk/create-links-bulk.js.map +0 -1
  273. package/tools/links/bulk/create-links-bulk.mjs +0 -949
  274. package/tools/links/bulk/create-links-bulk.mjs.map +0 -1
  275. package/tools/links/bulk/delete-links-bulk.d.mts +0 -51
  276. package/tools/links/bulk/delete-links-bulk.d.mts.map +0 -1
  277. package/tools/links/bulk/delete-links-bulk.d.ts +0 -51
  278. package/tools/links/bulk/delete-links-bulk.d.ts.map +0 -1
  279. package/tools/links/bulk/delete-links-bulk.js +0 -58
  280. package/tools/links/bulk/delete-links-bulk.js.map +0 -1
  281. package/tools/links/bulk/delete-links-bulk.mjs +0 -51
  282. package/tools/links/bulk/delete-links-bulk.mjs.map +0 -1
  283. package/tools/links/count-links.d.mts +0 -51
  284. package/tools/links/count-links.d.mts.map +0 -1
  285. package/tools/links/count-links.d.ts +0 -51
  286. package/tools/links/count-links.d.ts.map +0 -1
  287. package/tools/links/count-links.js +0 -951
  288. package/tools/links/count-links.js.map +0 -1
  289. package/tools/links/count-links.mjs +0 -944
  290. package/tools/links/count-links.mjs.map +0 -1
  291. package/tools/links/create-links.d.mts +0 -51
  292. package/tools/links/create-links.d.mts.map +0 -1
  293. package/tools/links/create-links.d.ts +0 -51
  294. package/tools/links/create-links.d.ts.map +0 -1
  295. package/tools/links/create-links.js +0 -947
  296. package/tools/links/create-links.js.map +0 -1
  297. package/tools/links/create-links.mjs +0 -940
  298. package/tools/links/create-links.mjs.map +0 -1
  299. package/tools/links/delete-links.d.mts +0 -51
  300. package/tools/links/delete-links.d.mts.map +0 -1
  301. package/tools/links/delete-links.d.ts +0 -51
  302. package/tools/links/delete-links.d.ts.map +0 -1
  303. package/tools/links/delete-links.js +0 -55
  304. package/tools/links/delete-links.js.map +0 -1
  305. package/tools/links/delete-links.mjs +0 -48
  306. package/tools/links/delete-links.mjs.map +0 -1
  307. package/tools/links/list-links.d.mts +0 -51
  308. package/tools/links/list-links.d.mts.map +0 -1
  309. package/tools/links/list-links.d.ts +0 -51
  310. package/tools/links/list-links.d.ts.map +0 -1
  311. package/tools/links/list-links.js +0 -973
  312. package/tools/links/list-links.js.map +0 -1
  313. package/tools/links/list-links.mjs +0 -966
  314. package/tools/links/list-links.mjs.map +0 -1
  315. package/tools/links/retrieve-info-links.d.mts +0 -51
  316. package/tools/links/retrieve-info-links.d.mts.map +0 -1
  317. package/tools/links/retrieve-info-links.d.ts +0 -51
  318. package/tools/links/retrieve-info-links.d.ts.map +0 -1
  319. package/tools/links/retrieve-info-links.js +0 -71
  320. package/tools/links/retrieve-info-links.js.map +0 -1
  321. package/tools/links/retrieve-info-links.mjs +0 -64
  322. package/tools/links/retrieve-info-links.mjs.map +0 -1
  323. package/tools/links/update-links.d.mts +0 -51
  324. package/tools/links/update-links.d.mts.map +0 -1
  325. package/tools/links/update-links.d.ts +0 -51
  326. package/tools/links/update-links.d.ts.map +0 -1
  327. package/tools/links/update-links.js +0 -953
  328. package/tools/links/update-links.js.map +0 -1
  329. package/tools/links/update-links.mjs +0 -946
  330. package/tools/links/update-links.mjs.map +0 -1
  331. package/tools/links/upsert-links.d.mts +0 -51
  332. package/tools/links/upsert-links.d.mts.map +0 -1
  333. package/tools/links/upsert-links.d.ts +0 -51
  334. package/tools/links/upsert-links.d.ts.map +0 -1
  335. package/tools/links/upsert-links.js +0 -947
  336. package/tools/links/upsert-links.js.map +0 -1
  337. package/tools/links/upsert-links.mjs +0 -940
  338. package/tools/links/upsert-links.mjs.map +0 -1
  339. package/tools/projects/list-projects.d.mts +0 -51
  340. package/tools/projects/list-projects.d.mts.map +0 -1
  341. package/tools/projects/list-projects.d.ts +0 -51
  342. package/tools/projects/list-projects.d.ts.map +0 -1
  343. package/tools/projects/list-projects.js +0 -51
  344. package/tools/projects/list-projects.js.map +0 -1
  345. package/tools/projects/list-projects.mjs +0 -44
  346. package/tools/projects/list-projects.mjs.map +0 -1
  347. package/tools/projects/retrieve-projects.d.mts +0 -51
  348. package/tools/projects/retrieve-projects.d.mts.map +0 -1
  349. package/tools/projects/retrieve-projects.d.ts +0 -51
  350. package/tools/projects/retrieve-projects.d.ts.map +0 -1
  351. package/tools/projects/retrieve-projects.js +0 -55
  352. package/tools/projects/retrieve-projects.js.map +0 -1
  353. package/tools/projects/retrieve-projects.mjs +0 -48
  354. package/tools/projects/retrieve-projects.mjs.map +0 -1
  355. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts +0 -51
  356. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts.map +0 -1
  357. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts +0 -51
  358. package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts.map +0 -1
  359. package/tools/qrcodes/bulk/create-qrcodes-bulk.js +0 -1068
  360. package/tools/qrcodes/bulk/create-qrcodes-bulk.js.map +0 -1
  361. package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs +0 -1061
  362. package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs.map +0 -1
  363. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts +0 -51
  364. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +0 -1
  365. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts +0 -51
  366. package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +0 -1
  367. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +0 -58
  368. package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +0 -1
  369. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +0 -51
  370. package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +0 -1
  371. package/tools/qrcodes/count-qrcodes.d.mts +0 -51
  372. package/tools/qrcodes/count-qrcodes.d.mts.map +0 -1
  373. package/tools/qrcodes/count-qrcodes.d.ts +0 -51
  374. package/tools/qrcodes/count-qrcodes.d.ts.map +0 -1
  375. package/tools/qrcodes/count-qrcodes.js +0 -215
  376. package/tools/qrcodes/count-qrcodes.js.map +0 -1
  377. package/tools/qrcodes/count-qrcodes.mjs +0 -208
  378. package/tools/qrcodes/count-qrcodes.mjs.map +0 -1
  379. package/tools/qrcodes/create-qrcodes.d.mts +0 -51
  380. package/tools/qrcodes/create-qrcodes.d.mts.map +0 -1
  381. package/tools/qrcodes/create-qrcodes.d.ts +0 -51
  382. package/tools/qrcodes/create-qrcodes.d.ts.map +0 -1
  383. package/tools/qrcodes/create-qrcodes.js +0 -1059
  384. package/tools/qrcodes/create-qrcodes.js.map +0 -1
  385. package/tools/qrcodes/create-qrcodes.mjs +0 -1052
  386. package/tools/qrcodes/create-qrcodes.mjs.map +0 -1
  387. package/tools/qrcodes/delete-qrcodes.d.mts +0 -51
  388. package/tools/qrcodes/delete-qrcodes.d.mts.map +0 -1
  389. package/tools/qrcodes/delete-qrcodes.d.ts +0 -51
  390. package/tools/qrcodes/delete-qrcodes.d.ts.map +0 -1
  391. package/tools/qrcodes/delete-qrcodes.js +0 -55
  392. package/tools/qrcodes/delete-qrcodes.js.map +0 -1
  393. package/tools/qrcodes/delete-qrcodes.mjs +0 -48
  394. package/tools/qrcodes/delete-qrcodes.mjs.map +0 -1
  395. package/tools/qrcodes/list-qrcodes.d.mts +0 -51
  396. package/tools/qrcodes/list-qrcodes.d.mts.map +0 -1
  397. package/tools/qrcodes/list-qrcodes.d.ts +0 -51
  398. package/tools/qrcodes/list-qrcodes.d.ts.map +0 -1
  399. package/tools/qrcodes/list-qrcodes.js +0 -217
  400. package/tools/qrcodes/list-qrcodes.js.map +0 -1
  401. package/tools/qrcodes/list-qrcodes.mjs +0 -210
  402. package/tools/qrcodes/list-qrcodes.mjs.map +0 -1
  403. package/tools/qrcodes/retrieve-qrcodes.d.mts +0 -51
  404. package/tools/qrcodes/retrieve-qrcodes.d.mts.map +0 -1
  405. package/tools/qrcodes/retrieve-qrcodes.d.ts +0 -51
  406. package/tools/qrcodes/retrieve-qrcodes.d.ts.map +0 -1
  407. package/tools/qrcodes/retrieve-qrcodes.js +0 -65
  408. package/tools/qrcodes/retrieve-qrcodes.js.map +0 -1
  409. package/tools/qrcodes/retrieve-qrcodes.mjs +0 -58
  410. package/tools/qrcodes/retrieve-qrcodes.mjs.map +0 -1
  411. package/tools/qrcodes/update-qrcodes.d.mts +0 -51
  412. package/tools/qrcodes/update-qrcodes.d.mts.map +0 -1
  413. package/tools/qrcodes/update-qrcodes.d.ts +0 -51
  414. package/tools/qrcodes/update-qrcodes.d.ts.map +0 -1
  415. package/tools/qrcodes/update-qrcodes.js +0 -1065
  416. package/tools/qrcodes/update-qrcodes.js.map +0 -1
  417. package/tools/qrcodes/update-qrcodes.mjs +0 -1058
  418. package/tools/qrcodes/update-qrcodes.mjs.map +0 -1
  419. package/tools/qrcodes/upsert-qrcodes.d.mts +0 -51
  420. package/tools/qrcodes/upsert-qrcodes.d.mts.map +0 -1
  421. package/tools/qrcodes/upsert-qrcodes.d.ts +0 -51
  422. package/tools/qrcodes/upsert-qrcodes.d.ts.map +0 -1
  423. package/tools/qrcodes/upsert-qrcodes.js +0 -1059
  424. package/tools/qrcodes/upsert-qrcodes.js.map +0 -1
  425. package/tools/qrcodes/upsert-qrcodes.mjs +0 -1052
  426. package/tools/qrcodes/upsert-qrcodes.mjs.map +0 -1
  427. package/tools/tags/create-tags.d.mts +0 -51
  428. package/tools/tags/create-tags.d.mts.map +0 -1
  429. package/tools/tags/create-tags.d.ts +0 -51
  430. package/tools/tags/create-tags.d.ts.map +0 -1
  431. package/tools/tags/create-tags.js +0 -58
  432. package/tools/tags/create-tags.js.map +0 -1
  433. package/tools/tags/create-tags.mjs +0 -51
  434. package/tools/tags/create-tags.mjs.map +0 -1
  435. package/tools/tags/delete-tags.d.mts +0 -51
  436. package/tools/tags/delete-tags.d.mts.map +0 -1
  437. package/tools/tags/delete-tags.d.ts +0 -51
  438. package/tools/tags/delete-tags.d.ts.map +0 -1
  439. package/tools/tags/delete-tags.js +0 -55
  440. package/tools/tags/delete-tags.js.map +0 -1
  441. package/tools/tags/delete-tags.mjs +0 -48
  442. package/tools/tags/delete-tags.mjs.map +0 -1
  443. package/tools/tags/list-tags.d.mts +0 -51
  444. package/tools/tags/list-tags.d.mts.map +0 -1
  445. package/tools/tags/list-tags.d.ts +0 -51
  446. package/tools/tags/list-tags.d.ts.map +0 -1
  447. package/tools/tags/list-tags.js +0 -87
  448. package/tools/tags/list-tags.js.map +0 -1
  449. package/tools/tags/list-tags.mjs +0 -80
  450. package/tools/tags/list-tags.mjs.map +0 -1
  451. package/tools/tags/update-tags.d.mts +0 -51
  452. package/tools/tags/update-tags.d.mts.map +0 -1
  453. package/tools/tags/update-tags.d.ts +0 -51
  454. package/tools/tags/update-tags.d.ts.map +0 -1
  455. package/tools/tags/update-tags.js +0 -63
  456. package/tools/tags/update-tags.js.map +0 -1
  457. package/tools/tags/update-tags.mjs +0 -56
  458. package/tools/tags/update-tags.mjs.map +0 -1
  459. package/tools/track/track-lead-track.d.mts +0 -51
  460. package/tools/track/track-lead-track.d.mts.map +0 -1
  461. package/tools/track/track-lead-track.d.ts +0 -51
  462. package/tools/track/track-lead-track.d.ts.map +0 -1
  463. package/tools/track/track-lead-track.js +0 -87
  464. package/tools/track/track-lead-track.js.map +0 -1
  465. package/tools/track/track-lead-track.mjs +0 -80
  466. package/tools/track/track-lead-track.mjs.map +0 -1
  467. package/tools/track/track-sale-track.d.mts +0 -51
  468. package/tools/track/track-sale-track.d.mts.map +0 -1
  469. package/tools/track/track-sale-track.d.ts +0 -51
  470. package/tools/track/track-sale-track.d.ts.map +0 -1
  471. package/tools/track/track-sale-track.js +0 -99
  472. package/tools/track/track-sale-track.js.map +0 -1
  473. package/tools/track/track-sale-track.mjs +0 -92
  474. package/tools/track/track-sale-track.mjs.map +0 -1
  475. package/tools/types.d.mts.map +0 -1
  476. package/tools/types.d.ts.map +0 -1
  477. package/tools/types.js.map +0 -1
  478. package/tools/types.mjs.map +0 -1
  479. package/tools.d.mts +0 -2
  480. package/tools.d.mts.map +0 -1
  481. package/tools.d.ts +0 -2
  482. package/tools.d.ts.map +0 -1
  483. package/tools.js +0 -18
  484. package/tools.js.map +0 -1
  485. package/tools.mjs +0 -2
  486. package/tools.mjs.map +0 -1
  487. /package/{tools/types.js → types.js} +0 -0
  488. /package/{tools/types.mjs → types.mjs} +0 -0
package/src/options.ts CHANGED
@@ -1,140 +1,105 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
1
3
  import qs from 'qs';
2
4
  import yargs from 'yargs';
3
5
  import { hideBin } from 'yargs/helpers';
4
6
  import z from 'zod';
5
- import { endpoints, Filter } from './tools';
6
- import { ClientCapabilities, knownClients, ClientType } from './compat';
7
+ import { readEnv } from './util';
7
8
 
8
9
  export type CLIOptions = McpOptions & {
9
- list: boolean;
10
+ debug: boolean;
11
+ logFormat: 'json' | 'pretty';
10
12
  transport: 'stdio' | 'http';
11
13
  port: number | undefined;
12
14
  socket: string | undefined;
13
15
  };
14
16
 
15
17
  export type McpOptions = {
16
- client?: ClientType | undefined;
17
- includeDynamicTools?: boolean | undefined;
18
- includeAllTools?: boolean | undefined;
19
- includeCodeTools?: boolean | undefined;
18
+ includeCodeTool?: boolean | undefined;
20
19
  includeDocsTools?: boolean | undefined;
21
- filters?: Filter[] | undefined;
22
- capabilities?: Partial<ClientCapabilities> | undefined;
20
+ stainlessApiKey?: string | undefined;
21
+ docsSearchMode?: 'local' | undefined;
22
+ docsDir?: string | undefined;
23
+ codeAllowHttpGets?: boolean | undefined;
24
+ codeAllowedMethods?: string[] | undefined;
25
+ codeBlockedMethods?: string[] | undefined;
26
+ codeExecutionMode: McpCodeExecutionMode;
27
+ customInstructionsPath?: string | undefined;
23
28
  };
24
29
 
25
- const CAPABILITY_CHOICES = [
26
- 'top-level-unions',
27
- 'valid-json',
28
- 'refs',
29
- 'unions',
30
- 'formats',
31
- 'tool-name-length',
32
- ] as const;
33
-
34
- type Capability = (typeof CAPABILITY_CHOICES)[number];
35
-
36
- function parseCapabilityValue(cap: string): { name: Capability; value?: number } {
37
- if (cap.startsWith('tool-name-length=')) {
38
- const parts = cap.split('=');
39
- if (parts.length === 2) {
40
- const length = parseInt(parts[1]!, 10);
41
- if (!isNaN(length)) {
42
- return { name: 'tool-name-length', value: length };
43
- }
44
- throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
45
- }
46
- throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
47
- }
48
- if (!CAPABILITY_CHOICES.includes(cap as Capability)) {
49
- throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
50
- }
51
- return { name: cap as Capability };
52
- }
30
+ export type McpCodeExecutionMode = 'local';
53
31
 
54
32
  export function parseCLIOptions(): CLIOptions {
55
33
  const opts = yargs(hideBin(process.argv))
56
- .option('tools', {
57
- type: 'string',
58
- array: true,
59
- choices: ['dynamic', 'all', 'code', 'docs'],
60
- description: 'Use dynamic tools or all tools',
61
- })
62
- .option('no-tools', {
63
- type: 'string',
64
- array: true,
65
- choices: ['dynamic', 'all', 'code', 'docs'],
66
- description: 'Do not use any dynamic or all tools',
34
+ .option('code-allow-http-gets', {
35
+ type: 'boolean',
36
+ description:
37
+ 'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.',
67
38
  })
68
- .option('tool', {
39
+ .option('code-allowed-methods', {
69
40
  type: 'string',
70
41
  array: true,
71
- description: 'Include tools matching the specified names',
42
+ description:
43
+ 'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
72
44
  })
73
- .option('resource', {
45
+ .option('code-blocked-methods', {
74
46
  type: 'string',
75
47
  array: true,
76
- description: 'Include tools matching the specified resources',
48
+ description:
49
+ 'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
77
50
  })
78
- .option('operation', {
51
+ .option('code-execution-mode', {
79
52
  type: 'string',
80
- array: true,
81
- choices: ['read', 'write'],
82
- description: 'Include tools matching the specified operations',
53
+ choices: ['local'],
54
+ default: 'local',
55
+ description:
56
+ 'The server was generated without access to the Stainless API, so code execution can only run locally on the MCP server machine.',
83
57
  })
84
- .option('tag', {
58
+ .option('custom-instructions-path', {
85
59
  type: 'string',
86
- array: true,
87
- description: 'Include tools with the specified tags',
60
+ description: 'Path to custom instructions for the MCP server',
88
61
  })
89
- .option('no-tool', {
62
+ .option('debug', { type: 'boolean', description: 'Enable debug logging' })
63
+ .option('docs-dir', {
90
64
  type: 'string',
91
- array: true,
92
- description: 'Exclude tools matching the specified names',
65
+ description:
66
+ 'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.',
93
67
  })
94
- .option('no-resource', {
68
+ .option('docs-search-mode', {
95
69
  type: 'string',
96
- array: true,
97
- description: 'Exclude tools matching the specified resources',
70
+ choices: ['local'],
71
+ default: 'local',
72
+ description:
73
+ "Documentation search will use an in-memory search index built from embedded SDK method data and optional local docs files; the 'stainless-api' option is unavailable.",
98
74
  })
99
- .option('no-operation', {
75
+ .option('log-format', {
100
76
  type: 'string',
101
- array: true,
102
- description: 'Exclude tools matching the specified operations',
77
+ choices: ['json', 'pretty'],
78
+ description: 'Format for log output; defaults to json unless tty is detected',
103
79
  })
104
- .option('no-tag', {
80
+ .option('no-tools', {
105
81
  type: 'string',
106
82
  array: true,
107
- description: 'Exclude tools with the specified tags',
108
- })
109
- .option('list', {
110
- type: 'boolean',
111
- description: 'List all tools and exit',
83
+ choices: ['code', 'docs'],
84
+ description: 'Tools to explicitly disable',
112
85
  })
113
- .option('client', {
114
- type: 'string',
115
- choices: Object.keys(knownClients),
116
- description: 'Specify the MCP client being used',
86
+ .option('port', {
87
+ type: 'number',
88
+ default: 3000,
89
+ description: 'Port to serve on if using http transport',
117
90
  })
118
- .option('capability', {
91
+ .option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
92
+ .option('stainless-api-key', {
119
93
  type: 'string',
120
- array: true,
121
- description: 'Specify client capabilities',
122
- coerce: (values: string[]) => {
123
- return values.flatMap((v) => v.split(','));
124
- },
94
+ default: readEnv('STAINLESS_API_KEY'),
95
+ description:
96
+ 'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.',
125
97
  })
126
- .option('no-capability', {
98
+ .option('tools', {
127
99
  type: 'string',
128
100
  array: true,
129
- description: 'Unset client capabilities',
130
- choices: CAPABILITY_CHOICES,
131
- coerce: (values: string[]) => {
132
- return values.flatMap((v) => v.split(','));
133
- },
134
- })
135
- .option('describe-capabilities', {
136
- type: 'boolean',
137
- description: 'Print detailed explanation of client capabilities and exit',
101
+ choices: ['code', 'docs'],
102
+ description: 'Tools to explicitly enable',
138
103
  })
139
104
  .option('transport', {
140
105
  type: 'string',
@@ -142,133 +107,40 @@ export function parseCLIOptions(): CLIOptions {
142
107
  default: 'stdio',
143
108
  description: 'What transport to use; stdio for local servers or http for remote servers',
144
109
  })
145
- .option('port', {
146
- type: 'number',
147
- description: 'Port to serve on if using http transport',
148
- })
149
- .option('socket', {
150
- type: 'string',
151
- description: 'Unix socket to serve on if using http transport',
152
- })
110
+ .env('MCP_SERVER')
111
+ .version(true)
153
112
  .help();
154
113
 
155
- for (const [command, desc] of examples()) {
156
- opts.example(command, desc);
157
- }
158
-
159
114
  const argv = opts.parseSync();
160
115
 
161
- // Handle describe-capabilities flag
162
- if (argv.describeCapabilities) {
163
- console.log(getCapabilitiesExplanation());
164
- process.exit(0);
165
- }
166
-
167
- const filters: Filter[] = [];
168
-
169
- // Helper function to support comma-separated values
170
- const splitValues = (values: string[] | undefined): string[] => {
171
- if (!values) return [];
172
- return values.flatMap((v) => v.split(','));
173
- };
174
-
175
- for (const tag of splitValues(argv.tag)) {
176
- filters.push({ type: 'tag', op: 'include', value: tag });
177
- }
178
-
179
- for (const tag of splitValues(argv.noTag)) {
180
- filters.push({ type: 'tag', op: 'exclude', value: tag });
181
- }
182
-
183
- for (const resource of splitValues(argv.resource)) {
184
- filters.push({ type: 'resource', op: 'include', value: resource });
185
- }
186
-
187
- for (const resource of splitValues(argv.noResource)) {
188
- filters.push({ type: 'resource', op: 'exclude', value: resource });
189
- }
190
-
191
- for (const tool of splitValues(argv.tool)) {
192
- filters.push({ type: 'tool', op: 'include', value: tool });
193
- }
194
-
195
- for (const tool of splitValues(argv.noTool)) {
196
- filters.push({ type: 'tool', op: 'exclude', value: tool });
197
- }
198
-
199
- for (const operation of splitValues(argv.operation)) {
200
- filters.push({ type: 'operation', op: 'include', value: operation });
201
- }
202
-
203
- for (const operation of splitValues(argv.noOperation)) {
204
- filters.push({ type: 'operation', op: 'exclude', value: operation });
205
- }
206
-
207
- // Parse client capabilities
208
- const clientCapabilities: Partial<ClientCapabilities> = {};
209
-
210
- // Apply individual capability overrides
211
- if (Array.isArray(argv.capability)) {
212
- for (const cap of argv.capability) {
213
- const parsedCap = parseCapabilityValue(cap);
214
- if (parsedCap.name === 'top-level-unions') {
215
- clientCapabilities.topLevelUnions = true;
216
- } else if (parsedCap.name === 'valid-json') {
217
- clientCapabilities.validJson = true;
218
- } else if (parsedCap.name === 'refs') {
219
- clientCapabilities.refs = true;
220
- } else if (parsedCap.name === 'unions') {
221
- clientCapabilities.unions = true;
222
- } else if (parsedCap.name === 'formats') {
223
- clientCapabilities.formats = true;
224
- } else if (parsedCap.name === 'tool-name-length') {
225
- clientCapabilities.toolNameLength = parsedCap.value;
226
- }
227
- }
228
- }
229
-
230
- // Handle no-capability options to unset capabilities
231
- if (Array.isArray(argv.noCapability)) {
232
- for (const cap of argv.noCapability) {
233
- if (cap === 'top-level-unions') {
234
- clientCapabilities.topLevelUnions = false;
235
- } else if (cap === 'valid-json') {
236
- clientCapabilities.validJson = false;
237
- } else if (cap === 'refs') {
238
- clientCapabilities.refs = false;
239
- } else if (cap === 'unions') {
240
- clientCapabilities.unions = false;
241
- } else if (cap === 'formats') {
242
- clientCapabilities.formats = false;
243
- } else if (cap === 'tool-name-length') {
244
- clientCapabilities.toolNameLength = undefined;
245
- }
246
- }
247
- }
248
-
249
- const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code' | 'docs') =>
116
+ const shouldIncludeToolType = (toolType: 'code' | 'docs') =>
250
117
  argv.noTools?.includes(toolType) ? false
251
118
  : argv.tools?.includes(toolType) ? true
252
119
  : undefined;
253
120
 
254
- const includeDynamicTools = shouldIncludeToolType('dynamic');
255
- const includeAllTools = shouldIncludeToolType('all');
256
- const includeCodeTools = shouldIncludeToolType('code');
121
+ const includeCodeTool = shouldIncludeToolType('code');
257
122
  const includeDocsTools = shouldIncludeToolType('docs');
258
123
 
259
124
  const transport = argv.transport as 'stdio' | 'http';
125
+ const logFormat =
126
+ argv.logFormat ? (argv.logFormat as 'json' | 'pretty')
127
+ : process.stderr.isTTY ? 'pretty'
128
+ : 'json';
260
129
 
261
- const client = argv.client as ClientType;
262
130
  return {
263
- client: client && client !== 'infer' && knownClients[client] ? client : undefined,
264
- includeDynamicTools,
265
- includeAllTools,
266
- includeCodeTools,
267
- includeDocsTools,
268
- filters,
269
- capabilities: clientCapabilities,
270
- list: argv.list || false,
131
+ ...(includeCodeTool !== undefined && { includeCodeTool }),
132
+ ...(includeDocsTools !== undefined && { includeDocsTools }),
133
+ debug: !!argv.debug,
134
+ stainlessApiKey: argv.stainlessApiKey,
135
+ docsSearchMode: argv.docsSearchMode as 'local' | undefined,
136
+ docsDir: argv.docsDir,
137
+ codeAllowHttpGets: argv.codeAllowHttpGets,
138
+ codeAllowedMethods: argv.codeAllowedMethods,
139
+ codeBlockedMethods: argv.codeBlockedMethods,
140
+ codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
141
+ customInstructionsPath: argv.customInstructionsPath,
271
142
  transport,
143
+ logFormat,
272
144
  port: argv.port,
273
145
  socket: argv.socket,
274
146
  };
@@ -284,190 +156,30 @@ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
284
156
  );
285
157
 
286
158
  const QueryOptions = z.object({
287
- tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe('Specify which MCP tools to use'),
288
- no_tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe(
289
- 'Specify which MCP tools to not use.',
290
- ),
159
+ tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to use'),
160
+ no_tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to not use.'),
291
161
  tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
292
- resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
293
- operation: coerceArray(z.enum(['read', 'write'])).describe(
294
- 'Include tools matching the specified operations',
295
- ),
296
- tag: coerceArray(z.string()).describe('Include tools with the specified tags'),
297
- no_tool: coerceArray(z.string()).describe('Exclude tools matching the specified names'),
298
- no_resource: coerceArray(z.string()).describe('Exclude tools matching the specified resources'),
299
- no_operation: coerceArray(z.enum(['read', 'write'])).describe(
300
- 'Exclude tools matching the specified operations',
301
- ),
302
- no_tag: coerceArray(z.string()).describe('Exclude tools with the specified tags'),
303
- client: ClientType.optional().describe('Specify the MCP client being used'),
304
- capability: coerceArray(z.string()).describe('Specify client capabilities'),
305
- no_capability: coerceArray(z.enum(CAPABILITY_CHOICES)).describe('Unset client capabilities'),
306
162
  });
307
163
 
308
164
  export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions {
309
165
  const queryObject = typeof query === 'string' ? qs.parse(query) : query;
310
166
  const queryOptions = QueryOptions.parse(queryObject);
311
167
 
312
- const filters: Filter[] = [...(defaultOptions.filters ?? [])];
313
-
314
- for (const resource of queryOptions.resource || []) {
315
- filters.push({ type: 'resource', op: 'include', value: resource });
316
- }
317
- for (const operation of queryOptions.operation || []) {
318
- filters.push({ type: 'operation', op: 'include', value: operation });
319
- }
320
- for (const tag of queryOptions.tag || []) {
321
- filters.push({ type: 'tag', op: 'include', value: tag });
322
- }
323
- for (const tool of queryOptions.tool || []) {
324
- filters.push({ type: 'tool', op: 'include', value: tool });
325
- }
326
- for (const resource of queryOptions.no_resource || []) {
327
- filters.push({ type: 'resource', op: 'exclude', value: resource });
328
- }
329
- for (const operation of queryOptions.no_operation || []) {
330
- filters.push({ type: 'operation', op: 'exclude', value: operation });
331
- }
332
- for (const tag of queryOptions.no_tag || []) {
333
- filters.push({ type: 'tag', op: 'exclude', value: tag });
334
- }
335
- for (const tool of queryOptions.no_tool || []) {
336
- filters.push({ type: 'tool', op: 'exclude', value: tool });
337
- }
338
-
339
- // Parse client capabilities
340
- const clientCapabilities: Partial<ClientCapabilities> = { ...defaultOptions.capabilities };
341
-
342
- for (const cap of queryOptions.capability || []) {
343
- const parsed = parseCapabilityValue(cap);
344
- if (parsed.name === 'top-level-unions') {
345
- clientCapabilities.topLevelUnions = true;
346
- } else if (parsed.name === 'valid-json') {
347
- clientCapabilities.validJson = true;
348
- } else if (parsed.name === 'refs') {
349
- clientCapabilities.refs = true;
350
- } else if (parsed.name === 'unions') {
351
- clientCapabilities.unions = true;
352
- } else if (parsed.name === 'formats') {
353
- clientCapabilities.formats = true;
354
- } else if (parsed.name === 'tool-name-length') {
355
- clientCapabilities.toolNameLength = parsed.value;
356
- }
357
- }
358
-
359
- for (const cap of queryOptions.no_capability || []) {
360
- if (cap === 'top-level-unions') {
361
- clientCapabilities.topLevelUnions = false;
362
- } else if (cap === 'valid-json') {
363
- clientCapabilities.validJson = false;
364
- } else if (cap === 'refs') {
365
- clientCapabilities.refs = false;
366
- } else if (cap === 'unions') {
367
- clientCapabilities.unions = false;
368
- } else if (cap === 'formats') {
369
- clientCapabilities.formats = false;
370
- } else if (cap === 'tool-name-length') {
371
- clientCapabilities.toolNameLength = undefined;
372
- }
373
- }
374
-
375
- let dynamicTools: boolean | undefined =
376
- queryOptions.no_tools && queryOptions.no_tools?.includes('dynamic') ? false
377
- : queryOptions.tools?.includes('dynamic') ? true
378
- : defaultOptions.includeDynamicTools;
379
-
380
- let allTools: boolean | undefined =
381
- queryOptions.no_tools && queryOptions.no_tools?.includes('all') ? false
382
- : queryOptions.tools?.includes('all') ? true
383
- : defaultOptions.includeAllTools;
168
+ let codeTool: boolean | undefined =
169
+ queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
170
+ : queryOptions.tools?.includes('code') ? true
171
+ : defaultOptions.includeCodeTool;
384
172
 
385
173
  let docsTools: boolean | undefined =
386
174
  queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
387
175
  : queryOptions.tools?.includes('docs') ? true
388
176
  : defaultOptions.includeDocsTools;
389
177
 
390
- let codeTools: boolean | undefined =
391
- queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
392
- : queryOptions.tools?.includes('code') && defaultOptions.includeCodeTools ? true
393
- : defaultOptions.includeCodeTools;
394
-
395
178
  return {
396
- client: queryOptions.client ?? defaultOptions.client,
397
- includeDynamicTools: dynamicTools,
398
- includeAllTools: allTools,
399
- includeCodeTools: codeTools,
400
- includeDocsTools: docsTools,
401
- filters,
402
- capabilities: clientCapabilities,
179
+ ...(codeTool !== undefined && { includeCodeTool: codeTool }),
180
+ ...(docsTools !== undefined && { includeDocsTools: docsTools }),
181
+ codeExecutionMode: defaultOptions.codeExecutionMode,
182
+ docsSearchMode: defaultOptions.docsSearchMode,
183
+ docsDir: defaultOptions.docsDir,
403
184
  };
404
185
  }
405
-
406
- function getCapabilitiesExplanation(): string {
407
- return `
408
- Client Capabilities Explanation:
409
-
410
- 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.
411
-
412
- 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.
413
-
414
- Available Capabilities:
415
-
416
- # top-level-unions
417
- 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.
418
-
419
- # refs
420
- 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.
421
-
422
- # valid-json
423
- 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.
424
-
425
- # unions
426
- 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.
427
-
428
- # formats
429
- 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.
430
-
431
- # tool-name-length=N
432
- 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.
433
-
434
- Client Presets (--client):
435
- Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
436
-
437
- Current presets:
438
- ${JSON.stringify(knownClients, null, 2)}
439
- `;
440
- }
441
-
442
- function examples(): [string, string][] {
443
- const firstEndpoint = endpoints[0]!;
444
- const secondEndpoint =
445
- endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
446
- const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
447
- const otherEndpoint = secondEndpoint || firstEndpoint;
448
-
449
- return [
450
- [
451
- `--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
452
- 'Include tools by name',
453
- ],
454
- [
455
- `--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
456
- 'Filter by resource and operation',
457
- ],
458
- [
459
- `--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
460
- 'Use resource wildcards and exclusions',
461
- ],
462
- [`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
463
- [
464
- `--capability="top-level-unions" --capability="tool-name-length=40"`,
465
- 'Specify individual client capabilities',
466
- ],
467
- [
468
- `--client="cursor" --no-capability="tool-name-length"`,
469
- 'Use cursor client preset but remove tool name length limit',
470
- ],
471
- ...(tag ? [[`--tag="${tag}"`, 'Filter based on tags'] as [string, string]] : []),
472
- ];
473
- }