@juspay/neurolink 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -33
- package/README.md +16 -0
- package/dist/agent/direct-tools.d.ts +9 -9
- package/dist/cli/commands/agent-generate.d.ts +1 -2
- package/dist/cli/commands/agent-generate.js +5 -8
- package/dist/cli/commands/config.d.ts +2 -2
- package/dist/cli/commands/config.js +1 -1
- package/dist/cli/commands/mcp.js +91 -100
- package/dist/cli/commands/ollama.d.ts +2 -7
- package/dist/cli/commands/ollama.js +5 -8
- package/dist/cli/index.js +185 -276
- package/dist/core/factory.js +9 -10
- package/dist/index.d.ts +23 -0
- package/dist/index.js +35 -0
- package/dist/lib/agent/direct-tools.d.ts +9 -9
- package/dist/lib/core/factory.js +9 -10
- package/dist/lib/index.d.ts +23 -0
- package/dist/lib/index.js +35 -0
- package/dist/lib/mcp/adapters/plugin-bridge.d.ts +39 -0
- package/dist/lib/mcp/adapters/plugin-bridge.js +82 -0
- package/dist/lib/mcp/auto-discovery.d.ts +38 -96
- package/dist/lib/mcp/auto-discovery.js +100 -744
- package/dist/lib/mcp/client.js +4 -4
- package/dist/lib/mcp/context-manager.js +72 -1
- package/dist/lib/mcp/contracts/mcp-contract.d.ts +162 -0
- package/dist/lib/mcp/contracts/mcp-contract.js +58 -0
- package/dist/lib/mcp/core/plugin-manager.d.ts +45 -0
- package/dist/lib/mcp/core/plugin-manager.js +110 -0
- package/dist/lib/mcp/demo/plugin-demo.d.ts +20 -0
- package/dist/lib/mcp/demo/plugin-demo.js +116 -0
- package/dist/lib/mcp/ecosystem.d.ts +75 -0
- package/dist/lib/mcp/ecosystem.js +161 -0
- package/dist/lib/mcp/external-client.d.ts +88 -0
- package/dist/lib/mcp/external-client.js +323 -0
- package/dist/lib/mcp/external-manager.d.ts +112 -0
- package/dist/lib/mcp/external-manager.js +302 -0
- package/dist/lib/mcp/factory.d.ts +4 -4
- package/dist/lib/mcp/function-calling.js +59 -34
- package/dist/lib/mcp/index.d.ts +39 -184
- package/dist/lib/mcp/index.js +72 -150
- package/dist/lib/mcp/initialize.js +5 -5
- package/dist/lib/mcp/logging.d.ts +27 -60
- package/dist/lib/mcp/logging.js +77 -165
- package/dist/lib/mcp/neurolink-mcp-client.js +31 -3
- package/dist/lib/mcp/orchestrator.d.ts +1 -1
- package/dist/lib/mcp/orchestrator.js +13 -12
- package/dist/lib/mcp/plugin-manager.d.ts +98 -0
- package/dist/lib/mcp/plugin-manager.js +294 -0
- package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
- package/dist/lib/mcp/plugins/core/filesystem-mcp.js +139 -0
- package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +36 -0
- package/dist/lib/mcp/plugins/filesystem-mcp.js +54 -0
- package/dist/lib/mcp/registry.d.ts +27 -176
- package/dist/lib/mcp/registry.js +31 -372
- package/dist/lib/mcp/security-manager.d.ts +85 -0
- package/dist/lib/mcp/security-manager.js +344 -0
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/lib/mcp/tool-integration.d.ts +4 -14
- package/dist/lib/mcp/tool-integration.js +43 -21
- package/dist/lib/mcp/tool-registry.d.ts +66 -0
- package/dist/lib/mcp/tool-registry.js +160 -0
- package/dist/lib/mcp/unified-mcp.d.ts +123 -0
- package/dist/lib/mcp/unified-mcp.js +246 -0
- package/dist/lib/mcp/unified-registry.d.ts +42 -229
- package/dist/lib/mcp/unified-registry.js +96 -1346
- package/dist/lib/neurolink.d.ts +3 -4
- package/dist/lib/neurolink.js +17 -18
- package/dist/lib/providers/agent-enhanced-provider.js +2 -2
- package/dist/lib/providers/amazonBedrock.js +2 -2
- package/dist/lib/providers/anthropic.js +3 -3
- package/dist/lib/providers/azureOpenAI.js +3 -3
- package/dist/lib/providers/function-calling-provider.js +34 -25
- package/dist/lib/providers/googleAIStudio.js +3 -3
- package/dist/lib/providers/googleVertexAI.js +2 -2
- package/dist/lib/providers/huggingFace.js +2 -2
- package/dist/lib/providers/mcp-provider.js +33 -5
- package/dist/lib/providers/mistralAI.js +2 -2
- package/dist/lib/providers/ollama.js +2 -2
- package/dist/lib/providers/openAI.js +2 -2
- package/dist/lib/utils/providerUtils-fixed.js +9 -9
- package/dist/mcp/adapters/plugin-bridge.d.ts +39 -0
- package/dist/mcp/adapters/plugin-bridge.js +82 -0
- package/dist/mcp/auto-discovery.d.ts +38 -96
- package/dist/mcp/auto-discovery.js +100 -745
- package/dist/mcp/client.js +4 -4
- package/dist/mcp/context-manager.js +72 -1
- package/dist/mcp/contracts/mcp-contract.d.ts +162 -0
- package/dist/mcp/contracts/mcp-contract.js +58 -0
- package/dist/mcp/core/plugin-manager.d.ts +45 -0
- package/dist/mcp/core/plugin-manager.js +110 -0
- package/dist/mcp/demo/plugin-demo.d.ts +20 -0
- package/dist/mcp/demo/plugin-demo.js +116 -0
- package/dist/mcp/ecosystem.d.ts +75 -0
- package/dist/mcp/ecosystem.js +162 -0
- package/dist/mcp/external-client.d.ts +88 -0
- package/dist/mcp/external-client.js +323 -0
- package/dist/mcp/external-manager.d.ts +112 -0
- package/dist/mcp/external-manager.js +302 -0
- package/dist/mcp/factory.d.ts +4 -4
- package/dist/mcp/function-calling.js +59 -34
- package/dist/mcp/index.d.ts +39 -184
- package/dist/mcp/index.js +72 -150
- package/dist/mcp/initialize.js +5 -5
- package/dist/mcp/logging.d.ts +27 -60
- package/dist/mcp/logging.js +77 -165
- package/dist/mcp/neurolink-mcp-client.js +31 -3
- package/dist/mcp/orchestrator.d.ts +1 -1
- package/dist/mcp/orchestrator.js +13 -12
- package/dist/mcp/plugin-manager.d.ts +98 -0
- package/dist/mcp/plugin-manager.js +295 -0
- package/dist/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
- package/dist/mcp/plugins/core/filesystem-mcp.js +139 -0
- package/dist/mcp/plugins/core/neurolink-mcp.json +17 -0
- package/dist/mcp/plugins/filesystem-mcp.d.ts +36 -0
- package/dist/mcp/plugins/filesystem-mcp.js +54 -0
- package/dist/mcp/registry.d.ts +27 -176
- package/dist/mcp/registry.js +31 -372
- package/dist/mcp/security-manager.d.ts +85 -0
- package/dist/mcp/security-manager.js +344 -0
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/mcp/tool-integration.d.ts +4 -14
- package/dist/mcp/tool-integration.js +43 -21
- package/dist/mcp/tool-registry.d.ts +66 -0
- package/dist/mcp/tool-registry.js +160 -0
- package/dist/mcp/unified-mcp.d.ts +123 -0
- package/dist/mcp/unified-mcp.js +246 -0
- package/dist/mcp/unified-registry.d.ts +42 -229
- package/dist/mcp/unified-registry.js +96 -1345
- package/dist/neurolink.d.ts +3 -4
- package/dist/neurolink.js +17 -18
- package/dist/providers/agent-enhanced-provider.js +2 -2
- package/dist/providers/amazonBedrock.js +2 -2
- package/dist/providers/anthropic.js +3 -3
- package/dist/providers/azureOpenAI.js +3 -3
- package/dist/providers/function-calling-provider.js +34 -25
- package/dist/providers/googleAIStudio.js +3 -3
- package/dist/providers/googleVertexAI.js +2 -2
- package/dist/providers/huggingFace.js +2 -2
- package/dist/providers/mcp-provider.js +33 -5
- package/dist/providers/mistralAI.js +2 -2
- package/dist/providers/ollama.js +2 -2
- package/dist/providers/openAI.js +2 -2
- package/dist/utils/providerUtils-fixed.js +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,62 @@
|
|
|
1
|
-
# [1.
|
|
1
|
+
# [1.11.0](https://github.com/juspay/neurolink/compare/v1.10.0...v1.11.0) (2025-06-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* finalize MCP ecosystem and resolve all TypeScript errors ([605d8b2](https://github.com/juspay/neurolink/commit/605d8b2ea10c824077e1379ac47a0c065f0a8095))
|
|
7
7
|
|
|
8
|
-
# 1.9.0 (2025-06-
|
|
8
|
+
# [1.10.0](https://github.com/juspay/neurolink/compare/v1.9.0...v1.10.0) (2025-06-21)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
9
11
|
|
|
12
|
+
- **cli:** improve provider status accuracy and error handling ([523e845](https://github.com/juspay/neurolink/commit/523e84566fee5d9afa3638186f90c628e20e4894))
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
# 1.9.0 (2025-06-20)
|
|
12
15
|
|
|
16
|
+
- 🎉 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
17
|
|
|
14
18
|
### Bug Fixes
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
- **cli:** prevent debug log persistence in production deployments ([#14](https://github.com/juspay/neurolink/issues/14)) ([7310a4c](https://github.com/juspay/neurolink/commit/7310a4cb405e1f35bcc5b22559f3da87a1d793f4))
|
|
21
|
+
- 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
22
|
|
|
20
23
|
### Features
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
- 🚀 MCP automatic tool discovery + dynamic models + AI function calling ([781b4e5](https://github.com/juspay/neurolink/commit/781b4e5c6e4886acb44a986f7b204eff346427e1))
|
|
26
|
+
- add Google AI Studio integration and restructure documentation ([#11](https://github.com/juspay/neurolink/issues/11)) ([346fed2](https://github.com/juspay/neurolink/commit/346fed2ad458da07b80158f084afed8f3b804f06))
|
|
27
|
+
- 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))
|
|
28
|
+
- 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))
|
|
29
|
+
- 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
30
|
|
|
29
31
|
### BREAKING CHANGES
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
- Enhanced provider architecture with MCP integration
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
* ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
|
|
36
|
+
* 🎯 AI function calling - seamless tool execution with Vercel AI SDK
|
|
37
|
+
* 🔧 Dynamic model configuration via config/models.json
|
|
38
|
+
* 🤖 Agent-based generation with automatic tool selection
|
|
39
|
+
* 📡 Real-time MCP server management and monitoring
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
* Added MCPEnhancedProvider for automatic tool integration
|
|
42
|
+
* Implemented function calling for Google AI, OpenAI providers
|
|
43
|
+
* Created unified tool registry for MCP and built-in tools
|
|
44
|
+
* Enhanced CLI with `agent-generate` and MCP management commands
|
|
45
|
+
* Added comprehensive examples and documentation
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* Automatic .mcp-config.json discovery across platforms
|
|
48
|
+
* Session-based context management for tool execution
|
|
49
|
+
* Graceful fallback when MCP servers unavailable
|
|
50
|
+
* Performance optimized tool discovery (<1ms per tool)
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
* Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
|
|
53
|
+
* Created practical examples for all integration patterns
|
|
54
|
+
* Updated API reference with new capabilities
|
|
55
|
+
* Enhanced memory bank with implementation details
|
|
54
56
|
|
|
55
57
|
Resolves: Enhanced AI capabilities with real-world tool integration
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
- None - 100% backward compatibility maintained
|
|
57
60
|
|
|
58
61
|
Closes: Enhanced multi-provider support milestone
|
|
59
62
|
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
|
-
|
|
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
|
|
5
|
-
command
|
|
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(
|
|
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"),
|
package/dist/cli/commands/mcp.js
CHANGED
|
@@ -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 {
|
|
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,
|
|
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
|
|
430
|
-
const
|
|
431
|
-
const
|
|
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
|
|
807
|
+
await unifiedRegistry.initialize();
|
|
808
808
|
// Force refresh if requested
|
|
809
809
|
if (argv.refresh) {
|
|
810
810
|
spinner.text = "Refreshing auto-discovery...";
|
|
811
|
-
await
|
|
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 =
|
|
815
|
+
const servers = unifiedRegistry.list();
|
|
816
816
|
const filteredServers = argv.source === "all"
|
|
817
817
|
? servers
|
|
818
|
-
: servers.filter((s) => s.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
|
|
832
|
-
const priorityColor =
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
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
|
-
|
|
844
|
-
|
|
845
|
-
|
|
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 =
|
|
846
|
+
const stats = await unifiedRegistry.getStats();
|
|
856
847
|
console.log(chalk.blue("📊 Registry Statistics:"));
|
|
857
|
-
console.log(` ${chalk.gray("
|
|
858
|
-
console.log(` ${chalk.gray("
|
|
859
|
-
console.log(` ${chalk.gray("
|
|
860
|
-
console.log(` ${chalk.gray("Total tools:")} ${stats.
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
972
|
-
|
|
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
|
|
985
|
-
|
|
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
|
|
1000
|
+
await unifiedRegistry.initialize();
|
|
1002
1001
|
const sources = argv.sources
|
|
1003
1002
|
.split(",")
|
|
1004
1003
|
.map((s) => s.trim());
|
|
1005
|
-
|
|
1006
|
-
|
|
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
|
-
?
|
|
1024
|
+
? "error" // Use 'error' for minimal output
|
|
1025
1025
|
: level === "error"
|
|
1026
|
-
?
|
|
1026
|
+
? "error"
|
|
1027
1027
|
: level === "warn"
|
|
1028
|
-
?
|
|
1028
|
+
? "warn"
|
|
1029
1029
|
: level === "info"
|
|
1030
|
-
?
|
|
1031
|
-
:
|
|
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
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
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
|
-
|
|
1092
|
-
|
|
1093
|
-
includeInactive: options.includeInactive,
|
|
1094
|
-
preferredTools: options.preferredTools,
|
|
1089
|
+
includeDevPlugins: options.includeDevPlugins,
|
|
1090
|
+
searchPaths: options.searchPaths,
|
|
1095
1091
|
});
|
|
1096
|
-
const
|
|
1092
|
+
const discoveredPlugins = await discoverMCPServers(options);
|
|
1097
1093
|
mcpLogger.info("[MCP Discovery] Discovery completed:", {
|
|
1098
|
-
|
|
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 (
|
|
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(
|
|
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
|
-
|
|
1121
|
-
console.log(` -
|
|
1122
|
-
console.log(`
|
|
1123
|
-
console.log(` source: ${
|
|
1124
|
-
console.log(`
|
|
1125
|
-
if (
|
|
1126
|
-
console.log(
|
|
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
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
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
|
|
3
|
-
|
|
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;
|