mcp4openapi 0.2.8 → 0.3.1

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 (358) hide show
  1. package/README.md +143 -63
  2. package/dist/scripts/validate-profile.js +3 -3
  3. package/dist/scripts/validate-profile.js.map +1 -1
  4. package/dist/src/argument-normalizer.d.ts +5 -0
  5. package/dist/src/argument-normalizer.d.ts.map +1 -0
  6. package/dist/src/argument-normalizer.js +61 -0
  7. package/dist/src/argument-normalizer.js.map +1 -0
  8. package/dist/src/auth/oauth-provider.d.ts +131 -0
  9. package/dist/src/auth/oauth-provider.d.ts.map +1 -0
  10. package/dist/src/auth/oauth-provider.js +839 -0
  11. package/dist/src/auth/oauth-provider.js.map +1 -0
  12. package/dist/src/cli-config.d.ts +9 -0
  13. package/dist/src/cli-config.d.ts.map +1 -0
  14. package/dist/src/cli-config.js +111 -0
  15. package/dist/src/cli-config.js.map +1 -0
  16. package/dist/src/core/cli-config.d.ts +9 -0
  17. package/dist/src/core/cli-config.d.ts.map +1 -0
  18. package/dist/src/core/cli-config.js +125 -0
  19. package/dist/src/core/cli-config.js.map +1 -0
  20. package/dist/src/core/constants.d.ts +86 -0
  21. package/dist/src/core/constants.d.ts.map +1 -0
  22. package/dist/src/core/constants.js +86 -0
  23. package/dist/src/core/constants.js.map +1 -0
  24. package/dist/src/core/errors.d.ts +59 -0
  25. package/dist/src/core/errors.d.ts.map +1 -0
  26. package/dist/src/core/errors.js +119 -0
  27. package/dist/src/core/errors.js.map +1 -0
  28. package/dist/src/core/filtering.d.ts +19 -0
  29. package/dist/src/core/filtering.d.ts.map +1 -0
  30. package/dist/src/core/filtering.js +292 -0
  31. package/dist/src/core/filtering.js.map +1 -0
  32. package/dist/src/core/index.d.ts +26 -0
  33. package/dist/src/core/index.d.ts.map +1 -0
  34. package/dist/src/core/index.js +276 -0
  35. package/dist/src/core/index.js.map +1 -0
  36. package/dist/src/core/lib.d.ts +8 -0
  37. package/dist/src/core/lib.d.ts.map +1 -0
  38. package/dist/src/core/lib.js +7 -0
  39. package/dist/src/core/lib.js.map +1 -0
  40. package/dist/src/core/logger.d.ts +59 -0
  41. package/dist/src/core/logger.d.ts.map +1 -0
  42. package/dist/src/core/logger.js +197 -0
  43. package/dist/src/core/logger.js.map +1 -0
  44. package/dist/src/core/metrics.d.ts +97 -0
  45. package/dist/src/core/metrics.d.ts.map +1 -0
  46. package/dist/src/core/metrics.js +273 -0
  47. package/dist/src/core/metrics.js.map +1 -0
  48. package/dist/src/core/naming-warnings.d.ts +23 -0
  49. package/dist/src/core/naming-warnings.d.ts.map +1 -0
  50. package/dist/src/core/naming-warnings.js +83 -0
  51. package/dist/src/core/naming-warnings.js.map +1 -0
  52. package/dist/src/core/naming.d.ts +58 -0
  53. package/dist/src/core/naming.d.ts.map +1 -0
  54. package/dist/src/core/naming.js +510 -0
  55. package/dist/src/core/naming.js.map +1 -0
  56. package/dist/src/errors.d.ts +6 -0
  57. package/dist/src/errors.d.ts.map +1 -1
  58. package/dist/src/errors.js +15 -6
  59. package/dist/src/errors.js.map +1 -1
  60. package/dist/src/filtering.d.ts +19 -0
  61. package/dist/src/filtering.d.ts.map +1 -0
  62. package/dist/src/filtering.js +292 -0
  63. package/dist/src/filtering.js.map +1 -0
  64. package/dist/src/generated-schemas.d.ts +290 -79
  65. package/dist/src/generated-schemas.d.ts.map +1 -1
  66. package/dist/src/generated-schemas.js +17 -2
  67. package/dist/src/generated-schemas.js.map +1 -1
  68. package/dist/src/http-transport-config.d.ts +6 -0
  69. package/dist/src/http-transport-config.d.ts.map +1 -0
  70. package/dist/src/http-transport-config.js +47 -0
  71. package/dist/src/http-transport-config.js.map +1 -0
  72. package/dist/src/http-transport.d.ts +63 -13
  73. package/dist/src/http-transport.d.ts.map +1 -1
  74. package/dist/src/http-transport.js +1045 -482
  75. package/dist/src/http-transport.js.map +1 -1
  76. package/dist/src/index.d.ts +1 -6
  77. package/dist/src/index.d.ts.map +1 -1
  78. package/dist/src/index.js +1 -170
  79. package/dist/src/index.js.map +1 -1
  80. package/dist/src/interceptors.d.ts +1 -0
  81. package/dist/src/interceptors.d.ts.map +1 -1
  82. package/dist/src/interceptors.js +73 -63
  83. package/dist/src/interceptors.js.map +1 -1
  84. package/dist/src/lib.d.ts +1 -7
  85. package/dist/src/lib.d.ts.map +1 -1
  86. package/dist/src/lib.js +1 -6
  87. package/dist/src/lib.js.map +1 -1
  88. package/dist/src/logger.d.ts +5 -0
  89. package/dist/src/logger.d.ts.map +1 -1
  90. package/dist/src/logger.js +9 -1
  91. package/dist/src/logger.js.map +1 -1
  92. package/dist/src/mcp/mcp-server-manager.d.ts +20 -0
  93. package/dist/src/mcp/mcp-server-manager.d.ts.map +1 -0
  94. package/dist/src/mcp/mcp-server-manager.js +38 -0
  95. package/dist/src/mcp/mcp-server-manager.js.map +1 -0
  96. package/dist/src/mcp/mcp-server.d.ts +205 -0
  97. package/dist/src/mcp/mcp-server.d.ts.map +1 -0
  98. package/dist/src/mcp/mcp-server.js +1473 -0
  99. package/dist/src/mcp/mcp-server.js.map +1 -0
  100. package/dist/src/mcp-server-manager.d.ts +20 -0
  101. package/dist/src/mcp-server-manager.d.ts.map +1 -0
  102. package/dist/src/mcp-server-manager.js +38 -0
  103. package/dist/src/mcp-server-manager.js.map +1 -0
  104. package/dist/src/mcp-server.d.ts +28 -0
  105. package/dist/src/mcp-server.d.ts.map +1 -1
  106. package/dist/src/mcp-server.js +406 -109
  107. package/dist/src/mcp-server.js.map +1 -1
  108. package/dist/src/metrics.d.ts +11 -0
  109. package/dist/src/metrics.d.ts.map +1 -1
  110. package/dist/src/metrics.js +61 -0
  111. package/dist/src/metrics.js.map +1 -1
  112. package/dist/src/oauth-provider.d.ts +5 -0
  113. package/dist/src/oauth-provider.d.ts.map +1 -1
  114. package/dist/src/oauth-provider.js +29 -1
  115. package/dist/src/oauth-provider.js.map +1 -1
  116. package/dist/src/openapi/openapi-parser.d.ts +70 -0
  117. package/dist/src/openapi/openapi-parser.d.ts.map +1 -0
  118. package/dist/src/openapi/openapi-parser.js +458 -0
  119. package/dist/src/openapi/openapi-parser.js.map +1 -0
  120. package/dist/src/profile/profile-loader.d.ts +78 -0
  121. package/dist/src/profile/profile-loader.d.ts.map +1 -0
  122. package/dist/src/profile/profile-loader.js +490 -0
  123. package/dist/src/profile/profile-loader.js.map +1 -0
  124. package/dist/src/profile/profile-registry.d.ts +19 -0
  125. package/dist/src/profile/profile-registry.d.ts.map +1 -0
  126. package/dist/src/profile/profile-registry.js +43 -0
  127. package/dist/src/profile/profile-registry.js.map +1 -0
  128. package/dist/src/profile/profile-resolver.d.ts +41 -0
  129. package/dist/src/profile/profile-resolver.d.ts.map +1 -0
  130. package/dist/src/profile/profile-resolver.js +324 -0
  131. package/dist/src/profile/profile-resolver.js.map +1 -0
  132. package/dist/src/profile/startup-profile.d.ts +17 -0
  133. package/dist/src/profile/startup-profile.d.ts.map +1 -0
  134. package/dist/src/profile/startup-profile.js +30 -0
  135. package/dist/src/profile/startup-profile.js.map +1 -0
  136. package/dist/src/profile/startup-validation.d.ts +11 -0
  137. package/dist/src/profile/startup-validation.d.ts.map +1 -0
  138. package/dist/src/profile/startup-validation.js +21 -0
  139. package/dist/src/profile/startup-validation.js.map +1 -0
  140. package/dist/src/profile-loader.d.ts +1 -0
  141. package/dist/src/profile-loader.d.ts.map +1 -1
  142. package/dist/src/profile-loader.js +14 -3
  143. package/dist/src/profile-loader.js.map +1 -1
  144. package/dist/src/profile-registry.d.ts +18 -0
  145. package/dist/src/profile-registry.d.ts.map +1 -0
  146. package/dist/src/profile-registry.js +26 -0
  147. package/dist/src/profile-registry.js.map +1 -0
  148. package/dist/src/profile-resolver.d.ts +19 -0
  149. package/dist/src/profile-resolver.d.ts.map +1 -0
  150. package/dist/src/profile-resolver.js +167 -0
  151. package/dist/src/profile-resolver.js.map +1 -0
  152. package/dist/src/proxy-executor.d.ts.map +1 -1
  153. package/dist/src/proxy-executor.js +7 -0
  154. package/dist/src/proxy-executor.js.map +1 -1
  155. package/dist/src/startup-profile.d.ts +17 -0
  156. package/dist/src/startup-profile.d.ts.map +1 -0
  157. package/dist/src/startup-profile.js +30 -0
  158. package/dist/src/startup-profile.js.map +1 -0
  159. package/dist/src/startup-validation.d.ts +11 -0
  160. package/dist/src/startup-validation.d.ts.map +1 -0
  161. package/dist/src/startup-validation.js +21 -0
  162. package/dist/src/startup-validation.js.map +1 -0
  163. package/dist/src/testing/dynamic-mock-server.d.ts +24 -0
  164. package/dist/src/testing/dynamic-mock-server.d.ts.map +1 -0
  165. package/dist/src/testing/dynamic-mock-server.js +138 -0
  166. package/dist/src/testing/dynamic-mock-server.js.map +1 -0
  167. package/dist/src/testing/request-assertions.d.ts +5 -0
  168. package/dist/src/testing/request-assertions.d.ts.map +1 -0
  169. package/dist/src/testing/request-assertions.js +165 -0
  170. package/dist/src/testing/request-assertions.js.map +1 -0
  171. package/dist/src/testing/template-utils.d.ts +10 -0
  172. package/dist/src/testing/template-utils.d.ts.map +1 -0
  173. package/dist/src/testing/template-utils.js +72 -0
  174. package/dist/src/testing/template-utils.js.map +1 -0
  175. package/dist/src/testing/test-http-utils.d.ts +1 -1
  176. package/dist/src/testing/test-http-utils.d.ts.map +1 -1
  177. package/dist/src/testing/test-http-utils.js +1 -1
  178. package/dist/src/testing/test-http-utils.js.map +1 -1
  179. package/dist/src/testing/test-loader.d.ts +6 -0
  180. package/dist/src/testing/test-loader.d.ts.map +1 -0
  181. package/dist/src/testing/test-loader.js +212 -0
  182. package/dist/src/testing/test-loader.js.map +1 -0
  183. package/dist/src/testing/test-schema.d.ts +1270 -0
  184. package/dist/src/testing/test-schema.d.ts.map +1 -0
  185. package/dist/src/testing/test-schema.js +76 -0
  186. package/dist/src/testing/test-schema.js.map +1 -0
  187. package/dist/src/tool-filter/compat.d.ts +49 -0
  188. package/dist/src/tool-filter/compat.d.ts.map +1 -0
  189. package/dist/src/tool-filter/compat.js +72 -0
  190. package/dist/src/tool-filter/compat.js.map +1 -0
  191. package/dist/src/tool-filter/config/env-config-parser.d.ts +38 -0
  192. package/dist/src/tool-filter/config/env-config-parser.d.ts.map +1 -0
  193. package/dist/src/tool-filter/config/env-config-parser.js +103 -0
  194. package/dist/src/tool-filter/config/env-config-parser.js.map +1 -0
  195. package/dist/src/tool-filter/config/header-config-parser.d.ts +37 -0
  196. package/dist/src/tool-filter/config/header-config-parser.d.ts.map +1 -0
  197. package/dist/src/tool-filter/config/header-config-parser.js +118 -0
  198. package/dist/src/tool-filter/config/header-config-parser.js.map +1 -0
  199. package/dist/src/tool-filter/errors.d.ts +18 -0
  200. package/dist/src/tool-filter/errors.d.ts.map +1 -0
  201. package/dist/src/tool-filter/errors.js +21 -0
  202. package/dist/src/tool-filter/errors.js.map +1 -0
  203. package/dist/src/tool-filter/filter/filter-engine.d.ts +45 -0
  204. package/dist/src/tool-filter/filter/filter-engine.d.ts.map +1 -0
  205. package/dist/src/tool-filter/filter/filter-engine.js +94 -0
  206. package/dist/src/tool-filter/filter/filter-engine.js.map +1 -0
  207. package/dist/src/tool-filter/filter/filter-rules.d.ts +44 -0
  208. package/dist/src/tool-filter/filter/filter-rules.d.ts.map +1 -0
  209. package/dist/src/tool-filter/filter/filter-rules.js +72 -0
  210. package/dist/src/tool-filter/filter/filter-rules.js.map +1 -0
  211. package/dist/src/tool-filter/filter/global-tool-filter.d.ts +40 -0
  212. package/dist/src/tool-filter/filter/global-tool-filter.d.ts.map +1 -0
  213. package/dist/src/tool-filter/filter/global-tool-filter.js +92 -0
  214. package/dist/src/tool-filter/filter/global-tool-filter.js.map +1 -0
  215. package/dist/src/tool-filter/filter/session-tool-filter.d.ts +29 -0
  216. package/dist/src/tool-filter/filter/session-tool-filter.d.ts.map +1 -0
  217. package/dist/src/tool-filter/filter/session-tool-filter.js +69 -0
  218. package/dist/src/tool-filter/filter/session-tool-filter.js.map +1 -0
  219. package/dist/src/tool-filter/index.d.ts +25 -0
  220. package/dist/src/tool-filter/index.d.ts.map +1 -0
  221. package/dist/src/tool-filter/index.js +30 -0
  222. package/dist/src/tool-filter/index.js.map +1 -0
  223. package/dist/src/tool-filter/integration/tool-filter-service.d.ts +44 -0
  224. package/dist/src/tool-filter/integration/tool-filter-service.d.ts.map +1 -0
  225. package/dist/src/tool-filter/integration/tool-filter-service.js +68 -0
  226. package/dist/src/tool-filter/integration/tool-filter-service.js.map +1 -0
  227. package/dist/src/tool-filter/operation/operation-classifier.d.ts +20 -0
  228. package/dist/src/tool-filter/operation/operation-classifier.d.ts.map +1 -0
  229. package/dist/src/tool-filter/operation/operation-classifier.js +26 -0
  230. package/dist/src/tool-filter/operation/operation-classifier.js.map +1 -0
  231. package/dist/src/tool-filter/operation/operation-detector.d.ts +30 -0
  232. package/dist/src/tool-filter/operation/operation-detector.d.ts.map +1 -0
  233. package/dist/src/tool-filter/operation/operation-detector.js +96 -0
  234. package/dist/src/tool-filter/operation/operation-detector.js.map +1 -0
  235. package/dist/src/tool-filter/operation/operation-resolver.d.ts +22 -0
  236. package/dist/src/tool-filter/operation/operation-resolver.d.ts.map +1 -0
  237. package/dist/src/tool-filter/operation/operation-resolver.js +32 -0
  238. package/dist/src/tool-filter/operation/operation-resolver.js.map +1 -0
  239. package/dist/src/tool-filter/regex/regex-compiler.d.ts +22 -0
  240. package/dist/src/tool-filter/regex/regex-compiler.d.ts.map +1 -0
  241. package/dist/src/tool-filter/regex/regex-compiler.js +56 -0
  242. package/dist/src/tool-filter/regex/regex-compiler.js.map +1 -0
  243. package/dist/src/tool-filter/regex/regex-validator.d.ts +24 -0
  244. package/dist/src/tool-filter/regex/regex-validator.d.ts.map +1 -0
  245. package/dist/src/tool-filter/regex/regex-validator.js +58 -0
  246. package/dist/src/tool-filter/regex/regex-validator.js.map +1 -0
  247. package/dist/src/tool-filter/types.d.ts +92 -0
  248. package/dist/src/tool-filter/types.d.ts.map +1 -0
  249. package/dist/src/tool-filter/types.js +5 -0
  250. package/dist/src/tool-filter/types.js.map +1 -0
  251. package/dist/src/tool-filter/utils.d.ts +11 -0
  252. package/dist/src/tool-filter/utils.d.ts.map +1 -0
  253. package/dist/src/tool-filter/utils.js +13 -0
  254. package/dist/src/tool-filter/utils.js.map +1 -0
  255. package/dist/src/tool-filter.d.ts +65 -0
  256. package/dist/src/tool-filter.d.ts.map +1 -0
  257. package/dist/src/tool-filter.js +471 -0
  258. package/dist/src/tool-filter.js.map +1 -0
  259. package/dist/src/tool-generator.d.ts +1 -0
  260. package/dist/src/tool-generator.d.ts.map +1 -1
  261. package/dist/src/tool-generator.js +15 -6
  262. package/dist/src/tool-generator.js.map +1 -1
  263. package/dist/src/tooling/composite-executor.d.ts +77 -0
  264. package/dist/src/tooling/composite-executor.d.ts.map +1 -0
  265. package/dist/src/tooling/composite-executor.js +198 -0
  266. package/dist/src/tooling/composite-executor.js.map +1 -0
  267. package/dist/src/tooling/dag-executor.d.ts +49 -0
  268. package/dist/src/tooling/dag-executor.d.ts.map +1 -0
  269. package/dist/src/tooling/dag-executor.js +138 -0
  270. package/dist/src/tooling/dag-executor.js.map +1 -0
  271. package/dist/src/tooling/proxy-executor.d.ts +86 -0
  272. package/dist/src/tooling/proxy-executor.d.ts.map +1 -0
  273. package/dist/src/tooling/proxy-executor.js +501 -0
  274. package/dist/src/tooling/proxy-executor.js.map +1 -0
  275. package/dist/src/tooling/tool-generator.d.ts +67 -0
  276. package/dist/src/tooling/tool-generator.d.ts.map +1 -0
  277. package/dist/src/tooling/tool-generator.js +222 -0
  278. package/dist/src/tooling/tool-generator.js.map +1 -0
  279. package/dist/src/transport/http-client-factory.d.ts +65 -0
  280. package/dist/src/transport/http-client-factory.d.ts.map +1 -0
  281. package/dist/src/transport/http-client-factory.js +143 -0
  282. package/dist/src/transport/http-client-factory.js.map +1 -0
  283. package/dist/src/transport/http-transport-config.d.ts +6 -0
  284. package/dist/src/transport/http-transport-config.d.ts.map +1 -0
  285. package/dist/src/transport/http-transport-config.js +63 -0
  286. package/dist/src/transport/http-transport-config.js.map +1 -0
  287. package/dist/src/transport/http-transport.d.ts +329 -0
  288. package/dist/src/transport/http-transport.d.ts.map +1 -0
  289. package/dist/src/transport/http-transport.js +2584 -0
  290. package/dist/src/transport/http-transport.js.map +1 -0
  291. package/dist/src/transport/interceptors.d.ts +119 -0
  292. package/dist/src/transport/interceptors.d.ts.map +1 -0
  293. package/dist/src/transport/interceptors.js +413 -0
  294. package/dist/src/transport/interceptors.js.map +1 -0
  295. package/dist/src/transport/profile-index.d.ts +84 -0
  296. package/dist/src/transport/profile-index.d.ts.map +1 -0
  297. package/dist/src/transport/profile-index.js +405 -0
  298. package/dist/src/transport/profile-index.js.map +1 -0
  299. package/dist/src/types/http-transport.d.ts +26 -0
  300. package/dist/src/types/http-transport.d.ts.map +1 -1
  301. package/dist/src/types/openapi.d.ts +3 -0
  302. package/dist/src/types/openapi.d.ts.map +1 -1
  303. package/dist/src/types/profile.d.ts +16 -1
  304. package/dist/src/types/profile.d.ts.map +1 -1
  305. package/dist/src/validation/argument-normalizer.d.ts +6 -0
  306. package/dist/src/validation/argument-normalizer.d.ts.map +1 -0
  307. package/dist/src/validation/argument-normalizer.js +70 -0
  308. package/dist/src/validation/argument-normalizer.js.map +1 -0
  309. package/dist/src/validation/jsonrpc-validator.d.ts +27 -0
  310. package/dist/src/validation/jsonrpc-validator.d.ts.map +1 -0
  311. package/dist/src/validation/jsonrpc-validator.js +58 -0
  312. package/dist/src/validation/jsonrpc-validator.js.map +1 -0
  313. package/dist/src/validation/schema-validator.d.ts +30 -0
  314. package/dist/src/validation/schema-validator.d.ts.map +1 -0
  315. package/dist/src/validation/schema-validator.js +128 -0
  316. package/dist/src/validation/schema-validator.js.map +1 -0
  317. package/dist/src/validation/validation-utils.d.ts +49 -0
  318. package/dist/src/validation/validation-utils.d.ts.map +1 -0
  319. package/dist/src/validation/validation-utils.js +139 -0
  320. package/dist/src/validation/validation-utils.js.map +1 -0
  321. package/html/profile-index.html +386 -0
  322. package/package.json +10 -3
  323. package/profile-schema.json +77 -3
  324. package/profiles/gitlab/developer-profile-oauth.json +1520 -0
  325. package/profiles/gitlab/developer-profile-oauth.test.json +3432 -0
  326. package/profiles/gitlab/developer-profile.json +1508 -0
  327. package/profiles/gitlab/developer-profile.test.json +3432 -0
  328. package/profiles/gitlab/openapi.yaml +6891 -0
  329. package/profiles/n8n/openapi.yaml +2441 -0
  330. package/profiles/n8n/profile-optimized.json +965 -0
  331. package/profiles/n8n/profile-optimized.test.json +1078 -0
  332. package/profiles/n8n/profile.json +1033 -0
  333. package/profiles/n8n/profile.test.json +983 -0
  334. package/profiles/n8n-nodes/openapi.yaml +24 -0
  335. package/profiles/n8n-nodes/profile-nodes.json +44 -0
  336. package/profiles/n8n-nodes/profile-nodes.test.json +91 -0
  337. package/profiles/semgrep/openapi.yaml +4706 -0
  338. package/profiles/semgrep/profile.json +692 -0
  339. package/profiles/semgrep/profile.test.json +471 -0
  340. package/profiles/youtrack/openapi.json +16976 -0
  341. package/profiles/youtrack/profile.json +608 -0
  342. package/profiles/youtrack/profile.test.json +1926 -0
  343. package/dist/src/testing/fixtures.d.ts +0 -684
  344. package/dist/src/testing/fixtures.d.ts.map +0 -1
  345. package/dist/src/testing/fixtures.js +0 -528
  346. package/dist/src/testing/fixtures.js.map +0 -1
  347. package/dist/src/testing/mock-gitlab-server.d.ts +0 -43
  348. package/dist/src/testing/mock-gitlab-server.d.ts.map +0 -1
  349. package/dist/src/testing/mock-gitlab-server.js +0 -1026
  350. package/dist/src/testing/mock-gitlab-server.js.map +0 -1
  351. package/dist/src/testing/mock-semgrep-server.d.ts +0 -32
  352. package/dist/src/testing/mock-semgrep-server.d.ts.map +0 -1
  353. package/dist/src/testing/mock-semgrep-server.js +0 -213
  354. package/dist/src/testing/mock-semgrep-server.js.map +0 -1
  355. package/dist/src/testing/mock-youtrack-server.d.ts +0 -11
  356. package/dist/src/testing/mock-youtrack-server.d.ts.map +0 -1
  357. package/dist/src/testing/mock-youtrack-server.js +0 -152
  358. package/dist/src/testing/mock-youtrack-server.js.map +0 -1
@@ -0,0 +1,386 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{lang}}">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>{{title}}</title>
7
+ <style nonce="{{nonce}}">
8
+ :root {
9
+ color-scheme: light;
10
+ --bg: #f6f2ea;
11
+ --bg-accent: #efe7da;
12
+ --ink: #1f1f1f;
13
+ --muted: #615d56;
14
+ --card: #ffffff;
15
+ --accent: #b15a2b;
16
+ --accent-2: #2b5aa3;
17
+ --border: #e1d8cc;
18
+ --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
19
+ }
20
+ * { box-sizing: border-box; }
21
+ body {
22
+ margin: 0;
23
+ font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
24
+ color: var(--ink);
25
+ background: radial-gradient(1200px 600px at 10% -20%, #fbe5d6 0%, transparent 60%),
26
+ radial-gradient(800px 600px at 90% 0%, #dbe9ff 0%, transparent 55%),
27
+ var(--bg);
28
+ }
29
+ header {
30
+ padding: 48px 40px 32px;
31
+ }
32
+ h1 {
33
+ font-size: 36px;
34
+ margin: 0 0 8px;
35
+ letter-spacing: -0.02em;
36
+ }
37
+ p {
38
+ margin: 0;
39
+ color: var(--muted);
40
+ line-height: 1.6;
41
+ }
42
+ main {
43
+ display: grid;
44
+ grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
45
+ gap: 24px;
46
+ padding: 0 40px 48px;
47
+ }
48
+ .panel {
49
+ background: var(--card);
50
+ border-radius: 16px;
51
+ border: 1px solid var(--border);
52
+ box-shadow: var(--shadow);
53
+ padding: 24px;
54
+ }
55
+ .profiles {
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: 12px;
59
+ }
60
+ .profile-item {
61
+ padding: 12px 14px;
62
+ border-radius: 12px;
63
+ border: 1px solid transparent;
64
+ background: var(--bg-accent);
65
+ cursor: pointer;
66
+ transition: border-color 0.2s ease, transform 0.2s ease;
67
+ }
68
+ .profile-item:hover {
69
+ border-color: var(--accent);
70
+ transform: translateY(-1px);
71
+ }
72
+ .profile-item.active {
73
+ border-color: var(--accent);
74
+ background: #fff5ec;
75
+ }
76
+ .profile-title {
77
+ font-weight: 600;
78
+ margin-bottom: 4px;
79
+ }
80
+ .profile-subtitle {
81
+ font-size: 13px;
82
+ color: var(--muted);
83
+ overflow: hidden;
84
+ text-overflow: ellipsis;
85
+ display: -webkit-box;
86
+ -webkit-line-clamp: 2;
87
+ -webkit-box-orient: vertical;
88
+ }
89
+ .detail-grid {
90
+ display: grid;
91
+ gap: 18px;
92
+ }
93
+ .tab-row {
94
+ display: flex;
95
+ flex-wrap: wrap;
96
+ gap: 8px;
97
+ margin-bottom: 8px;
98
+ }
99
+ .tab {
100
+ border: 1px solid var(--border);
101
+ background: #fff;
102
+ padding: 6px 12px;
103
+ border-radius: 999px;
104
+ cursor: pointer;
105
+ font-size: 13px;
106
+ color: var(--muted);
107
+ }
108
+ .tab.active {
109
+ color: var(--accent);
110
+ border-color: var(--accent);
111
+ background: #fff5ec;
112
+ font-weight: 600;
113
+ }
114
+ .detail-card {
115
+ border: 1px solid var(--border);
116
+ border-radius: 12px;
117
+ padding: 16px;
118
+ background: #fff;
119
+ }
120
+ .detail-card h3 {
121
+ margin: 0 0 8px;
122
+ font-size: 16px;
123
+ }
124
+ .tag-list {
125
+ display: flex;
126
+ flex-wrap: wrap;
127
+ gap: 8px;
128
+ margin-top: 8px;
129
+ }
130
+ .tag {
131
+ background: #f1efe9;
132
+ color: #2d2b28;
133
+ border-radius: 999px;
134
+ padding: 4px 10px;
135
+ font-size: 12px;
136
+ border: 1px solid var(--border);
137
+ }
138
+ code, pre {
139
+ font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
140
+ }
141
+ pre {
142
+ background: #0f172a;
143
+ color: #e2e8f0;
144
+ padding: 14px;
145
+ border-radius: 12px;
146
+ overflow-x: auto;
147
+ line-height: 1.6;
148
+ }
149
+ .snippets {
150
+ display: grid;
151
+ gap: 16px;
152
+ }
153
+ .snippet-header {
154
+ display: flex;
155
+ align-items: center;
156
+ justify-content: space-between;
157
+ gap: 12px;
158
+ }
159
+ .snippet-meta {
160
+ display: flex;
161
+ align-items: center;
162
+ gap: 8px;
163
+ }
164
+ .format-pill {
165
+ border: 1px solid var(--border);
166
+ border-radius: 999px;
167
+ padding: 2px 8px;
168
+ font-size: 11px;
169
+ color: var(--muted);
170
+ background: #f7f4ef;
171
+ text-transform: uppercase;
172
+ letter-spacing: 0.05em;
173
+ }
174
+ .copy-btn {
175
+ border: 1px solid var(--border);
176
+ background: #fff;
177
+ color: var(--accent-2);
178
+ border-radius: 999px;
179
+ padding: 6px 12px;
180
+ cursor: pointer;
181
+ font-size: 12px;
182
+ }
183
+ .notice {
184
+ background: #fff8f1;
185
+ border: 1px solid #f6d5bd;
186
+ padding: 12px;
187
+ border-radius: 12px;
188
+ color: #7a3f1e;
189
+ }
190
+ @media (max-width: 960px) {
191
+ main {
192
+ grid-template-columns: 1fr;
193
+ padding: 0 20px 40px;
194
+ }
195
+ header {
196
+ padding: 36px 20px 24px;
197
+ }
198
+ }
199
+ </style>
200
+ </head>
201
+ <body>
202
+ <header>
203
+ <h1>{{title}}</h1>
204
+ <p>{{subtitle}}</p>
205
+ </header>
206
+ <main>
207
+ <section class="panel">
208
+ <div class="profiles" id="profile-list"></div>
209
+ </section>
210
+ <section class="panel">
211
+ <div class="detail-grid" id="profile-detail">
212
+ <noscript>
213
+ <div class="notice">{{noscript}}</div>
214
+ </noscript>
215
+ </div>
216
+ </section>
217
+ </main>
218
+
219
+ <script type="application/json" id="profile-data" nonce="{{nonce}}">{{profile_data}}</script>
220
+ <script type="application/json" id="i18n-data" nonce="{{nonce}}">{{i18n_data}}</script>
221
+
222
+ <script nonce="{{nonce}}">
223
+ const profileData = JSON.parse(document.getElementById('profile-data').textContent || '[]');
224
+ const i18n = JSON.parse(document.getElementById('i18n-data').textContent || '{}');
225
+
226
+ const listEl = document.getElementById('profile-list');
227
+ const detailEl = document.getElementById('profile-detail');
228
+
229
+ function escapeHtml(value) {
230
+ return String(value)
231
+ .replace(/&/g, '&amp;')
232
+ .replace(/</g, '&lt;')
233
+ .replace(/>/g, '&gt;')
234
+ .replace(/"/g, '&quot;')
235
+ .replace(/'/g, '&#039;');
236
+ }
237
+
238
+ function renderTags(items) {
239
+ if (!items || items.length === 0) {
240
+ return `<div class="profile-subtitle">${escapeHtml(i18n.noEnvVars || '')}</div>`;
241
+ }
242
+ const tags = items.map(item => `<span class="tag">${escapeHtml(item)}</span>`).join('');
243
+ return `<div class="tag-list">${tags}</div>`;
244
+ }
245
+
246
+ function buildSnippet(template, profile) {
247
+ return template
248
+ .replace(/__PROFILE_ID__/g, profile.profileId)
249
+ .replace(/__PROFILE_NAME__/g, profile.profileName)
250
+ .replace(/__PROFILE_URL__/g, profile.mcpUrl)
251
+ .replace(/__PROFILE_SSE_URL__/g, profile.sseUrl);
252
+ }
253
+
254
+ function renderSnippets(profile, activeAuth) {
255
+ const blocks = [];
256
+ const order = ['vscode', 'cursor', 'jetbrains', 'claude'];
257
+ const snippets = profile.snippets || {};
258
+ for (const entry of snippets) {
259
+ if (!entry || !entry.key) continue;
260
+ if (activeAuth && entry.authKey && entry.authKey !== activeAuth) continue;
261
+ if (!order.some(prefix => entry.key.startsWith(prefix))) continue;
262
+ const title = entry.label || entry.key;
263
+ const format = entry.format || '';
264
+ const snippet = buildSnippet(entry.content, profile);
265
+ const encodedSnippet = encodeURIComponent(snippet);
266
+ blocks.push(`
267
+ <div class="detail-card">
268
+ <div class="snippet-header">
269
+ <h3>${escapeHtml(title)}</h3>
270
+ <div class="snippet-meta">
271
+ ${format ? `<span class="format-pill">${escapeHtml(format)}</span>` : ''}
272
+ <button class="copy-btn" data-copy="${encodedSnippet}">${escapeHtml(i18n.copy || '')}</button>
273
+ </div>
274
+ </div>
275
+ <pre><code>${escapeHtml(snippet)}</code></pre>
276
+ </div>
277
+ `);
278
+ }
279
+ return blocks.join('');
280
+ }
281
+
282
+ function buildProfileTitle(profile) {
283
+ const parts = [profile.profileId, profile.profileName, ...(profile.profileAliases || [])];
284
+ const seen = new Set();
285
+ const unique = [];
286
+ for (const part of parts) {
287
+ if (!part) continue;
288
+ const key = String(part);
289
+ if (seen.has(key)) continue;
290
+ seen.add(key);
291
+ unique.push(key);
292
+ }
293
+ if (unique.length === 0) return '';
294
+ if (unique.length === 1) return unique[0];
295
+ return `${unique[0]} (${unique.slice(1).join(', ')})`;
296
+ }
297
+
298
+ function renderDetail(profile) {
299
+ const title = buildProfileTitle(profile);
300
+ const description = profile.description || i18n.noDescription || '';
301
+ const authTabs = profile.authTabs || [];
302
+ const activeAuth = authTabs.length > 0 ? authTabs[0].key : null;
303
+ detailEl.innerHTML = `
304
+ <div class="detail-card">
305
+ <h3>${escapeHtml(i18n.profileLabel || '')}</h3>
306
+ <div class="profile-title">${escapeHtml(title)}</div>
307
+ <div class="profile-subtitle">${escapeHtml(description)}</div>
308
+ </div>
309
+ <div class="detail-card">
310
+ <h3>${escapeHtml(i18n.endpointLabel || '')}</h3>
311
+ <p><strong>MCP</strong>: ${escapeHtml(profile.mcpUrl)}</p>
312
+ <p><strong>SSE</strong>: ${escapeHtml(profile.sseUrl)}</p>
313
+ </div>
314
+ <div class="detail-card">
315
+ <div class="tab-row" id="auth-tabs">
316
+ ${authTabs.map(tab => `
317
+ <button class="tab${tab.key === activeAuth ? ' active' : ''}" data-auth="${escapeHtml(tab.key)}">
318
+ ${escapeHtml(tab.label)}
319
+ </button>
320
+ `).join('')}
321
+ </div>
322
+ <div class="snippets" id="snippet-list">
323
+ ${renderSnippets(profile, activeAuth)}
324
+ </div>
325
+ </div>
326
+ `;
327
+
328
+ const tabRow = detailEl.querySelector('#auth-tabs');
329
+ const snippetList = detailEl.querySelector('#snippet-list');
330
+ if (tabRow && snippetList) {
331
+ tabRow.addEventListener('click', event => {
332
+ const target = event.target;
333
+ if (!(target instanceof HTMLElement)) return;
334
+ const authKey = target.getAttribute('data-auth');
335
+ if (!authKey) return;
336
+ tabRow.querySelectorAll('.tab').forEach(tab => {
337
+ tab.classList.toggle('active', tab.getAttribute('data-auth') === authKey);
338
+ });
339
+ snippetList.innerHTML = renderSnippets(profile, authKey);
340
+ });
341
+ }
342
+ }
343
+
344
+ function renderList(activeId) {
345
+ listEl.innerHTML = '';
346
+ profileData.forEach(profile => {
347
+ const title = buildProfileTitle(profile);
348
+ const item = document.createElement('div');
349
+ item.className = 'profile-item' + (profile.profileId === activeId ? ' active' : '');
350
+ item.innerHTML = `
351
+ <div class="profile-title">${escapeHtml(title)}</div>
352
+ <div class="profile-subtitle">${escapeHtml(profile.description || i18n.noDescription || '')}</div>
353
+ `;
354
+ item.addEventListener('click', () => {
355
+ renderList(profile.profileId);
356
+ renderDetail(profile);
357
+ });
358
+ listEl.appendChild(item);
359
+ });
360
+ }
361
+
362
+ if (profileData.length > 0) {
363
+ renderList(profileData[0].profileId);
364
+ renderDetail(profileData[0]);
365
+ } else {
366
+ detailEl.innerHTML = `<div class="notice">${escapeHtml(i18n.noProfiles || '')}</div>`;
367
+ }
368
+
369
+ document.addEventListener('click', event => {
370
+ const target = event.target;
371
+ if (!(target instanceof HTMLElement)) return;
372
+ if (!target.matches('[data-copy]')) return;
373
+ const text = target.getAttribute('data-copy');
374
+ if (!text) return;
375
+ const decoded = decodeURIComponent(text);
376
+ navigator.clipboard?.writeText(decoded).then(() => {
377
+ target.textContent = i18n.copied || '';
378
+ setTimeout(() => { target.textContent = i18n.copy || ''; }, 1200);
379
+ }).catch(() => {
380
+ target.textContent = i18n.copyFailed || '';
381
+ setTimeout(() => { target.textContent = i18n.copy || ''; }, 1200);
382
+ });
383
+ });
384
+ </script>
385
+ </body>
386
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp4openapi",
3
- "version": "0.2.8",
3
+ "version": "0.3.1",
4
4
  "description": "Universal MCP server that generates tools from any OpenAPI specification",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -13,6 +13,8 @@
13
13
  },
14
14
  "files": [
15
15
  "dist",
16
+ "html",
17
+ "profiles",
16
18
  "profile-schema.json",
17
19
  "README.md",
18
20
  "LICENSE.md"
@@ -28,7 +30,7 @@
28
30
  "test:ui": "vitest --ui",
29
31
  "coverage": "vitest run --coverage",
30
32
  "typecheck": "tsc --noEmit",
31
- "lint": "eslint src --ext .ts",
33
+ "lint": "eslint . --ext .ts,.js,.mjs,.cjs",
32
34
  "generate-schemas": "node scripts/generate-schemas.js",
33
35
  "validate": "npm run build && node dist/scripts/validate-profile.js",
34
36
  "validate:schema": "npm run build && node dist/scripts/validate-schema.js",
@@ -56,17 +58,19 @@
56
58
  "url": "https://github.com/davidruzicka/mcp4openapi/issues"
57
59
  },
58
60
  "dependencies": {
59
- "@modelcontextprotocol/sdk": "^1.24.0",
61
+ "@modelcontextprotocol/sdk": "1.25.2",
60
62
  "dotenv": "^17.2.3",
61
63
  "escape-html": "^1.0.3",
62
64
  "express": "^5.2.1",
63
65
  "express-rate-limit": "^8.2.1",
64
66
  "openapi-types": "^12.1.3",
65
67
  "prom-client": "^15.1.3",
68
+ "qs": "^6.14.1",
66
69
  "yaml": "^2.6.1",
67
70
  "zod": "^3.24.1"
68
71
  },
69
72
  "devDependencies": {
73
+ "@eslint/js": "^9.39.2",
70
74
  "@mswjs/http-middleware": "^0.10.3",
71
75
  "@types/escape-html": "^1.0.4",
72
76
  "@types/express": "^5.0.3",
@@ -87,6 +91,9 @@
87
91
  "vite": "^6.0.5",
88
92
  "vitest": "^3.2.4"
89
93
  },
94
+ "overrides": {
95
+ "hono": "4.11.7"
96
+ },
90
97
  "engines": {
91
98
  "node": ">=18"
92
99
  }
@@ -11,6 +11,24 @@
11
11
  "description": "Unique identifier for this profile",
12
12
  "examples": ["gitlab-developer", "github-readonly", "custom-api"]
13
13
  },
14
+ "profile_id": {
15
+ "type": "string",
16
+ "description": "Short ID used for selecting a profile via MCP4_PROFILE or --profile",
17
+ "examples": ["gitlab", "semgrep", "youtrack"]
18
+ },
19
+ "profile_aliases": {
20
+ "type": "array",
21
+ "description": "Alternate IDs that can be used to select this profile via MCP4_PROFILE or --profile",
22
+ "items": {
23
+ "type": "string"
24
+ },
25
+ "examples": [["gitlab-developer", "gitlab-default"]]
26
+ },
27
+ "openapi_spec_path": {
28
+ "type": "string",
29
+ "description": "OpenAPI spec path used when launching by profile without MCP4_OPENAPI_SPEC_PATH",
30
+ "examples": ["./openapi.yaml", "../specs/openapi.json"]
31
+ },
14
32
  "description": {
15
33
  "type": "string",
16
34
  "description": "Human-readable description of what this profile provides"
@@ -188,9 +206,21 @@
188
206
  "required": ["type", "description"],
189
207
  "properties": {
190
208
  "type": {
191
- "type": "string",
192
- "enum": ["string", "integer", "number", "boolean", "array", "object"],
193
- "description": "Parameter data type"
209
+ "description": "Parameter data type",
210
+ "oneOf": [
211
+ {
212
+ "type": "string",
213
+ "enum": ["string", "integer", "number", "boolean", "array", "object"]
214
+ },
215
+ {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "string",
219
+ "enum": ["string", "integer", "number", "boolean", "array", "object"]
220
+ },
221
+ "minItems": 1
222
+ }
223
+ ]
194
224
  },
195
225
  "description": {
196
226
  "type": "string",
@@ -218,6 +248,20 @@
218
248
  },
219
249
  "minItems": 1
220
250
  },
251
+ "minLength": {
252
+ "type": "integer",
253
+ "description": "Minimum length for string parameters",
254
+ "minimum": 0
255
+ },
256
+ "maxLength": {
257
+ "type": "integer",
258
+ "description": "Maximum length for string parameters",
259
+ "minimum": 0
260
+ },
261
+ "pattern": {
262
+ "type": "string",
263
+ "description": "Regex pattern for string parameters"
264
+ },
221
265
  "items": {
222
266
  "type": "object",
223
267
  "description": "Item type for array parameters",
@@ -237,6 +281,36 @@
237
281
  },
238
282
  "example": {
239
283
  "description": "Example value for documentation"
284
+ },
285
+ "object_entries_to_array": {
286
+ "type": "object",
287
+ "description": "Convert an object map into an array of objects using key/value fields",
288
+ "required": ["key_field", "value_field"],
289
+ "properties": {
290
+ "key_field": {
291
+ "type": "string",
292
+ "description": "Field name to store the object key"
293
+ },
294
+ "value_field": {
295
+ "type": "string",
296
+ "description": "Field name to store the object value"
297
+ },
298
+ "wrap_value_field": {
299
+ "type": "string",
300
+ "description": "Optional wrapper field name for non-object values"
301
+ }
302
+ }
303
+ },
304
+ "array_item_to_object": {
305
+ "type": "object",
306
+ "description": "Convert primitive array items into objects using the provided field",
307
+ "required": ["key_field"],
308
+ "properties": {
309
+ "key_field": {
310
+ "type": "string",
311
+ "description": "Field name to store the array item value"
312
+ }
313
+ }
240
314
  }
241
315
  }
242
316
  },