@juspay/neurolink 1.10.0 → 1.11.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 (144) hide show
  1. package/CHANGELOG.md +43 -33
  2. package/README.md +16 -0
  3. package/dist/agent/direct-tools.d.ts +9 -9
  4. package/dist/cli/commands/agent-generate.d.ts +1 -2
  5. package/dist/cli/commands/agent-generate.js +5 -8
  6. package/dist/cli/commands/config.d.ts +2 -2
  7. package/dist/cli/commands/config.js +1 -1
  8. package/dist/cli/commands/mcp.js +91 -100
  9. package/dist/cli/commands/ollama.d.ts +2 -7
  10. package/dist/cli/commands/ollama.js +5 -8
  11. package/dist/cli/index.js +185 -276
  12. package/dist/core/factory.js +9 -10
  13. package/dist/index.d.ts +23 -0
  14. package/dist/index.js +35 -0
  15. package/dist/lib/agent/direct-tools.d.ts +9 -9
  16. package/dist/lib/core/factory.js +9 -10
  17. package/dist/lib/index.d.ts +23 -0
  18. package/dist/lib/index.js +35 -0
  19. package/dist/lib/mcp/adapters/plugin-bridge.d.ts +39 -0
  20. package/dist/lib/mcp/adapters/plugin-bridge.js +82 -0
  21. package/dist/lib/mcp/auto-discovery.d.ts +38 -96
  22. package/dist/lib/mcp/auto-discovery.js +100 -744
  23. package/dist/lib/mcp/client.js +4 -4
  24. package/dist/lib/mcp/context-manager.js +72 -1
  25. package/dist/lib/mcp/contracts/mcp-contract.d.ts +162 -0
  26. package/dist/lib/mcp/contracts/mcp-contract.js +58 -0
  27. package/dist/lib/mcp/core/plugin-manager.d.ts +45 -0
  28. package/dist/lib/mcp/core/plugin-manager.js +110 -0
  29. package/dist/lib/mcp/demo/plugin-demo.d.ts +20 -0
  30. package/dist/lib/mcp/demo/plugin-demo.js +116 -0
  31. package/dist/lib/mcp/ecosystem.d.ts +75 -0
  32. package/dist/lib/mcp/ecosystem.js +161 -0
  33. package/dist/lib/mcp/external-client.d.ts +88 -0
  34. package/dist/lib/mcp/external-client.js +323 -0
  35. package/dist/lib/mcp/external-manager.d.ts +112 -0
  36. package/dist/lib/mcp/external-manager.js +302 -0
  37. package/dist/lib/mcp/factory.d.ts +4 -4
  38. package/dist/lib/mcp/function-calling.js +59 -34
  39. package/dist/lib/mcp/index.d.ts +39 -184
  40. package/dist/lib/mcp/index.js +72 -150
  41. package/dist/lib/mcp/initialize.js +5 -5
  42. package/dist/lib/mcp/logging.d.ts +27 -60
  43. package/dist/lib/mcp/logging.js +77 -165
  44. package/dist/lib/mcp/neurolink-mcp-client.js +31 -3
  45. package/dist/lib/mcp/orchestrator.d.ts +1 -1
  46. package/dist/lib/mcp/orchestrator.js +13 -12
  47. package/dist/lib/mcp/plugin-manager.d.ts +98 -0
  48. package/dist/lib/mcp/plugin-manager.js +294 -0
  49. package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
  50. package/dist/lib/mcp/plugins/core/filesystem-mcp.js +139 -0
  51. package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +36 -0
  52. package/dist/lib/mcp/plugins/filesystem-mcp.js +54 -0
  53. package/dist/lib/mcp/registry.d.ts +27 -176
  54. package/dist/lib/mcp/registry.js +31 -372
  55. package/dist/lib/mcp/security-manager.d.ts +85 -0
  56. package/dist/lib/mcp/security-manager.js +344 -0
  57. package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
  58. package/dist/lib/mcp/tool-integration.d.ts +4 -14
  59. package/dist/lib/mcp/tool-integration.js +43 -21
  60. package/dist/lib/mcp/tool-registry.d.ts +66 -0
  61. package/dist/lib/mcp/tool-registry.js +160 -0
  62. package/dist/lib/mcp/unified-mcp.d.ts +123 -0
  63. package/dist/lib/mcp/unified-mcp.js +246 -0
  64. package/dist/lib/mcp/unified-registry.d.ts +42 -229
  65. package/dist/lib/mcp/unified-registry.js +96 -1346
  66. package/dist/lib/neurolink.d.ts +3 -4
  67. package/dist/lib/neurolink.js +17 -18
  68. package/dist/lib/providers/agent-enhanced-provider.js +2 -2
  69. package/dist/lib/providers/amazonBedrock.js +2 -2
  70. package/dist/lib/providers/anthropic.js +3 -3
  71. package/dist/lib/providers/azureOpenAI.js +3 -3
  72. package/dist/lib/providers/function-calling-provider.js +34 -25
  73. package/dist/lib/providers/googleAIStudio.js +9 -3
  74. package/dist/lib/providers/googleVertexAI.js +2 -2
  75. package/dist/lib/providers/huggingFace.js +2 -2
  76. package/dist/lib/providers/mcp-provider.js +33 -5
  77. package/dist/lib/providers/mistralAI.js +2 -2
  78. package/dist/lib/providers/ollama.js +2 -2
  79. package/dist/lib/providers/openAI.js +2 -2
  80. package/dist/lib/utils/providerUtils-fixed.js +9 -9
  81. package/dist/mcp/adapters/plugin-bridge.d.ts +39 -0
  82. package/dist/mcp/adapters/plugin-bridge.js +82 -0
  83. package/dist/mcp/auto-discovery.d.ts +38 -96
  84. package/dist/mcp/auto-discovery.js +100 -745
  85. package/dist/mcp/client.js +4 -4
  86. package/dist/mcp/context-manager.js +72 -1
  87. package/dist/mcp/contracts/mcp-contract.d.ts +162 -0
  88. package/dist/mcp/contracts/mcp-contract.js +58 -0
  89. package/dist/mcp/core/plugin-manager.d.ts +45 -0
  90. package/dist/mcp/core/plugin-manager.js +110 -0
  91. package/dist/mcp/demo/plugin-demo.d.ts +20 -0
  92. package/dist/mcp/demo/plugin-demo.js +116 -0
  93. package/dist/mcp/ecosystem.d.ts +75 -0
  94. package/dist/mcp/ecosystem.js +162 -0
  95. package/dist/mcp/external-client.d.ts +88 -0
  96. package/dist/mcp/external-client.js +323 -0
  97. package/dist/mcp/external-manager.d.ts +112 -0
  98. package/dist/mcp/external-manager.js +302 -0
  99. package/dist/mcp/factory.d.ts +4 -4
  100. package/dist/mcp/function-calling.js +59 -34
  101. package/dist/mcp/index.d.ts +39 -184
  102. package/dist/mcp/index.js +72 -150
  103. package/dist/mcp/initialize.js +5 -5
  104. package/dist/mcp/logging.d.ts +27 -60
  105. package/dist/mcp/logging.js +77 -165
  106. package/dist/mcp/neurolink-mcp-client.js +31 -3
  107. package/dist/mcp/orchestrator.d.ts +1 -1
  108. package/dist/mcp/orchestrator.js +13 -12
  109. package/dist/mcp/plugin-manager.d.ts +98 -0
  110. package/dist/mcp/plugin-manager.js +295 -0
  111. package/dist/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
  112. package/dist/mcp/plugins/core/filesystem-mcp.js +139 -0
  113. package/dist/mcp/plugins/core/neurolink-mcp.json +17 -0
  114. package/dist/mcp/plugins/filesystem-mcp.d.ts +36 -0
  115. package/dist/mcp/plugins/filesystem-mcp.js +54 -0
  116. package/dist/mcp/registry.d.ts +27 -176
  117. package/dist/mcp/registry.js +31 -372
  118. package/dist/mcp/security-manager.d.ts +85 -0
  119. package/dist/mcp/security-manager.js +344 -0
  120. package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
  121. package/dist/mcp/tool-integration.d.ts +4 -14
  122. package/dist/mcp/tool-integration.js +43 -21
  123. package/dist/mcp/tool-registry.d.ts +66 -0
  124. package/dist/mcp/tool-registry.js +160 -0
  125. package/dist/mcp/unified-mcp.d.ts +123 -0
  126. package/dist/mcp/unified-mcp.js +246 -0
  127. package/dist/mcp/unified-registry.d.ts +42 -229
  128. package/dist/mcp/unified-registry.js +96 -1345
  129. package/dist/neurolink.d.ts +3 -4
  130. package/dist/neurolink.js +17 -18
  131. package/dist/providers/agent-enhanced-provider.js +2 -2
  132. package/dist/providers/amazonBedrock.js +2 -2
  133. package/dist/providers/anthropic.js +3 -3
  134. package/dist/providers/azureOpenAI.js +3 -3
  135. package/dist/providers/function-calling-provider.js +34 -25
  136. package/dist/providers/googleAIStudio.js +9 -3
  137. package/dist/providers/googleVertexAI.js +2 -2
  138. package/dist/providers/huggingFace.js +2 -2
  139. package/dist/providers/mcp-provider.js +33 -5
  140. package/dist/providers/mistralAI.js +2 -2
  141. package/dist/providers/ollama.js +2 -2
  142. package/dist/providers/openAI.js +2 -2
  143. package/dist/utils/providerUtils-fixed.js +9 -9
  144. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,59 +1,69 @@
1
- # [1.10.0](https://github.com/juspay/neurolink/compare/v1.9.0...v1.10.0) (2025-06-21)
1
+ ## [1.11.1](https://github.com/juspay/neurolink/compare/v1.11.0...v1.11.1) (2025-06-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add backward compatiblity for gemini ([5e84dab](https://github.com/juspay/neurolink/commit/5e84dab598156a5b77d05b343d0d69ecf91f31b0))
7
+
8
+ # [1.11.0](https://github.com/juspay/neurolink/compare/v1.10.0...v1.11.0) (2025-06-21)
2
9
 
3
10
 
4
11
  ### Features
5
12
 
6
- * **cli:** improve provider status accuracy and error handling ([523e845](https://github.com/juspay/neurolink/commit/523e84566fee5d9afa3638186f90c628e20e4894))
13
+ * finalize MCP ecosystem and resolve all TypeScript errors ([605d8b2](https://github.com/juspay/neurolink/commit/605d8b2ea10c824077e1379ac47a0c065f0a8095))
7
14
 
8
- # 1.9.0 (2025-06-20)
15
+ # [1.10.0](https://github.com/juspay/neurolink/compare/v1.9.0...v1.10.0) (2025-06-21)
9
16
 
17
+ ### Features
18
+
19
+ - **cli:** improve provider status accuracy and error handling ([523e845](https://github.com/juspay/neurolink/commit/523e84566fee5d9afa3638186f90c628e20e4894))
10
20
 
11
- * 🎉 feat: Enhanced multi-provider support with production infrastructure ([#16](https://github.com/juspay/neurolink/issues/16)) ([55eb81a](https://github.com/juspay/neurolink/commit/55eb81a4a7e88c94f6017565b14633b254a15197))
21
+ # 1.9.0 (2025-06-20)
12
22
 
23
+ - 🎉 feat: Enhanced multi-provider support with production infrastructure ([#16](https://github.com/juspay/neurolink/issues/16)) ([55eb81a](https://github.com/juspay/neurolink/commit/55eb81a4a7e88c94f6017565b14633b254a15197))
13
24
 
14
25
  ### Bug Fixes
15
26
 
16
- * **cli:** prevent debug log persistence in production deployments ([#14](https://github.com/juspay/neurolink/issues/14)) ([7310a4c](https://github.com/juspay/neurolink/commit/7310a4cb405e1f35bcc5b22559f3da87a1d793f4))
17
- * production-ready CLI logging system and enhanced provider fallback ([#13](https://github.com/juspay/neurolink/issues/13)) ([a7e8122](https://github.com/juspay/neurolink/commit/a7e8122393f09cd85e473e5711fbfff05343025e))
18
-
27
+ - **cli:** prevent debug log persistence in production deployments ([#14](https://github.com/juspay/neurolink/issues/14)) ([7310a4c](https://github.com/juspay/neurolink/commit/7310a4cb405e1f35bcc5b22559f3da87a1d793f4))
28
+ - production-ready CLI logging system and enhanced provider fallback ([#13](https://github.com/juspay/neurolink/issues/13)) ([a7e8122](https://github.com/juspay/neurolink/commit/a7e8122393f09cd85e473e5711fbfff05343025e))
19
29
 
20
30
  ### Features
21
31
 
22
- * 🚀 MCP automatic tool discovery + dynamic models + AI function calling ([781b4e5](https://github.com/juspay/neurolink/commit/781b4e5c6e4886acb44a986f7b204eff346427e1))
23
- * add Google AI Studio integration and restructure documentation ([#11](https://github.com/juspay/neurolink/issues/11)) ([346fed2](https://github.com/juspay/neurolink/commit/346fed2ad458da07b80158f084afed8f3b804f06))
24
- * add Google AI Studio, fix CLI dependencies, and add LICENSE file ([#12](https://github.com/juspay/neurolink/issues/12)) ([c234bcb](https://github.com/juspay/neurolink/commit/c234bcb65ab1d07cb079ee9ffe9d61841aa945fb))
25
- * implement AI Development Workflow Tools and comprehensive visual documentation ([#10](https://github.com/juspay/neurolink/issues/10)) ([b0ae179](https://github.com/juspay/neurolink/commit/b0ae179d0b31936e4aa8c53c8e8a234cd467e7c3))
26
- * implement comprehensive CLI tool with visual documentation and … ([#4](https://github.com/juspay/neurolink/issues/4)) ([9991edb](https://github.com/juspay/neurolink/commit/9991edba7dbe7b9b33bd3b4e2b30186a81b40391))
27
-
32
+ - 🚀 MCP automatic tool discovery + dynamic models + AI function calling ([781b4e5](https://github.com/juspay/neurolink/commit/781b4e5c6e4886acb44a986f7b204eff346427e1))
33
+ - add Google AI Studio integration and restructure documentation ([#11](https://github.com/juspay/neurolink/issues/11)) ([346fed2](https://github.com/juspay/neurolink/commit/346fed2ad458da07b80158f084afed8f3b804f06))
34
+ - add Google AI Studio, fix CLI dependencies, and add LICENSE file ([#12](https://github.com/juspay/neurolink/issues/12)) ([c234bcb](https://github.com/juspay/neurolink/commit/c234bcb65ab1d07cb079ee9ffe9d61841aa945fb))
35
+ - implement AI Development Workflow Tools and comprehensive visual documentation ([#10](https://github.com/juspay/neurolink/issues/10)) ([b0ae179](https://github.com/juspay/neurolink/commit/b0ae179d0b31936e4aa8c53c8e8a234cd467e7c3))
36
+ - implement comprehensive CLI tool with visual documentation and … ([#4](https://github.com/juspay/neurolink/issues/4)) ([9991edb](https://github.com/juspay/neurolink/commit/9991edba7dbe7b9b33bd3b4e2b30186a81b40391))
28
37
 
29
38
  ### BREAKING CHANGES
30
39
 
31
- * Enhanced provider architecture with MCP integration
40
+ - Enhanced provider architecture with MCP integration
32
41
 
33
- - ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
34
- - 🎯 AI function calling - seamless tool execution with Vercel AI SDK
35
- - 🔧 Dynamic model configuration via config/models.json
36
- - 🤖 Agent-based generation with automatic tool selection
37
- - 📡 Real-time MCP server management and monitoring
42
+ * ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
43
+ * 🎯 AI function calling - seamless tool execution with Vercel AI SDK
44
+ * 🔧 Dynamic model configuration via config/models.json
45
+ * 🤖 Agent-based generation with automatic tool selection
46
+ * 📡 Real-time MCP server management and monitoring
38
47
 
39
- - Added MCPEnhancedProvider for automatic tool integration
40
- - Implemented function calling for Google AI, OpenAI providers
41
- - Created unified tool registry for MCP and built-in tools
42
- - Enhanced CLI with `agent-generate` and MCP management commands
43
- - Added comprehensive examples and documentation
48
+ * Added MCPEnhancedProvider for automatic tool integration
49
+ * Implemented function calling for Google AI, OpenAI providers
50
+ * Created unified tool registry for MCP and built-in tools
51
+ * Enhanced CLI with `agent-generate` and MCP management commands
52
+ * Added comprehensive examples and documentation
44
53
 
45
- - Automatic .mcp-config.json discovery across platforms
46
- - Session-based context management for tool execution
47
- - Graceful fallback when MCP servers unavailable
48
- - Performance optimized tool discovery (<1ms per tool)
54
+ * Automatic .mcp-config.json discovery across platforms
55
+ * Session-based context management for tool execution
56
+ * Graceful fallback when MCP servers unavailable
57
+ * Performance optimized tool discovery (<1ms per tool)
49
58
 
50
- - Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
51
- - Created practical examples for all integration patterns
52
- - Updated API reference with new capabilities
53
- - Enhanced memory bank with implementation details
59
+ * Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
60
+ * Created practical examples for all integration patterns
61
+ * Updated API reference with new capabilities
62
+ * Enhanced memory bank with implementation details
54
63
 
55
64
  Resolves: Enhanced AI capabilities with real-world tool integration
56
- * None - 100% backward compatibility maintained
65
+
66
+ - None - 100% backward compatibility maintained
57
67
 
58
68
  Closes: Enhanced multi-provider support milestone
59
69
  Ready for: Immediate production deployment
package/README.md CHANGED
@@ -11,6 +11,22 @@
11
11
 
12
12
  **NeuroLink** unifies OpenAI, Bedrock, Vertex AI, Google AI Studio, Anthropic, Azure OpenAI, Hugging Face, Ollama, and Mistral AI with intelligent fallback and streaming support. Available as both a **programmatic SDK** and **professional CLI tool**. Extracted from production use at Juspay.
13
13
 
14
+ ## 🔥 **Latest Breakthrough: Full MCP Tool Integration Operational** (June 21, 2025)
15
+
16
+ **MAJOR SUCCESS**: All blocking TypeScript compilation errors resolved + Complete CLI MCP integration achieved!
17
+
18
+ ✅ **Function Calling Ready**: AI can now execute real filesystem operations, data analysis, and system commands
19
+ ✅ **Production Validated**: 23,230+ token MCP context loading confirmed via comprehensive CLI testing
20
+ ✅ **Zero Build Errors**: Clean TypeScript compilation after resolving all 13 blocking errors
21
+ ✅ **CLI Tool Integration**: Both `generate-text` and `agent-generate` commands use full MCP capabilities
22
+ ✅ **Backward Compatible**: Tools enabled by default with opt-out flag for traditional usage
23
+
24
+ ```bash
25
+ # NEW: AI can now access your filesystem and execute tools
26
+ npx @juspay/neurolink generate-text "List files in this directory" --provider google-ai
27
+ # Result: AI uses listDirectory tool and returns actual file listing
28
+ ```
29
+
14
30
  ## 🚀 Quick Start
15
31
 
16
32
  ### Install & Run (2 minutes)
@@ -280,12 +280,12 @@ export declare const directAgentTools: {
280
280
  pattern: z.ZodString;
281
281
  recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
282
282
  }, "strip", z.ZodTypeAny, {
283
- pattern: string;
284
283
  directory: string;
284
+ pattern: string;
285
285
  recursive: boolean;
286
286
  }, {
287
- pattern: string;
288
287
  directory: string;
288
+ pattern: string;
289
289
  recursive?: boolean | undefined;
290
290
  }>, {
291
291
  success: boolean;
@@ -315,8 +315,8 @@ export declare const directAgentTools: {
315
315
  count?: undefined;
316
316
  }> & {
317
317
  execute: (args: {
318
- pattern: string;
319
318
  directory: string;
319
+ pattern: string;
320
320
  recursive: boolean;
321
321
  }, options: import("ai").ToolExecutionOptions) => PromiseLike<{
322
322
  success: boolean;
@@ -623,12 +623,12 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
623
623
  pattern: z.ZodString;
624
624
  recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
625
625
  }, "strip", z.ZodTypeAny, {
626
- pattern: string;
627
626
  directory: string;
627
+ pattern: string;
628
628
  recursive: boolean;
629
629
  }, {
630
- pattern: string;
631
630
  directory: string;
631
+ pattern: string;
632
632
  recursive?: boolean | undefined;
633
633
  }>, {
634
634
  success: boolean;
@@ -658,8 +658,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
658
658
  count?: undefined;
659
659
  }> & {
660
660
  execute: (args: {
661
- pattern: string;
662
661
  directory: string;
662
+ pattern: string;
663
663
  recursive: boolean;
664
664
  }, options: import("ai").ToolExecutionOptions) => PromiseLike<{
665
665
  success: boolean;
@@ -967,12 +967,12 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
967
967
  pattern: z.ZodString;
968
968
  recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
969
969
  }, "strip", z.ZodTypeAny, {
970
- pattern: string;
971
970
  directory: string;
971
+ pattern: string;
972
972
  recursive: boolean;
973
973
  }, {
974
- pattern: string;
975
974
  directory: string;
975
+ pattern: string;
976
976
  recursive?: boolean | undefined;
977
977
  }>, {
978
978
  success: boolean;
@@ -1002,8 +1002,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
1002
1002
  count?: undefined;
1003
1003
  }> & {
1004
1004
  execute: (args: {
1005
- pattern: string;
1006
1005
  directory: string;
1006
+ pattern: string;
1007
1007
  recursive: boolean;
1008
1008
  }, options: import("ai").ToolExecutionOptions) => PromiseLike<{
1009
1009
  success: boolean;
@@ -1,2 +1 @@
1
- import type { CommandModule } from "yargs";
2
- export declare const agentGenerateCommand: CommandModule;
1
+ export declare function agentGenerateCommand(cli: any): void;
@@ -1,10 +1,8 @@
1
1
  import { AgentEnhancedProvider } from "../../lib/providers/agent-enhanced-provider.js";
2
2
  import ora from "ora";
3
3
  import chalk from "chalk";
4
- export const agentGenerateCommand = {
5
- command: "agent-generate <prompt>",
6
- describe: "Generate text with agent capabilities (tool calling)",
7
- builder: (yargs) => yargs
4
+ export function agentGenerateCommand(cli) {
5
+ cli.command("agent-generate <prompt>", "Generate text with agent capabilities (tool calling)", (yargs) => yargs
8
6
  .positional("prompt", {
9
7
  describe: "The prompt for the agent",
10
8
  type: "string",
@@ -27,8 +25,7 @@ export const agentGenerateCommand = {
27
25
  type: "string",
28
26
  choices: ["basic", "filesystem", "utility", "all"],
29
27
  default: "all",
30
- }),
31
- handler: async (argv) => {
28
+ }), async (argv) => {
32
29
  const { prompt, provider, model, toolCategory } = argv;
33
30
  const spinner = ora(`Generating response with ${provider} agent...`).start();
34
31
  try {
@@ -66,5 +63,5 @@ export const agentGenerateCommand = {
66
63
  console.error(chalk.red(error));
67
64
  process.exit(1);
68
65
  }
69
- },
70
- };
66
+ });
67
+ }
@@ -258,7 +258,6 @@ declare const ConfigSchema: z.ZodObject<{
258
258
  cacheStrategy?: "file" | "memory" | "redis" | undefined;
259
259
  }>>;
260
260
  }, "strip", z.ZodTypeAny, {
261
- defaultProvider: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto";
262
261
  providers: {
263
262
  bedrock?: {
264
263
  model: string;
@@ -309,6 +308,7 @@ declare const ConfigSchema: z.ZodObject<{
309
308
  apiKey?: string | undefined;
310
309
  } | undefined;
311
310
  };
311
+ defaultProvider: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto";
312
312
  profiles: Record<string, any>;
313
313
  preferences: {
314
314
  temperature: number;
@@ -319,7 +319,6 @@ declare const ConfigSchema: z.ZodObject<{
319
319
  cacheStrategy: "file" | "memory" | "redis";
320
320
  };
321
321
  }, {
322
- defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
323
322
  providers?: {
324
323
  bedrock?: {
325
324
  model?: string | undefined;
@@ -370,6 +369,7 @@ declare const ConfigSchema: z.ZodObject<{
370
369
  apiKey?: string | undefined;
371
370
  } | undefined;
372
371
  } | undefined;
372
+ defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
373
373
  profiles?: Record<string, any> | undefined;
374
374
  preferences?: {
375
375
  temperature?: number | undefined;
@@ -104,7 +104,7 @@ const ConfigSchema = z.object({
104
104
  .object({
105
105
  outputFormat: z.enum(["text", "json", "yaml"]).default("text"),
106
106
  temperature: z.number().min(0).max(2).default(0.7),
107
- maxTokens: z.number().min(1).max(4000).default(500),
107
+ maxTokens: z.number().min(1).max(4000).default(1000),
108
108
  enableLogging: z.boolean().default(false),
109
109
  enableCaching: z.boolean().default(true),
110
110
  cacheStrategy: z.enum(["memory", "file", "redis"]).default("memory"),
@@ -9,10 +9,11 @@ import fs from "fs";
9
9
  import { spawn } from "child_process";
10
10
  import path from "path";
11
11
  import { discoverMCPServers } from "../../lib/mcp/auto-discovery.js";
12
- import { defaultUnifiedRegistry, } from "../../lib/mcp/unified-registry.js";
12
+ import { unifiedRegistry } from "../../lib/mcp/unified-registry.js";
13
13
  import { ContextManager } from "../../lib/mcp/context-manager.js";
14
+ import { MCPOrchestrator } from "../../lib/mcp/orchestrator.js";
14
15
  import { initializeNeuroLinkMCP } from "../../lib/mcp/initialize.js";
15
- import { mcpLogger, setGlobalMCPLogLevel, LogLevel, } from "../../lib/mcp/logging.js";
16
+ import { mcpLogger, setGlobalMCPLogLevel, } from "../../lib/mcp/logging.js";
16
17
  // Default MCP config file location
17
18
  const MCP_CONFIG_FILE = path.join(process.cwd(), ".mcp-config.json");
18
19
  // Load MCP configuration
@@ -426,14 +427,13 @@ function getStatusIcon(status) {
426
427
  export async function mcpExecuteTool(serverName, toolName, toolParams) {
427
428
  // First try unified registry (includes built-in NeuroLink servers)
428
429
  try {
429
- await defaultUnifiedRegistry.initialize();
430
- const contextManager = new ContextManager();
431
- const context = contextManager.createContext({
430
+ await unifiedRegistry.initialize();
431
+ const orchestrator = new MCPOrchestrator();
432
+ const result = await orchestrator.executeTool(toolName, toolParams, {
432
433
  sessionId: `cli-${Date.now()}`,
433
434
  userId: "cli-user",
434
435
  aiProvider: "unified-mcp",
435
- });
436
- const result = await defaultUnifiedRegistry.executeTool(toolName, toolParams, context, {
436
+ }, {
437
437
  preferredSource: "default", // Try built-in servers first
438
438
  fallbackEnabled: true,
439
439
  validateBeforeExecution: true,
@@ -804,18 +804,18 @@ export function addMCPCommands(yargs) {
804
804
  await initializeNeuroLinkMCP();
805
805
  // Initialize unified registry
806
806
  spinner.text = "Initializing unified registry...";
807
- await defaultUnifiedRegistry.initialize();
807
+ await unifiedRegistry.initialize();
808
808
  // Force refresh if requested
809
809
  if (argv.refresh) {
810
810
  spinner.text = "Refreshing auto-discovery...";
811
- await defaultUnifiedRegistry.refreshAutoDiscovery();
811
+ await unifiedRegistry.refresh();
812
812
  }
813
813
  spinner.succeed(chalk.green("Registry initialized!"));
814
814
  // Get servers based on source filter
815
- const servers = defaultUnifiedRegistry.listAllServers();
815
+ const servers = unifiedRegistry.list();
816
816
  const filteredServers = argv.source === "all"
817
817
  ? servers
818
- : servers.filter((s) => s.source.type === argv.source);
818
+ : servers.filter((s) => s.source === argv.source);
819
819
  if (filteredServers.length === 0) {
820
820
  console.log(chalk.yellow(`\n📭 No servers found from source: ${argv.source}`));
821
821
  return;
@@ -828,36 +828,27 @@ export function addMCPCommands(yargs) {
828
828
  console.log(chalk.green(`\n📋 Found ${filteredServers.length} servers:`));
829
829
  console.log(chalk.gray("─".repeat(80)));
830
830
  filteredServers.forEach((server, index) => {
831
- const sourceIcon = getSourceTypeIcon(server.source.type);
832
- const priorityColor = server.source.priority >= 9
833
- ? chalk.green
834
- : server.source.priority >= 7
835
- ? chalk.yellow
836
- : chalk.gray;
837
- console.log(`${chalk.white(`${index + 1}.`)} ${sourceIcon} ${chalk.cyan(server.id)}`);
838
- console.log(` ${chalk.gray("Source:")} ${server.source.type} ${priorityColor(`(priority: ${server.source.priority})`)}`);
839
- console.log(` ${chalk.gray("Status:")} ${getStatusIcon(server.status)} ${server.status}`);
840
- if (server.config) {
841
- console.log(` ${chalk.gray("Command:")} ${server.config.command} ${server.config.args?.join(" ") || ""}`);
831
+ const sourceIcon = getSourceTypeIcon(server.source);
832
+ const priorityColor = chalk.gray; // Default color
833
+ console.log(`${chalk.white(`${index + 1}.`)} ${sourceIcon} ${chalk.cyan(server.metadata.name)}`);
834
+ console.log(` ${chalk.gray("Version:")} ${server.metadata.version}`);
835
+ console.log(` ${chalk.gray("Source:")} ${server.source}`);
836
+ console.log(` ${chalk.gray("Entry:")} ${server.entryPath}`);
837
+ if (server.metadata.description) {
838
+ console.log(` ${chalk.gray("Description:")} ${server.metadata.description}`);
842
839
  }
843
- if (server.source.metadata) {
844
- const metadata = server.source.metadata;
845
- if (metadata.configPath) {
846
- console.log(` ${chalk.gray("Config:")} ${metadata.configPath}`);
847
- }
848
- if (metadata.toolCount) {
849
- console.log(` ${chalk.gray("Tools:")} ${metadata.toolCount}`);
850
- }
840
+ // Add spacing between entries
841
+ if (index < filteredServers.length - 1) {
842
+ console.log();
851
843
  }
852
- console.log();
853
844
  });
854
845
  // Display statistics
855
- const stats = defaultUnifiedRegistry.getStats();
846
+ const stats = await unifiedRegistry.getStats();
856
847
  console.log(chalk.blue("📊 Registry Statistics:"));
857
- console.log(` ${chalk.gray("Manual servers:")} ${stats.manual.servers}`);
858
- console.log(` ${chalk.gray("Auto-discovered:")} ${stats.auto.servers}`);
859
- console.log(` ${chalk.gray("Default registry:")} ${stats.default.servers}`);
860
- console.log(` ${chalk.gray("Total tools:")} ${stats.total.tools}`);
848
+ console.log(` ${chalk.gray("Total plugins:")} ${stats.total}`);
849
+ console.log(` ${chalk.gray("Manual servers:")} ${stats.manual?.servers || 0}`);
850
+ console.log(` ${chalk.gray("Auto-discovered:")} ${stats.auto?.servers || 0}`);
851
+ console.log(` ${chalk.gray("Total tools:")} ${stats.tools || 0}`);
861
852
  }
862
853
  catch (error) {
863
854
  spinner.fail(chalk.red("Registry initialization failed"));
@@ -895,7 +886,7 @@ export function addMCPCommands(yargs) {
895
886
  await initializeNeuroLinkMCP();
896
887
  // Initialize unified registry
897
888
  spinner.text = "Initializing unified registry...";
898
- await defaultUnifiedRegistry.initialize();
889
+ await unifiedRegistry.initialize();
899
890
  let params = {};
900
891
  if (argv.params) {
901
892
  try {
@@ -920,7 +911,11 @@ export function addMCPCommands(yargs) {
920
911
  timeoutMs: 30000,
921
912
  };
922
913
  spinner.text = "Executing tool...";
923
- const result = await defaultUnifiedRegistry.executeTool(argv.tool, params, context, executionOptions);
914
+ const orchestrator = new MCPOrchestrator();
915
+ const result = await orchestrator.executeTool(argv.tool, params, {
916
+ sessionId: `cli-${Date.now()}`,
917
+ userId: "cli-user",
918
+ }, executionOptions);
924
919
  if (result.success) {
925
920
  spinner.succeed(chalk.green("✅ Tool executed successfully!"));
926
921
  console.log(chalk.blue("\n📋 Result:"));
@@ -955,11 +950,19 @@ export function addMCPCommands(yargs) {
955
950
  .usage("Usage: $0 mcp config <action> [options]")
956
951
  .command("show", "Show current configuration", {}, async () => {
957
952
  try {
958
- await defaultUnifiedRegistry.initialize();
959
- const config = defaultUnifiedRegistry.getConfig();
953
+ await unifiedRegistry.initialize();
960
954
  console.log(chalk.blue("🔧 Unified Registry Configuration"));
961
955
  console.log(chalk.gray("================================"));
962
- console.log(JSON.stringify(config, null, 2));
956
+ const stats = await unifiedRegistry.getStats();
957
+ console.log(`Total servers: ${stats.total}`);
958
+ console.log("\nBy Source:");
959
+ Object.entries(stats.bySource).forEach(([source, count]) => {
960
+ console.log(` ${source}: ${count}`);
961
+ });
962
+ console.log("\nBy Type:");
963
+ Object.entries(stats.byType).forEach(([type, count]) => {
964
+ console.log(` ${type}: ${count}`);
965
+ });
963
966
  }
964
967
  catch (error) {
965
968
  console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));
@@ -968,10 +971,8 @@ export function addMCPCommands(yargs) {
968
971
  })
969
972
  .command("enable-auto-discovery", "Enable auto-discovery", {}, async () => {
970
973
  try {
971
- await defaultUnifiedRegistry.initialize();
972
- defaultUnifiedRegistry.updateAutoDiscoveryConfig({
973
- enabled: true,
974
- });
974
+ await unifiedRegistry.initialize();
975
+ unifiedRegistry.setAutoDiscovery(true);
975
976
  console.log(chalk.green("✅ Auto-discovery enabled"));
976
977
  }
977
978
  catch (error) {
@@ -981,10 +982,8 @@ export function addMCPCommands(yargs) {
981
982
  })
982
983
  .command("disable-auto-discovery", "Disable auto-discovery", {}, async () => {
983
984
  try {
984
- await defaultUnifiedRegistry.initialize();
985
- defaultUnifiedRegistry.updateAutoDiscoveryConfig({
986
- enabled: false,
987
- });
985
+ await unifiedRegistry.initialize();
986
+ unifiedRegistry.setAutoDiscovery(false);
988
987
  console.log(chalk.green("✅ Auto-discovery disabled"));
989
988
  }
990
989
  catch (error) {
@@ -998,14 +997,13 @@ export function addMCPCommands(yargs) {
998
997
  demandOption: true,
999
998
  }), async (argv) => {
1000
999
  try {
1001
- await defaultUnifiedRegistry.initialize();
1000
+ await unifiedRegistry.initialize();
1002
1001
  const sources = argv.sources
1003
1002
  .split(",")
1004
1003
  .map((s) => s.trim());
1005
- defaultUnifiedRegistry.updateAutoDiscoveryConfig({
1006
- sources,
1007
- });
1008
- console.log(chalk.green(`✅ Updated preferred sources: ${sources.join(", ")}`));
1004
+ // Note: Source preference configuration not yet implemented
1005
+ console.log(chalk.yellow(`⚠️ Source preference configuration not yet implemented`));
1006
+ console.log(chalk.blue(` Requested sources: ${sources.join(", ")}`));
1009
1007
  }
1010
1008
  catch (error) {
1011
1009
  console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));
@@ -1020,15 +1018,17 @@ export function addMCPCommands(yargs) {
1020
1018
  }), async (argv) => {
1021
1019
  try {
1022
1020
  const level = argv.level;
1021
+ // Note: LogLevel is a type, not an enum
1022
+ // 'silent' is not a valid LogLevel, default to 'error' for minimal output
1023
1023
  const logLevel = level === "silent"
1024
- ? LogLevel.SILENT
1024
+ ? "error" // Use 'error' for minimal output
1025
1025
  : level === "error"
1026
- ? LogLevel.ERROR
1026
+ ? "error"
1027
1027
  : level === "warn"
1028
- ? LogLevel.WARN
1028
+ ? "warn"
1029
1029
  : level === "info"
1030
- ? LogLevel.INFO
1031
- : LogLevel.DEBUG;
1030
+ ? "info"
1031
+ : "debug";
1032
1032
  setGlobalMCPLogLevel(logLevel);
1033
1033
  console.log(chalk.green(`✅ MCP log level set to: ${level}`));
1034
1034
  console.log(chalk.gray("This affects auto-discovery, registry operations, and tool execution logging"));
@@ -1075,33 +1075,26 @@ export function addMCPCommands(yargs) {
1075
1075
  console.log(chalk.blue("🔍 NeuroLink MCP Server Discovery"));
1076
1076
  console.log(chalk.gray("====================================="));
1077
1077
  const options = {
1078
- searchGlobal: !argv["workspace-only"],
1079
- searchWorkspace: !argv["global-only"],
1080
- searchCommonPaths: true,
1081
- includeInactive: argv["include-inactive"],
1082
- preferredTools: argv["preferred-tools"]
1083
- ? argv["preferred-tools"]
1084
- .split(",")
1085
- .map((t) => t.trim())
1086
- : [],
1078
+ includeDevPlugins: argv["include-inactive"],
1079
+ // Additional search paths if needed
1080
+ searchPaths: [
1081
+ "./src/lib/mcp/plugins",
1082
+ "./neurolink-mcp",
1083
+ "./node_modules",
1084
+ ],
1087
1085
  };
1088
1086
  const spinner = ora("Discovering MCP servers...").start();
1089
1087
  try {
1090
1088
  mcpLogger.debug("[MCP Discovery] Starting server discovery:", {
1091
- searchGlobal: options.searchGlobal,
1092
- searchWorkspace: options.searchWorkspace,
1093
- includeInactive: options.includeInactive,
1094
- preferredTools: options.preferredTools,
1089
+ includeDevPlugins: options.includeDevPlugins,
1090
+ searchPaths: options.searchPaths,
1095
1091
  });
1096
- const discoveryResult = await discoverMCPServers(options);
1092
+ const discoveredPlugins = await discoverMCPServers(options);
1097
1093
  mcpLogger.info("[MCP Discovery] Discovery completed:", {
1098
- serversFound: discoveryResult.discovered.length,
1099
- executionTime: discoveryResult.stats.executionTime,
1100
- configFilesFound: discoveryResult.stats.configFilesFound,
1101
- duplicatesRemoved: discoveryResult.stats.duplicatesRemoved,
1094
+ pluginsFound: discoveredPlugins.length,
1102
1095
  });
1103
1096
  spinner.succeed(chalk.green("Discovery completed!"));
1104
- if (discoveryResult.discovered.length === 0) {
1097
+ if (discoveredPlugins.length === 0) {
1105
1098
  console.log(chalk.yellow("\n📭 No MCP servers found"));
1106
1099
  console.log(chalk.gray("\n💡 Tips for finding MCP servers:"));
1107
1100
  console.log(chalk.gray(" • Make sure you have Claude Desktop, VS Code, or Cursor with MCP configurations"));
@@ -1111,37 +1104,35 @@ export function addMCPCommands(yargs) {
1111
1104
  }
1112
1105
  // Display results based on format
1113
1106
  if (argv.format === "json") {
1114
- console.log(JSON.stringify(discoveryResult, null, 2));
1107
+ console.log(JSON.stringify(discoveredPlugins, null, 2));
1115
1108
  return;
1116
1109
  }
1117
1110
  if (argv.format === "yaml") {
1118
1111
  // Simple YAML output
1119
1112
  console.log("discovered:");
1120
- discoveryResult.discovered.forEach((server) => {
1121
- console.log(` - id: ${server.id}`);
1122
- console.log(` title: ${server.title}`);
1123
- console.log(` source: ${server.source.tool}`);
1124
- console.log(` command: ${server.command}`);
1125
- if (server.args && server.args.length > 0) {
1126
- console.log(" args:");
1127
- server.args.forEach((arg) => console.log(` - ${arg}`));
1113
+ discoveredPlugins.forEach((plugin) => {
1114
+ console.log(` - name: ${plugin.metadata.name}`);
1115
+ console.log(` version: ${plugin.metadata.version}`);
1116
+ console.log(` source: ${plugin.source}`);
1117
+ console.log(` entryPath: ${plugin.entryPath}`);
1118
+ if (plugin.metadata.description) {
1119
+ console.log(` description: ${plugin.metadata.description}`);
1128
1120
  }
1129
1121
  });
1130
1122
  return;
1131
1123
  }
1132
- if (argv.format === "summary") {
1133
- displaySummary(discoveryResult);
1134
- return;
1135
- }
1136
- // Table format (default)
1137
- displayTable(discoveryResult);
1138
- // Display errors if any
1139
- if (discoveryResult.errors.length > 0) {
1140
- console.log(chalk.yellow("\n⚠️ Discovery warnings:"));
1141
- discoveryResult.errors.forEach((error) => {
1142
- console.log(chalk.yellow(` • ${error}`));
1143
- });
1144
- }
1124
+ // Default format - show simple list
1125
+ console.log(chalk.green(`\n📋 Found ${discoveredPlugins.length} MCP plugins:`));
1126
+ console.log(chalk.gray("─".repeat(80)));
1127
+ discoveredPlugins.forEach((plugin, index) => {
1128
+ console.log(`${chalk.white(`${index + 1}.`)} ${chalk.cyan(plugin.metadata.name)} v${plugin.metadata.version}`);
1129
+ console.log(` ${chalk.gray("Source:")} ${plugin.source}`);
1130
+ console.log(` ${chalk.gray("Entry:")} ${plugin.entryPath}`);
1131
+ if (plugin.metadata.description) {
1132
+ console.log(` ${chalk.gray("Description:")} ${plugin.metadata.description}`);
1133
+ }
1134
+ console.log();
1135
+ });
1145
1136
  }
1146
1137
  catch (error) {
1147
1138
  mcpLogger.error("[MCP Discovery] Discovery failed:", {
@@ -1,8 +1,3 @@
1
1
  import type { Argv } from "yargs";
2
- export declare const ollamaCommand: {
3
- command: string;
4
- describe: string;
5
- builder: (yargs: Argv) => Argv<{}>;
6
- handler: () => void;
7
- };
8
- export default ollamaCommand;
2
+ export declare function addOllamaCommands(cli: Argv): void;
3
+ export default addOllamaCommands;