imcp 0.1.7 → 0.1.8-dev

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 (314) hide show
  1. package/dist/cli/commands/install.js +1 -106
  2. package/dist/cli/commands/install.js.map +1 -0
  3. package/dist/cli/commands/list.js +1 -90
  4. package/dist/cli/commands/list.js.map +1 -0
  5. package/dist/cli/commands/pull.js +1 -16
  6. package/dist/cli/commands/pull.js.map +1 -0
  7. package/dist/cli/commands/serve.js +1 -33
  8. package/dist/cli/commands/serve.js.map +1 -0
  9. package/dist/cli/commands/uninstall.js +1 -46
  10. package/dist/cli/commands/uninstall.js.map +1 -0
  11. package/dist/cli/index.js +1 -65
  12. package/dist/cli/index.js.map +1 -0
  13. package/dist/core/installers/clients/BaseClientInstaller.js +1 -282
  14. package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -0
  15. package/dist/core/installers/clients/ClientInstaller.js +1 -163
  16. package/dist/core/installers/clients/ClientInstaller.js.map +1 -0
  17. package/dist/core/installers/clients/ClientInstallerFactory.js +1 -36
  18. package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -0
  19. package/dist/core/installers/clients/ClineInstaller.js +1 -30
  20. package/dist/core/installers/clients/ClineInstaller.js.map +1 -0
  21. package/dist/core/installers/clients/ExtensionInstaller.js +1 -151
  22. package/dist/core/installers/clients/ExtensionInstaller.js.map +1 -0
  23. package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -68
  24. package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -0
  25. package/dist/core/installers/clients/MSRooCodeInstaller.js +1 -28
  26. package/dist/core/installers/clients/MSRooCodeInstaller.js.map +1 -0
  27. package/dist/core/installers/index.js +1 -8
  28. package/dist/core/installers/index.js.map +1 -0
  29. package/dist/core/installers/requirements/BaseInstaller.js +1 -56
  30. package/dist/core/installers/requirements/BaseInstaller.js.map +1 -0
  31. package/dist/core/installers/requirements/CommandInstaller.js +1 -213
  32. package/dist/core/installers/requirements/CommandInstaller.js.map +1 -0
  33. package/dist/core/installers/requirements/GeneralInstaller.js +1 -126
  34. package/dist/core/installers/requirements/GeneralInstaller.js.map +1 -0
  35. package/dist/core/installers/requirements/InstallerFactory.js +1 -99
  36. package/dist/core/installers/requirements/InstallerFactory.js.map +1 -0
  37. package/dist/core/installers/requirements/NpmInstaller.js +1 -235
  38. package/dist/core/installers/requirements/NpmInstaller.js.map +1 -0
  39. package/dist/core/installers/requirements/NugetInstaller.js +1 -188
  40. package/dist/core/installers/requirements/NugetInstaller.js.map +1 -0
  41. package/dist/core/installers/requirements/PipInstaller.js +1 -192
  42. package/dist/core/installers/requirements/PipInstaller.js.map +1 -0
  43. package/dist/core/installers/requirements/RequirementInstaller.js +1 -2
  44. package/dist/core/installers/requirements/RequirementInstaller.js.map +1 -0
  45. package/dist/core/loaders/ConfigurationLoader.js +1 -256
  46. package/dist/core/loaders/ConfigurationLoader.js.map +1 -0
  47. package/dist/core/loaders/ConfigurationProvider.js +1 -383
  48. package/dist/core/loaders/ConfigurationProvider.js.map +1 -0
  49. package/dist/core/loaders/InstallOperationManager.js +1 -310
  50. package/dist/core/loaders/InstallOperationManager.js.map +1 -0
  51. package/dist/core/loaders/ServerSchemaLoader.js +1 -108
  52. package/dist/core/loaders/ServerSchemaLoader.js.map +1 -0
  53. package/dist/core/loaders/ServerSchemaProvider.js +1 -89
  54. package/dist/core/loaders/ServerSchemaProvider.js.map +1 -0
  55. package/dist/core/loaders/SystemSettingsManager.js +1 -256
  56. package/dist/core/loaders/SystemSettingsManager.js.map +1 -0
  57. package/dist/core/metadatas/constants.js +1 -100
  58. package/dist/core/metadatas/constants.js.map +1 -0
  59. package/dist/core/metadatas/recordingConstants.js +1 -46
  60. package/dist/core/metadatas/recordingConstants.js.map +1 -0
  61. package/dist/core/metadatas/types.js +1 -15
  62. package/dist/core/metadatas/types.js.map +1 -0
  63. package/dist/core/onboard/FeedOnboardService.js +1 -422
  64. package/dist/core/onboard/FeedOnboardService.js.map +1 -0
  65. package/dist/core/onboard/OnboardProcessor.js +1 -333
  66. package/dist/core/onboard/OnboardProcessor.js.map +1 -0
  67. package/dist/core/onboard/OnboardStatus.js +1 -9
  68. package/dist/core/onboard/OnboardStatus.js.map +1 -0
  69. package/dist/core/onboard/OnboardStatusManager.js +1 -360
  70. package/dist/core/onboard/OnboardStatusManager.js.map +1 -0
  71. package/dist/core/validators/FeedValidator.js +1 -133
  72. package/dist/core/validators/FeedValidator.js.map +1 -0
  73. package/dist/core/validators/IServerValidator.js +1 -1
  74. package/dist/core/validators/IServerValidator.js.map +1 -0
  75. package/dist/core/validators/SSEServerValidator.js +1 -38
  76. package/dist/core/validators/SSEServerValidator.js.map +1 -0
  77. package/dist/core/validators/ServerValidatorFactory.js +1 -44
  78. package/dist/core/validators/ServerValidatorFactory.js.map +1 -0
  79. package/dist/core/validators/StdioServerValidator.js +1 -281
  80. package/dist/core/validators/StdioServerValidator.js.map +1 -0
  81. package/dist/index.js +1 -18
  82. package/dist/index.js.map +1 -0
  83. package/dist/services/InstallationService.js +1 -81
  84. package/dist/services/InstallationService.js.map +1 -0
  85. package/dist/services/MCPManager.js +1 -197
  86. package/dist/services/MCPManager.js.map +1 -0
  87. package/dist/services/RequirementService.js +1 -548
  88. package/dist/services/RequirementService.js.map +1 -0
  89. package/dist/services/ServerService.js +1 -127
  90. package/dist/services/ServerService.js.map +1 -0
  91. package/dist/services/TelemetryService.js +1 -53
  92. package/dist/services/TelemetryService.js.map +1 -0
  93. package/dist/utils/UpdateCheckTracker.js +1 -79
  94. package/dist/utils/UpdateCheckTracker.js.map +1 -0
  95. package/dist/utils/adoUtils.js +1 -254
  96. package/dist/utils/adoUtils.js.map +1 -0
  97. package/dist/utils/clientUtils.js +1 -65
  98. package/dist/utils/clientUtils.js.map +1 -0
  99. package/dist/utils/feedUtils.js +1 -28
  100. package/dist/utils/feedUtils.js.map +1 -0
  101. package/dist/utils/githubAuth.js +1 -177
  102. package/dist/utils/githubAuth.js.map +1 -0
  103. package/dist/utils/githubUtils.js +1 -125
  104. package/dist/utils/githubUtils.js.map +1 -0
  105. package/dist/utils/logger.js +1 -176
  106. package/dist/utils/logger.js.map +1 -0
  107. package/dist/utils/macroExpressionUtils.js +1 -93
  108. package/dist/utils/macroExpressionUtils.js.map +1 -0
  109. package/dist/utils/osUtils.js +1 -664
  110. package/dist/utils/osUtils.js.map +1 -0
  111. package/dist/utils/versionUtils.js +1 -101
  112. package/dist/utils/versionUtils.js.map +1 -0
  113. package/dist/web/contract/serverContract.js +1 -1
  114. package/dist/web/contract/serverContract.js.map +1 -0
  115. package/dist/web/public/js/api.js +2 -132
  116. package/dist/web/public/js/api.js.map +1 -0
  117. package/dist/web/public/js/detailsWidget.js +2 -264
  118. package/dist/web/public/js/detailsWidget.js.map +1 -0
  119. package/dist/web/public/js/flights/flights.js +2 -127
  120. package/dist/web/public/js/flights/flights.js.map +1 -0
  121. package/dist/web/public/js/modal/index.js +2 -52
  122. package/dist/web/public/js/modal/index.js.map +1 -0
  123. package/dist/web/public/js/modal/installModal.js +2 -162
  124. package/dist/web/public/js/modal/installModal.js.map +1 -0
  125. package/dist/web/public/js/modal/installation.js +2 -266
  126. package/dist/web/public/js/modal/installation.js.map +1 -0
  127. package/dist/web/public/js/modal/loadingModal.js +2 -182
  128. package/dist/web/public/js/modal/loadingModal.js.map +1 -0
  129. package/dist/web/public/js/modal/modalSetup.js +2 -595
  130. package/dist/web/public/js/modal/modalSetup.js.map +1 -0
  131. package/dist/web/public/js/modal/modalUtils.js +2 -37
  132. package/dist/web/public/js/modal/modalUtils.js.map +1 -0
  133. package/dist/web/public/js/modal/versionUtils.js +2 -20
  134. package/dist/web/public/js/modal/versionUtils.js.map +1 -0
  135. package/dist/web/public/js/modal.js +2 -42
  136. package/dist/web/public/js/modal.js.map +1 -0
  137. package/dist/web/public/js/notifications.js +2 -137
  138. package/dist/web/public/js/notifications.js.map +1 -0
  139. package/dist/web/public/js/onboard/formProcessor.js +2 -1037
  140. package/dist/web/public/js/onboard/formProcessor.js.map +1 -0
  141. package/dist/web/public/js/onboard/index.js +2 -374
  142. package/dist/web/public/js/onboard/index.js.map +1 -0
  143. package/dist/web/public/js/onboard/publishHandler.js +2 -172
  144. package/dist/web/public/js/onboard/publishHandler.js.map +1 -0
  145. package/dist/web/public/js/onboard/state.js +2 -76
  146. package/dist/web/public/js/onboard/state.js.map +1 -0
  147. package/dist/web/public/js/onboard/templates.js +2 -342
  148. package/dist/web/public/js/onboard/templates.js.map +1 -0
  149. package/dist/web/public/js/onboard/uiHandlers.js +2 -1076
  150. package/dist/web/public/js/onboard/uiHandlers.js.map +1 -0
  151. package/dist/web/public/js/onboard/validationHandlers.js +2 -493
  152. package/dist/web/public/js/onboard/validationHandlers.js.map +1 -0
  153. package/dist/web/public/js/serverCategoryDetails.js +2 -364
  154. package/dist/web/public/js/serverCategoryDetails.js.map +1 -0
  155. package/dist/web/public/js/serverCategoryList.js +2 -241
  156. package/dist/web/public/js/serverCategoryList.js.map +1 -0
  157. package/dist/web/public/js/settings.js +2 -314
  158. package/dist/web/public/js/settings.js.map +1 -0
  159. package/dist/web/server.js +1 -404
  160. package/dist/web/server.js.map +1 -0
  161. package/package.json +8 -2
  162. package/.github/ISSUE_TEMPLATE/JitAccess.yml +0 -28
  163. package/.github/acl/access.yml +0 -20
  164. package/.github/compliance/inventory.yml +0 -5
  165. package/.github/policies/jit.yml +0 -19
  166. package/.github/workflows/build.yml +0 -28
  167. package/.roo/rules-code/rules.md +0 -88
  168. package/dist/cli/commands/start.d.ts +0 -2
  169. package/dist/cli/commands/start.js +0 -32
  170. package/dist/cli/commands/sync.d.ts +0 -2
  171. package/dist/cli/commands/sync.js +0 -17
  172. package/dist/core/ConfigurationLoader.d.ts +0 -32
  173. package/dist/core/ConfigurationLoader.js +0 -236
  174. package/dist/core/ConfigurationProvider.d.ts +0 -35
  175. package/dist/core/ConfigurationProvider.js +0 -375
  176. package/dist/core/InstallationService.d.ts +0 -50
  177. package/dist/core/InstallationService.js +0 -350
  178. package/dist/core/MCPManager.d.ts +0 -28
  179. package/dist/core/MCPManager.js +0 -188
  180. package/dist/core/RequirementService.d.ts +0 -40
  181. package/dist/core/RequirementService.js +0 -110
  182. package/dist/core/ServerSchemaLoader.d.ts +0 -11
  183. package/dist/core/ServerSchemaLoader.js +0 -43
  184. package/dist/core/ServerSchemaProvider.d.ts +0 -17
  185. package/dist/core/ServerSchemaProvider.js +0 -120
  186. package/dist/core/constants.d.ts +0 -47
  187. package/dist/core/constants.js +0 -94
  188. package/dist/core/installers/BaseInstaller.d.ts +0 -74
  189. package/dist/core/installers/BaseInstaller.js +0 -253
  190. package/dist/core/installers/ClientInstaller.d.ts +0 -23
  191. package/dist/core/installers/ClientInstaller.js +0 -564
  192. package/dist/core/installers/CommandInstaller.d.ts +0 -37
  193. package/dist/core/installers/CommandInstaller.js +0 -173
  194. package/dist/core/installers/GeneralInstaller.d.ts +0 -33
  195. package/dist/core/installers/GeneralInstaller.js +0 -85
  196. package/dist/core/installers/InstallerFactory.d.ts +0 -54
  197. package/dist/core/installers/InstallerFactory.js +0 -97
  198. package/dist/core/installers/NpmInstaller.d.ts +0 -26
  199. package/dist/core/installers/NpmInstaller.js +0 -127
  200. package/dist/core/installers/PipInstaller.d.ts +0 -28
  201. package/dist/core/installers/PipInstaller.js +0 -127
  202. package/dist/core/installers/RequirementInstaller.d.ts +0 -33
  203. package/dist/core/installers/RequirementInstaller.js +0 -3
  204. package/dist/core/types.d.ts +0 -166
  205. package/dist/core/types.js +0 -16
  206. package/dist/services/InstallRequestValidator.d.ts +0 -21
  207. package/dist/services/InstallRequestValidator.js +0 -99
  208. package/dist/web/public/js/modal/installHandler.js +0 -227
  209. package/dist/web/public/js/modal/loadingUI.js +0 -74
  210. package/dist/web/public/js/modal/messageQueue.js +0 -112
  211. package/dist/web/public/js/modal/modalUI.js +0 -214
  212. package/dist/web/public/js/modal/version.js +0 -20
  213. package/dist/web/public/js/onboard/ONBOARDING_PAGE_DESIGN.md +0 -370
  214. package/docs/ONBOARDING_PAGE_DESIGN.md +0 -260
  215. package/docs/Telemetry.md +0 -136
  216. package/memory-bank/activeContext.md +0 -26
  217. package/memory-bank/decisionLog.md +0 -91
  218. package/memory-bank/productContext.md +0 -41
  219. package/memory-bank/progress.md +0 -35
  220. package/memory-bank/systemPatterns.md +0 -10
  221. package/src/cli/commands/install.ts +0 -139
  222. package/src/cli/commands/list.ts +0 -113
  223. package/src/cli/commands/pull.ts +0 -16
  224. package/src/cli/commands/serve.ts +0 -39
  225. package/src/cli/commands/uninstall.ts +0 -64
  226. package/src/cli/index.ts +0 -82
  227. package/src/core/installers/clients/BaseClientInstaller.ts +0 -341
  228. package/src/core/installers/clients/ClientInstaller.ts +0 -222
  229. package/src/core/installers/clients/ClientInstallerFactory.ts +0 -43
  230. package/src/core/installers/clients/ClineInstaller.ts +0 -35
  231. package/src/core/installers/clients/ExtensionInstaller.ts +0 -165
  232. package/src/core/installers/clients/GithubCopilotInstaller.ts +0 -79
  233. package/src/core/installers/clients/MSRooCodeInstaller.ts +0 -32
  234. package/src/core/installers/index.ts +0 -11
  235. package/src/core/installers/requirements/BaseInstaller.ts +0 -85
  236. package/src/core/installers/requirements/CommandInstaller.ts +0 -231
  237. package/src/core/installers/requirements/GeneralInstaller.ts +0 -133
  238. package/src/core/installers/requirements/InstallerFactory.ts +0 -114
  239. package/src/core/installers/requirements/NpmInstaller.ts +0 -271
  240. package/src/core/installers/requirements/NugetInstaller.ts +0 -203
  241. package/src/core/installers/requirements/PipInstaller.ts +0 -207
  242. package/src/core/installers/requirements/RequirementInstaller.ts +0 -42
  243. package/src/core/loaders/ConfigurationLoader.ts +0 -298
  244. package/src/core/loaders/ConfigurationProvider.ts +0 -462
  245. package/src/core/loaders/InstallOperationManager.ts +0 -367
  246. package/src/core/loaders/ServerSchemaLoader.ts +0 -117
  247. package/src/core/loaders/ServerSchemaProvider.ts +0 -99
  248. package/src/core/loaders/SystemSettingsManager.ts +0 -278
  249. package/src/core/metadatas/constants.ts +0 -122
  250. package/src/core/metadatas/recordingConstants.ts +0 -65
  251. package/src/core/metadatas/types.ts +0 -202
  252. package/src/core/onboard/FeedOnboardService.ts +0 -501
  253. package/src/core/onboard/OnboardProcessor.ts +0 -356
  254. package/src/core/onboard/OnboardStatus.ts +0 -60
  255. package/src/core/onboard/OnboardStatusManager.ts +0 -416
  256. package/src/core/validators/FeedValidator.ts +0 -135
  257. package/src/core/validators/IServerValidator.ts +0 -21
  258. package/src/core/validators/SSEServerValidator.ts +0 -43
  259. package/src/core/validators/ServerValidatorFactory.ts +0 -51
  260. package/src/core/validators/StdioServerValidator.ts +0 -313
  261. package/src/index.ts +0 -44
  262. package/src/services/InstallationService.ts +0 -102
  263. package/src/services/MCPManager.ts +0 -249
  264. package/src/services/RequirementService.ts +0 -627
  265. package/src/services/ServerService.ts +0 -161
  266. package/src/services/TelemetryService.ts +0 -59
  267. package/src/utils/UpdateCheckTracker.ts +0 -86
  268. package/src/utils/adoUtils.ts +0 -293
  269. package/src/utils/clientUtils.ts +0 -72
  270. package/src/utils/feedUtils.ts +0 -31
  271. package/src/utils/githubAuth.ts +0 -212
  272. package/src/utils/githubUtils.ts +0 -164
  273. package/src/utils/logger.ts +0 -195
  274. package/src/utils/macroExpressionUtils.ts +0 -104
  275. package/src/utils/osUtils.ts +0 -700
  276. package/src/utils/versionUtils.ts +0 -114
  277. package/src/web/contract/serverContract.ts +0 -74
  278. package/src/web/public/css/detailsWidget.css +0 -235
  279. package/src/web/public/css/modal.css +0 -757
  280. package/src/web/public/css/notifications.css +0 -101
  281. package/src/web/public/css/onboard.css +0 -107
  282. package/src/web/public/css/serverCategoryList.css +0 -120
  283. package/src/web/public/css/serverDetails.css +0 -139
  284. package/src/web/public/index.html +0 -359
  285. package/src/web/public/js/api.js +0 -132
  286. package/src/web/public/js/detailsWidget.js +0 -264
  287. package/src/web/public/js/flights/flights.js +0 -127
  288. package/src/web/public/js/modal/index.js +0 -52
  289. package/src/web/public/js/modal/installModal.js +0 -162
  290. package/src/web/public/js/modal/installation.js +0 -266
  291. package/src/web/public/js/modal/loadingModal.js +0 -182
  292. package/src/web/public/js/modal/modalSetup.js +0 -595
  293. package/src/web/public/js/modal/modalUtils.js +0 -37
  294. package/src/web/public/js/modal/versionUtils.js +0 -20
  295. package/src/web/public/js/modal.js +0 -42
  296. package/src/web/public/js/notifications.js +0 -137
  297. package/src/web/public/js/onboard/formProcessor.js +0 -1037
  298. package/src/web/public/js/onboard/index.js +0 -374
  299. package/src/web/public/js/onboard/publishHandler.js +0 -172
  300. package/src/web/public/js/onboard/state.js +0 -76
  301. package/src/web/public/js/onboard/templates.js +0 -342
  302. package/src/web/public/js/onboard/uiHandlers.js +0 -1076
  303. package/src/web/public/js/onboard/validationHandlers.js +0 -493
  304. package/src/web/public/js/serverCategoryDetails.js +0 -364
  305. package/src/web/public/js/serverCategoryList.js +0 -241
  306. package/src/web/public/js/settings.js +0 -314
  307. package/src/web/public/modal.html +0 -84
  308. package/src/web/public/onboard.html +0 -296
  309. package/src/web/public/settings.html +0 -135
  310. package/src/web/public/styles.css +0 -277
  311. package/src/web/server.ts +0 -478
  312. package/tsconfig.json +0 -18
  313. package/wiki/Installation.md +0 -3
  314. package/wiki/Publish.md +0 -3
package/src/web/server.ts DELETED
@@ -1,478 +0,0 @@
1
- import express, { Request, Response } from 'express';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { ServerSchema } from '../core/loaders/ServerSchemaProvider.js';
5
- import {
6
- RequirementConfig,
7
- FeedConfiguration,
8
- MCPServerCategory,
9
- McpConfig,
10
- EnvVariableConfig
11
- } from '../core/metadatas/types.js';
12
- import {
13
- ApiResponse,
14
- ListQueryParams,
15
- InstallServersRequestBody,
16
- UninstallServersRequestBody,
17
- OnboardRequestBody,
18
- OnboardServerConfig,
19
- OnboardRequirementConfig,
20
- RequirementType
21
- } from './contract/serverContract.js';
22
-
23
- import { OperationStatus, OnboardingProcessStatus, OperationType } from '../core/onboard/OnboardStatus.js';
24
- import { SUPPORTED_CLIENT_NAMES } from '../core/metadatas/constants.js';
25
- import { serverService } from '../services/ServerService.js';
26
- import { feedOnboardService } from '../core/onboard/FeedOnboardService.js';
27
- import { openBrowser } from '../utils/osUtils.js';
28
- import { Logger, EventType, EventStatus } from '../utils/logger.js';
29
- import { configProvider } from '../core/loaders/ConfigurationProvider.js';
30
- import { onboardStatusManager } from '../core/onboard/OnboardStatusManager.js';
31
- import { InstallOperationManager } from '../core/loaders/InstallOperationManager.js';
32
- import { systemSettingsManager } from '../core/loaders/SystemSettingsManager.js';
33
- import { SystemSettings } from '../core/metadatas/types.js';
34
- import { getAppVersion } from '../utils/versionUtils.js';
35
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
36
- const app = express();
37
-
38
- // Middleware
39
- app.use('/', express.static(path.join(__dirname, '..', '..', 'src', 'web', 'public')));
40
- app.use(express.json());
41
-
42
- // Get available targets
43
- app.get('/api/targets', async (req: Request, res: Response) => {
44
- try {
45
- // Get clientMcpSettings
46
- const clientMcpSettings = await configProvider.getClientMcpSettings();
47
-
48
- // Keep original format but add clientMcpSettings as additional property
49
- const response: ApiResponse<string[]> & { clientMcpSettings?: Record<string, Record<string, any>> } = {
50
- success: true,
51
- data: SUPPORTED_CLIENT_NAMES,
52
- clientMcpSettings: clientMcpSettings
53
- };
54
-
55
- res.json(response);
56
- } catch (error) {
57
- const message = error instanceof Error ? error.message : 'Unknown error';
58
- res.status(500).json({
59
- success: false,
60
- error: message
61
- });
62
- }
63
- });
64
-
65
- // List server categories
66
- app.get('/api/categories', async (req: Request<{}, {}, {}, ListQueryParams>, res: Response) => {
67
- try {
68
- const { local } = req.query;
69
- const servers = await serverService.listServerCategories({
70
- local: local !== 'false'
71
- });
72
-
73
- const response: ApiResponse<typeof servers> = {
74
- success: true,
75
- data: servers
76
- };
77
-
78
- res.json(response);
79
- } catch (error) {
80
- const message = error instanceof Error ? error.message : 'Unknown error';
81
- res.status(500).json({
82
- success: false,
83
- error: message
84
- });
85
- }
86
- });
87
-
88
- // Get server schema
89
- app.get('/api/categories/:categoryName/servers/:serverName/schema', async (req: Request<{ categoryName: string; serverName: string }>, res: Response) => {
90
- try {
91
- const { categoryName, serverName } = req.params;
92
- const schema = await serverService.getServerSchema(categoryName, serverName);
93
-
94
- if (!schema) {
95
- return res.status(404).json({
96
- success: false,
97
- error: `Schema not found for server ${serverName} in category ${categoryName}`
98
- });
99
- }
100
-
101
- const response: ApiResponse<ServerSchema> = {
102
- success: true,
103
- data: schema
104
- };
105
-
106
- res.json(response);
107
- } catch (error) {
108
- const message = error instanceof Error ? error.message : 'Unknown error';
109
- res.status(500).json({
110
- success: false,
111
- error: `Failed to get schema for server ${req.params.serverName} in category ${req.params.categoryName}: ${message}`
112
- });
113
- }
114
- });
115
-
116
- // Get categories data (including feed configuration)
117
- app.get('/api/categories/:categoryName', async (req: Request<{ categoryName: string }>, res: Response) => {
118
- try {
119
- const { categoryName } = req.params;
120
- const serverData = await serverService.getServerCategory(categoryName);
121
-
122
- if (!serverData) {
123
- return res.status(404).json({
124
- success: false,
125
- error: `Server category ${categoryName} not found`
126
- });
127
- }
128
-
129
- const response: ApiResponse<any> = {
130
- success: true,
131
- data: serverData
132
- };
133
- res.json(response);
134
- } catch (error) {
135
- const message = error instanceof Error ? error.message : 'Unknown error';
136
- res.status(500).json({
137
- success: false,
138
- error: `Failed to get server category data for ${req.params.categoryName}: ${message}`
139
- });
140
- }
141
- });
142
-
143
- // Handle server category onboarding
144
-
145
- // Install servers for a category
146
- app.post('/api/categories/:categoryName/install', async (req: Request<{ categoryName: string }, {}, InstallServersRequestBody>, res: Response) => {
147
- try {
148
- const { categoryName } = req.params;
149
- const { serverList } = req.body;
150
-
151
- if (!serverList || Object.keys(serverList).length === 0) {
152
- return res.status(400).json({
153
- success: false,
154
- error: 'Invalid server list provided'
155
- });
156
- }
157
-
158
- const results = await Promise.all(
159
- Object.entries(serverList).map(([serverName, options]) => serverService.installMcpServer(categoryName, serverName, options))
160
- );
161
-
162
- const { success, messages } = serverService.formatOperationResults(results);
163
-
164
- const response: ApiResponse<{ messages: string[] }> = {
165
- success,
166
- data: { messages }
167
- };
168
-
169
- res.json(response);
170
- } catch (error) {
171
- const message = error instanceof Error ? error.message : 'Unknown error';
172
- res.status(500).json({
173
- success: false,
174
- error: `Failed to install server for ${req.params.categoryName}: ${message}`
175
- });
176
- }
177
-
178
-
179
- });
180
-
181
- // Handle server category onboarding
182
- app.post('/api/categories/onboard', async (req: Request<{}, {}, OnboardRequestBody>, res: Response) => {
183
- try {
184
- const { categoryData, forExistingCategory } = req.body; // Extract forExistingCategory from request body
185
-
186
- // Basic validation for categoryData presence and essential fields for this endpoint
187
- if (!categoryData || !categoryData.name || !categoryData.displayName) {
188
- return res.status(400).json({
189
- success: false,
190
- error: 'Category data, including name and display name, is required.'
191
- });
192
- }
193
-
194
- // categoryData is now expected to be a FeedConfiguration object directly from the client
195
- const feedConfiguration: FeedConfiguration = categoryData as FeedConfiguration;
196
-
197
- // Structural validation is now primarily handled by FeedOnboardService.validateStaticConfig
198
- // The service will throw an error if the structure is invalid, which will be caught by the catch block below.
199
-
200
- const operationResult = await feedOnboardService.onboardFeed(feedConfiguration, forExistingCategory);
201
-
202
- // The response now directly reflects the OperationStatus returned by the service.
203
- // The client will use data.onboardingId (which is the categoryName) to poll for status updates.
204
- const response: ApiResponse<typeof operationResult> = {
205
- success: operationResult.status !== OnboardingProcessStatus.FAILED, // Or a more nuanced success check
206
- // Ensure data.onboardingId is the categoryName for polling
207
- data: { ...operationResult, onboardingId: feedConfiguration.name }
208
- };
209
-
210
- res.status(operationResult.status === OnboardingProcessStatus.FAILED ? 500 : 200).json(response);
211
- } catch (error) {
212
- const message = error instanceof Error ? error.message : 'Unknown error';
213
- res.status(500).json({
214
- success: false,
215
- error: `Failed to ${req.body.isUpdate ? 'update' : 'create'} server category: ${message}`
216
- });
217
- }
218
- });
219
-
220
- // Validate feed configuration
221
- app.post('/api/categories/onboard/validate', async (req: Request<{}, {}, OnboardRequestBody>, res: Response) => {
222
- try {
223
- const { categoryData, forExistingCategory } = req.body;
224
-
225
- if (!categoryData || !categoryData.name) {
226
- return res.status(400).json({
227
- success: false,
228
- error: 'Category name is required in categoryData for validation.'
229
- });
230
- }
231
-
232
- // categoryData is now expected to be a FeedConfiguration object directly from the client
233
- const feedConfigurationToValidate: FeedConfiguration = categoryData as FeedConfiguration;
234
-
235
- // Structural validation is now primarily handled by FeedOnboardService.validateStaticConfig
236
- // The service will throw an error if the structure is invalid, which will be caught by the catch block below.
237
-
238
- // Call the service, which now returns OperationStatus & { feedConfiguration? }
239
- // serverName parameter has been removed from validateFeed
240
- const validationOperationResult = await feedOnboardService.validateFeed(feedConfigurationToValidate, forExistingCategory);
241
-
242
- // The response includes the operation status and the feed configuration that was validated.
243
- // The client will use data.onboardingId (which is the categoryName) to poll for status updates.
244
- const response: ApiResponse<typeof validationOperationResult> = {
245
- success: validationOperationResult.status !== OnboardingProcessStatus.FAILED,
246
- // Ensure data.onboardingId is the categoryName for polling
247
- data: { ...validationOperationResult, onboardingId: feedConfigurationToValidate.name }
248
- };
249
- res.status(validationOperationResult.status === OnboardingProcessStatus.FAILED ? 500 : 200).json(response);
250
- } catch (error) {
251
- const message = error instanceof Error ? error.message : 'Unknown error';
252
- res.status(500).json({
253
- success: false,
254
- error: `Failed to validate server category: ${message}`
255
- });
256
- }
257
- });
258
-
259
- // Get category onboarding/validation operation status
260
- app.get('/api/categories/:categoryName/onboard/status', async (req: Request<{ categoryName: string }, {}, {}, { operationType?: string }>, res: Response) => {
261
- try {
262
- const { categoryName } = req.params;
263
- const { operationType } = req.query;
264
-
265
- if (!operationType) {
266
- return res.status(400).json({
267
- success: false,
268
- error: 'operationType query parameter is required.'
269
- });
270
- }
271
-
272
- // Validate operationType if necessary (e.g., check against known OperationType values)
273
- // For now, we'll assume it's a valid OperationType string.
274
- const validOperationType = operationType as OperationType;
275
-
276
- const status = await onboardStatusManager.getStatus(categoryName, validOperationType);
277
-
278
- if (!status) {
279
- return res.status(404).json({
280
- success: false,
281
- error: `No active operation found for category ${categoryName} with operation type ${validOperationType}`
282
- });
283
- }
284
-
285
- // Construct the response data based on the retrieved OnboardStatus
286
- const lastStepName = status.steps && status.steps.length > 0 ? status.steps[status.steps.length - 1].stepName : undefined;
287
- const responseData: OperationStatus & { steps?: any[], feedConfiguration?: FeedConfiguration } = { // Added steps and feedConfiguration to type
288
- onboardingId: status.onboardingId, // This is categoryName_operationType
289
- status: status.status,
290
- message: lastStepName || status.errorMessage || 'Processing...',
291
- lastQueried: new Date().toISOString(),
292
- steps: status.steps, // Include the steps array in the response
293
- ...(status.validationStatus && { validationStatus: status.validationStatus }),
294
- ...(status.prInfo && { prInfo: status.prInfo }),
295
- ...(status.result && { result: status.result }),
296
- ...(status.errorMessage && { errorMessage: status.errorMessage }),
297
- operationType: status.operationType, // Always include operationType from the status object
298
- // Attempt to include feedConfiguration if available, especially for SUCCEEDED VALIDATION_ONLY
299
- ...(status.operationType === 'VALIDATION_ONLY' && status.status === OnboardingProcessStatus.SUCCEEDED && status.result?.feedConfiguration && { feedConfiguration: status.result.feedConfiguration }),
300
- };
301
-
302
- const response: ApiResponse<typeof responseData> = {
303
- success: true,
304
- data: responseData
305
- };
306
- res.json(response);
307
- } catch (error) {
308
- const message = error instanceof Error ? error.message : 'Unknown error';
309
- res.status(500).json({
310
- success: false,
311
- error: `Failed to get operation status for category ${req.params.categoryName}: ${message}`
312
- });
313
- }
314
- });
315
-
316
- // Get installation operation status
317
- app.get('/api/categories/:categoryName/servers/:serverName/installation/status', async (req: Request<{ categoryName: string; serverName: string }>, res: Response) => {
318
- try {
319
- const { categoryName, serverName } = req.params;
320
- const details = await InstallOperationManager.getInstance(categoryName, serverName).getDetails();
321
-
322
- if (!details) {
323
- return res.status(404).json({
324
- success: false,
325
- error: `No installation operation found for server ${serverName} in category ${categoryName}`
326
- });
327
- }
328
-
329
- const response: ApiResponse<typeof details> = {
330
- success: true,
331
- data: details
332
- };
333
- res.json(response);
334
- } catch (error) {
335
- const message = error instanceof Error ? error.message : 'Unknown error';
336
- res.status(500).json({
337
- success: false,
338
- error: `Failed to get installation operation status for server ${req.params.serverName} in category ${req.params.categoryName}: ${message}`
339
- });
340
- }
341
- });
342
-
343
- // Uninstall tools from a server
344
- app.post('/api/categories/:categoryName/uninstall', async (req: Request<{ categoryName: string }, {}, UninstallServersRequestBody>, res: Response) => {
345
- try {
346
- const { categoryName } = req.params;
347
- const { serverList } = req.body;
348
-
349
- if (!serverList || Object.keys(serverList).length === 0) {
350
- return res.status(400).json({
351
- success: false,
352
- error: 'Invalid tool list provided'
353
- });
354
- }
355
-
356
- const { options } = req.body;
357
- if (!options?.targets || options.targets.length === 0) {
358
- return res.status(400).json({
359
- success: false,
360
- error: 'No target clients specified'
361
- });
362
- }
363
-
364
- const results = await Promise.all(
365
- Object.entries(serverList).map(([serverName, serverOptions]) =>
366
- serverService.uninstallMcpServer(categoryName, serverName, {
367
- ...serverOptions,
368
- targets: options.targets,
369
- removeData: options.removeData ?? serverOptions.removeData
370
- })
371
- )
372
- );
373
-
374
- const { success, messages } = serverService.formatOperationResults(results);
375
-
376
- const response: ApiResponse<{ messages: string[] }> = {
377
- success,
378
- data: { messages }
379
- };
380
-
381
- res.json(response);
382
- } catch (error) {
383
- const message = error instanceof Error ? error.message : 'Unknown error';
384
- res.status(500).json({
385
- success: false,
386
- error: `Failed to uninstall servers from ${req.params.categoryName}: ${message}`
387
- });
388
- }
389
- });
390
-
391
- // System Settings API
392
- app.get('/api/settings', async (req: Request, res: Response) => {
393
- try {
394
- const settings = await systemSettingsManager.getSystemSettings();
395
- const response: ApiResponse<SystemSettings> = {
396
- success: true,
397
- data: settings
398
- };
399
- res.json(response);
400
- } catch (error) {
401
- const message = error instanceof Error ? error.message : 'Unknown error';
402
- res.status(500).json({
403
- success: false,
404
- error: `Failed to get system settings: ${message}`
405
- });
406
- }
407
- });
408
-
409
- app.post('/api/settings', async (req: Request<{}, {}, Partial<SystemSettings>>, res: Response) => {
410
- try {
411
- const newSettings = req.body;
412
- const updatedSettings = await systemSettingsManager.createOrUpdateSystemSettings(newSettings);
413
- const response: ApiResponse<SystemSettings> = {
414
- success: true,
415
- data: updatedSettings
416
- };
417
- res.json(response);
418
- } catch (error) {
419
- const message = error instanceof Error ? error.message : 'Unknown error';
420
- res.status(500).json({
421
- success: false,
422
- error: `Failed to update system settings: ${message}`
423
- });
424
- }
425
- });
426
-
427
- // API to get package version
428
- app.get('/api/version', async (req: Request, res: Response) => {
429
- try {
430
- const appVersionData = await getAppVersion();
431
- const response: ApiResponse<typeof appVersionData> = {
432
- success: true,
433
- data: appVersionData
434
- };
435
- res.json(response);
436
- } catch (error) {
437
- const message = error instanceof Error ? error.message : 'Unknown error';
438
- res.status(500).json({
439
- success: false,
440
- error: `Failed to get package version: ${message}`
441
- });
442
- }
443
- });
444
-
445
- export async function startWebServer(port = 3000): Promise<void> {
446
- return new Promise((resolve, reject) => {
447
- const server = app.listen(port, () => {
448
- const url = `http://localhost:${port}`;
449
- Logger.log(`IMCP web interface running at ${url}`);
450
-
451
- // Open the URL in the default browser
452
- openBrowser(url).catch(err => {
453
- console.warn(`Failed to open browser: ${err.message}`);
454
- });
455
-
456
- // Track IMCP serve event
457
- Logger.trackEvent(EventType.IMCP_SERVE, {
458
- status: EventStatus.SUCCESS,
459
- port: port,
460
- });
461
- resolve();
462
- });
463
-
464
- server.on('error', (error) => {
465
- Logger.trackEvent(EventType.IMCP_SERVE, {
466
- status: EventStatus.FAILED,
467
- errorMessage: error instanceof Error ? error.message : String(error),
468
- port: port
469
- });
470
- reject(error);
471
- });
472
- });
473
- }
474
-
475
- // Allow running directly
476
- if (import.meta.url === `file://${process.argv[1]}`) {
477
- startWebServer().catch(console.error);
478
- }
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "node",
6
- "outDir": "./dist",
7
- "rootDir": "./src",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "declaration": true,
13
- "sourceMap": true,
14
- "resolveJsonModule": true
15
- },
16
- "include": ["src/**/*"],
17
- "exclude": ["node_modules", "dist", "**/*.test.ts"]
18
- }
@@ -1,3 +0,0 @@
1
- # MCP Server Installation
2
-
3
- This document describes how to install MCP servers.
package/wiki/Publish.md DELETED
@@ -1,3 +0,0 @@
1
- # MCP Server Publish
2
-
3
- This document describes how to publish MCP servers.