@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.
Files changed (144) hide show
  1. package/CHANGELOG.md +36 -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 +3 -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 +3 -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
@@ -1,190 +1,45 @@
1
1
  /**
2
- * NeuroLink MCP (Model Context Protocol) Module
3
- *
4
- * This module exports the MCP configuration and initialization utilities
5
- * for use throughout the application, following Lighthouse's patterns.
2
+ * MCP Ecosystem - Main Export
3
+ * Universal AI Development Platform with Extensible Plugin Architecture
4
+ * Implementation based on research blueprint
6
5
  */
7
- import { getMCPManager, removeMCPManager } from "./manager.js";
8
- import { createMCPServer } from "./factory.js";
9
- import type { NeuroLinkMCPServer } from "./factory.js";
10
- export { createMCPServer } from "./factory.js";
11
- export { mcpConfig } from "./config.js";
12
- export { getMCPManager, removeMCPManager, MCPManager } from "./manager.js";
13
- export { createMCPClient } from "./client.js";
14
- export { initializeMCPTools, getAllAvailableTools, initializeServerTools, } from "./initialize-tools.js";
15
- export type { NeuroLinkMCPServer, NeuroLinkMCPTool, NeuroLinkExecutionContext, ToolResult, MCPServerCategory, MCPServerConfig, } from "./factory.js";
16
- export type { MCPClientConfig } from "./client.js";
6
+ export { MCP } from "./contracts/mcp-contract.js";
7
+ export type { MCPMetadata, ExecutionContext, MCPConstructor, MCPInstance, DiscoveredMCP, } from "./contracts/mcp-contract.js";
8
+ export { MCPEcosystem, mcpEcosystem } from "./ecosystem.js";
9
+ export { PluginManager, pluginManager } from "./plugin-manager.js";
10
+ export { SecurityManager } from "./security-manager.js";
11
+ export { mcpLogger } from "./logging.js";
12
+ export type { LogLevel } from "./logging.js";
13
+ export { FileSystemMCP } from "./plugins/core/filesystem-mcp.js";
14
+ import type { MCPMetadata } from "./contracts/mcp-contract.js";
17
15
  /**
18
- * MCP utilities for system-wide operations
16
+ * Initialize the MCP ecosystem
19
17
  */
20
- export declare const MCPUtils: {
21
- /**
22
- * Get a formatted list of all available tools across all registered MCP servers
23
- * Useful for documentation or configuration UI
24
- */
25
- getAvailableTools: () => Promise<{
26
- serverId: string;
27
- serverTitle: string;
28
- serverDescription: string | undefined;
29
- category: import("./factory.js").MCPServerCategory | undefined;
30
- toolCount: number;
31
- tools: {
32
- name: string;
33
- description: string;
34
- isImplemented: boolean;
35
- }[];
36
- }[]>;
37
- /**
38
- * Function to test connectivity with MCP servers
39
- * Returns diagnostics about the MCP server initialization status
40
- */
41
- testConnectivity: () => Promise<{
42
- status: string;
43
- message: string;
44
- servers: {
45
- serverId: string;
46
- serverTitle: string;
47
- status: string;
48
- toolCount: number;
49
- implementedTools: number;
50
- }[];
51
- timestamp: string;
52
- } | {
53
- status: string;
54
- message: string;
55
- timestamp: string;
56
- servers?: undefined;
57
- }>;
58
- /**
59
- * Get statistics about MCP usage
60
- */
61
- getStatistics: () => Promise<{
62
- servers: {
63
- total: number;
64
- byCategory: Record<string, number>;
65
- };
66
- tools: {
67
- totalTools: number;
68
- implementedTools: number;
69
- byCategory: Record<string, number>;
70
- };
71
- sessions: {
72
- instanceCount: number;
73
- maxInstances: number;
74
- instances: Record<string, any>;
75
- };
76
- }>;
77
- /**
78
- * Initialize MCP for a session
79
- * Convenience method that sets up everything needed for a session
80
- */
81
- initializeSession: (sessionId: string, config?: {
82
- userId?: string;
83
- aiProvider?: string;
84
- modelId?: string;
85
- }) => Promise<{
86
- sessionId: string;
87
- client: import("./client.js").NeuroLinkMCPClient;
88
- context: import("./factory.js").NeuroLinkExecutionContext;
89
- toolCount: number;
90
- }>;
91
- /**
92
- * Clean up a session
93
- */
94
- cleanupSession: (sessionId: string) => Promise<boolean>;
95
- };
18
+ export declare function initializeMCPEcosystem(): Promise<void>;
96
19
  /**
97
- * Default export for convenience
20
+ * List available MCPs
98
21
  */
99
- declare const _default: {
100
- config: {
101
- getServers: () => Promise<NeuroLinkMCPServer[]>;
102
- getAllTools: () => Promise<{
103
- name: string;
104
- description: string;
105
- serverId: string;
106
- serverTitle: string;
107
- category?: string;
108
- }[]>;
109
- };
110
- utils: {
111
- /**
112
- * Get a formatted list of all available tools across all registered MCP servers
113
- * Useful for documentation or configuration UI
114
- */
115
- getAvailableTools: () => Promise<{
116
- serverId: string;
117
- serverTitle: string;
118
- serverDescription: string | undefined;
119
- category: import("./factory.js").MCPServerCategory | undefined;
120
- toolCount: number;
121
- tools: {
122
- name: string;
123
- description: string;
124
- isImplemented: boolean;
125
- }[];
126
- }[]>;
127
- /**
128
- * Function to test connectivity with MCP servers
129
- * Returns diagnostics about the MCP server initialization status
130
- */
131
- testConnectivity: () => Promise<{
132
- status: string;
133
- message: string;
134
- servers: {
135
- serverId: string;
136
- serverTitle: string;
137
- status: string;
138
- toolCount: number;
139
- implementedTools: number;
140
- }[];
141
- timestamp: string;
142
- } | {
143
- status: string;
144
- message: string;
145
- timestamp: string;
146
- servers?: undefined;
147
- }>;
148
- /**
149
- * Get statistics about MCP usage
150
- */
151
- getStatistics: () => Promise<{
152
- servers: {
153
- total: number;
154
- byCategory: Record<string, number>;
155
- };
156
- tools: {
157
- totalTools: number;
158
- implementedTools: number;
159
- byCategory: Record<string, number>;
160
- };
161
- sessions: {
162
- instanceCount: number;
163
- maxInstances: number;
164
- instances: Record<string, any>;
165
- };
166
- }>;
167
- /**
168
- * Initialize MCP for a session
169
- * Convenience method that sets up everything needed for a session
170
- */
171
- initializeSession: (sessionId: string, config?: {
172
- userId?: string;
173
- aiProvider?: string;
174
- modelId?: string;
175
- }) => Promise<{
176
- sessionId: string;
177
- client: import("./client.js").NeuroLinkMCPClient;
178
- context: import("./factory.js").NeuroLinkExecutionContext;
179
- toolCount: number;
180
- }>;
181
- /**
182
- * Clean up a session
183
- */
184
- cleanupSession: (sessionId: string) => Promise<boolean>;
185
- };
186
- createServer: typeof createMCPServer;
187
- getManager: typeof getMCPManager;
188
- removeManager: typeof removeMCPManager;
189
- };
190
- export default _default;
22
+ export declare function listMCPs(): Promise<MCPMetadata[]>;
23
+ /**
24
+ * Execute an MCP operation
25
+ */
26
+ export declare function executeMCP<T = any>(name: string, config: any, args: any, context?: {
27
+ sessionId?: string;
28
+ userId?: string;
29
+ }): Promise<T>;
30
+ /**
31
+ * Quick filesystem operations
32
+ */
33
+ export declare function readFile(path: string, basePath?: string): Promise<any>;
34
+ export declare function writeFile(path: string, content: string, basePath?: string): Promise<any>;
35
+ export declare function listFiles(path: string, basePath?: string): Promise<any>;
36
+ export declare function createDirectory(path: string, basePath?: string): Promise<any>;
37
+ /**
38
+ * Get MCP ecosystem statistics
39
+ */
40
+ export declare function getMCPStats(): Promise<{
41
+ initialized: boolean;
42
+ pluginsDiscovered: number;
43
+ pluginsBySource: Record<string, number>;
44
+ availablePlugins: string[];
45
+ }>;
@@ -1,156 +1,78 @@
1
1
  /**
2
- * NeuroLink MCP (Model Context Protocol) Module
3
- *
4
- * This module exports the MCP configuration and initialization utilities
5
- * for use throughout the application, following Lighthouse's patterns.
2
+ * MCP Ecosystem - Main Export
3
+ * Universal AI Development Platform with Extensible Plugin Architecture
4
+ * Implementation based on research blueprint
6
5
  */
7
- import { mcpConfig } from "./config.js";
8
- import { getMCPManager, removeMCPManager, MCPManager } from "./manager.js";
9
- import { initializeMCPTools, } from "./initialize-tools.js";
10
- import { createMCPServer } from "./factory.js";
11
- import { logger } from "../utils/logger.js";
12
- // Re-export core components
13
- export { createMCPServer } from "./factory.js";
14
- export { mcpConfig } from "./config.js";
15
- export { getMCPManager, removeMCPManager, MCPManager } from "./manager.js";
16
- export { createMCPClient } from "./client.js";
17
- export { initializeMCPTools, getAllAvailableTools, initializeServerTools, } from "./initialize-tools.js";
6
+ // Core contracts and types
7
+ export { MCP } from "./contracts/mcp-contract.js";
8
+ // Main ecosystem interface
9
+ export { MCPEcosystem, mcpEcosystem } from "./ecosystem.js";
10
+ // Plugin management
11
+ export { PluginManager, pluginManager } from "./plugin-manager.js";
12
+ // Security
13
+ export { SecurityManager } from "./security-manager.js";
14
+ // Logging
15
+ export { mcpLogger } from "./logging.js";
16
+ // Core plugins
17
+ export { FileSystemMCP } from "./plugins/core/filesystem-mcp.js";
18
18
  /**
19
- * MCP utilities for system-wide operations
19
+ * Quick access functions for common MCP operations
20
20
  */
21
- export const MCPUtils = {
22
- /**
23
- * Get a formatted list of all available tools across all registered MCP servers
24
- * Useful for documentation or configuration UI
25
- */
26
- getAvailableTools: async () => {
27
- const servers = await mcpConfig.getServers();
28
- return servers.map((server) => ({
29
- serverId: server.id,
30
- serverTitle: server.title,
31
- serverDescription: server.description,
32
- category: server.category,
33
- toolCount: Object.keys(server.tools).length,
34
- tools: Object.entries(server.tools).map(([name, tool]) => ({
35
- name,
36
- description: tool.description,
37
- isImplemented: tool.isImplemented !== false,
38
- })),
39
- }));
40
- },
41
- /**
42
- * Function to test connectivity with MCP servers
43
- * Returns diagnostics about the MCP server initialization status
44
- */
45
- testConnectivity: async () => {
46
- try {
47
- const servers = await mcpConfig.getServers();
48
- const results = servers.map((server) => ({
49
- serverId: server.id,
50
- serverTitle: server.title,
51
- status: "connected",
52
- toolCount: Object.keys(server.tools).length,
53
- implementedTools: Object.values(server.tools).filter((tool) => tool.isImplemented !== false).length,
54
- }));
55
- const totalToolCount = results.reduce((acc, server) => acc + server.toolCount, 0);
56
- const totalImplemented = results.reduce((acc, server) => acc + server.implementedTools, 0);
57
- logger.info("[MCP Utils] Connectivity test successful", {
58
- serverCount: results.length,
59
- totalToolCount,
60
- totalImplemented,
61
- });
62
- return {
63
- status: "ok",
64
- message: `Connected to ${results.length} MCP servers with ${totalToolCount} total tools (${totalImplemented} implemented)`,
65
- servers: results,
66
- timestamp: new Date().toISOString(),
67
- };
68
- }
69
- catch (error) {
70
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
71
- logger.error("[MCP Utils] Connectivity test failed", {
72
- error: errorMessage,
73
- });
74
- return {
75
- status: "error",
76
- message: `Failed to connect to MCP servers: ${errorMessage}`,
77
- timestamp: new Date().toISOString(),
78
- };
79
- }
80
- },
81
- /**
82
- * Get statistics about MCP usage
83
- */
84
- getStatistics: async () => {
85
- const servers = await mcpConfig.getServers();
86
- const managerStats = MCPManager.getAllStats();
87
- const toolStats = servers.reduce((acc, server) => {
88
- const tools = Object.values(server.tools);
89
- acc.totalTools += tools.length;
90
- acc.implementedTools += tools.filter((t) => t.isImplemented !== false).length;
91
- // Count by category
92
- if (server.category) {
93
- acc.byCategory[server.category] =
94
- (acc.byCategory[server.category] || 0) + tools.length;
95
- }
96
- return acc;
97
- }, {
98
- totalTools: 0,
99
- implementedTools: 0,
100
- byCategory: {},
101
- });
102
- return {
103
- servers: {
104
- total: servers.length,
105
- byCategory: servers.reduce((acc, server) => {
106
- const category = server.category || "custom";
107
- acc[category] = (acc[category] || 0) + 1;
108
- return acc;
109
- }, {}),
110
- },
111
- tools: toolStats,
112
- sessions: managerStats,
113
- };
114
- },
115
- /**
116
- * Initialize MCP for a session
117
- * Convenience method that sets up everything needed for a session
118
- */
119
- initializeSession: async (sessionId, config) => {
120
- // Get or create MCP client for session
121
- const client = getMCPManager(sessionId, config);
122
- // Create context for tool execution
123
- const context = {
124
- sessionId,
125
- userId: config?.userId,
126
- aiProvider: config?.aiProvider,
127
- modelId: config?.modelId,
128
- timestamp: Date.now(),
129
- };
130
- // Initialize all tools
131
- initializeMCPTools(sessionId, client, context);
132
- // Return session info
133
- return {
134
- sessionId,
135
- client,
136
- context,
137
- toolCount: Object.keys(client.getTools()).length,
138
- };
139
- },
140
- /**
141
- * Clean up a session
142
- */
143
- cleanupSession: async (sessionId) => {
144
- return removeMCPManager(sessionId);
145
- },
146
- };
21
+ // Import the ecosystem singleton
22
+ import { mcpEcosystem } from "./ecosystem.js";
147
23
  /**
148
- * Default export for convenience
24
+ * Initialize the MCP ecosystem
149
25
  */
150
- export default {
151
- config: mcpConfig,
152
- utils: MCPUtils,
153
- createServer: createMCPServer,
154
- getManager: getMCPManager,
155
- removeManager: removeMCPManager,
156
- };
26
+ export async function initializeMCPEcosystem() {
27
+ return mcpEcosystem.initialize();
28
+ }
29
+ /**
30
+ * List available MCPs
31
+ */
32
+ export async function listMCPs() {
33
+ return mcpEcosystem.list();
34
+ }
35
+ /**
36
+ * Execute an MCP operation
37
+ */
38
+ export async function executeMCP(name, config, args, context) {
39
+ return mcpEcosystem.execute(name, config, args, context);
40
+ }
41
+ /**
42
+ * Quick filesystem operations
43
+ */
44
+ export async function readFile(path, basePath) {
45
+ return mcpEcosystem.filesystem({
46
+ action: "readFile",
47
+ path,
48
+ basePath,
49
+ });
50
+ }
51
+ export async function writeFile(path, content, basePath) {
52
+ return mcpEcosystem.filesystem({
53
+ action: "writeFile",
54
+ path,
55
+ content,
56
+ basePath,
57
+ });
58
+ }
59
+ export async function listFiles(path, basePath) {
60
+ return mcpEcosystem.filesystem({
61
+ action: "listFiles",
62
+ path,
63
+ basePath,
64
+ });
65
+ }
66
+ export async function createDirectory(path, basePath) {
67
+ return mcpEcosystem.filesystem({
68
+ action: "createDir",
69
+ path,
70
+ basePath,
71
+ });
72
+ }
73
+ /**
74
+ * Get MCP ecosystem statistics
75
+ */
76
+ export async function getMCPStats() {
77
+ return mcpEcosystem.getStats();
78
+ }
@@ -3,7 +3,7 @@
3
3
  * Automatically registers built-in NeuroLink servers with the default registry
4
4
  * Ensures built-in tools are always available without manual configuration
5
5
  */
6
- import { defaultToolRegistry } from "./registry.js";
6
+ import { toolRegistry, defaultToolRegistry } from "./tool-registry.js";
7
7
  import { mcpLogger } from "./logging.js";
8
8
  let isInitialized = false;
9
9
  /**
@@ -19,14 +19,14 @@ export async function initializeNeuroLinkMCP() {
19
19
  // Note: AI core server temporarily disabled due to circular dependency issues
20
20
  const { utilityServer } = await import("./servers/utilities/utility-server.js");
21
21
  // Register built-in NeuroLink servers with default registry
22
- await defaultToolRegistry.registerServer(utilityServer);
22
+ await toolRegistry.registerServer(utilityServer.id, utilityServer);
23
23
  mcpLogger.debug("Registered neurolink-utility server with built-in tools");
24
24
  // TODO: Re-enable AI core server once circular dependencies are resolved
25
25
  // const { aiCoreServer } = await import('./servers/ai-providers/ai-core-server.js');
26
- // await defaultToolRegistry.registerServer(aiCoreServer);
26
+ // await toolRegistry.registerServer(aiCoreServer.id, aiCoreServer);
27
27
  // mcpLogger.debug('Registered neurolink-ai-core server with AI tools');
28
- const stats = defaultToolRegistry.getStats();
29
- mcpLogger.info(`Initialization complete: ${stats.totalServers} servers, ${stats.totalTools} tools available`);
28
+ const stats = await toolRegistry.getStats();
29
+ mcpLogger.info(`Initialization complete: ${stats.totalServers} server, ${stats.totalTools} tools available`);
30
30
  isInitialized = true;
31
31
  }
32
32
  catch (error) {
@@ -1,71 +1,38 @@
1
1
  /**
2
- * NeuroLink MCP Logging System
3
- * Provides configurable logging with different verbosity levels
2
+ * MCP Logging Utility
3
+ * Centralized logging for the MCP ecosystem
4
4
  */
5
- export declare enum LogLevel {
6
- SILENT = 0,
7
- ERROR = 1,
8
- WARN = 2,
9
- INFO = 3,
10
- DEBUG = 4
11
- }
12
- export interface LoggerConfig {
5
+ export type LogLevel = "debug" | "info" | "warn" | "error";
6
+ interface LogEntry {
13
7
  level: LogLevel;
14
- prefix?: string;
15
- colors?: boolean;
16
- timestamp?: boolean;
8
+ message: string;
9
+ timestamp: Date;
10
+ data?: unknown;
17
11
  }
18
- /**
19
- * Configurable logger for MCP operations
20
- */
21
- export declare class MCPLogger {
22
- private config;
23
- constructor(config?: Partial<LoggerConfig>);
24
- /**
25
- * Set log level
26
- */
27
- setLevel(level: LogLevel): void;
28
- /**
29
- * Get current log level
30
- */
31
- getLevel(): LogLevel;
32
- /**
33
- * Log an error message
34
- */
35
- error(message: string, ...args: any[]): void;
36
- /**
37
- * Log a warning message
38
- */
39
- warn(message: string, ...args: any[]): void;
40
- /**
41
- * Log an info message
42
- */
43
- info(message: string, ...args: any[]): void;
44
- /**
45
- * Log a debug message
46
- */
47
- debug(message: string, ...args: any[]): void;
48
- /**
49
- * Internal logging method
50
- */
12
+ declare class MCPLogger {
13
+ private logLevel;
14
+ private logs;
15
+ private maxLogs;
16
+ constructor();
17
+ setLogLevel(level: LogLevel): void;
18
+ private shouldLog;
51
19
  private log;
20
+ debug(message: string, data?: unknown): void;
21
+ info(message: string, data?: unknown): void;
22
+ warn(message: string, data?: unknown): void;
23
+ error(message: string, data?: unknown): void;
24
+ getLogs(level?: LogLevel): LogEntry[];
25
+ clearLogs(): void;
52
26
  }
53
- /**
54
- * Create logger instances for different MCP components
55
- */
56
- export declare const createLogger: (component: string) => MCPLogger;
57
- /**
58
- * Default loggers for common MCP components
59
- */
60
27
  export declare const mcpLogger: MCPLogger;
61
28
  export declare const autoDiscoveryLogger: MCPLogger;
62
29
  export declare const registryLogger: MCPLogger;
63
30
  export declare const unifiedRegistryLogger: MCPLogger;
64
- /**
65
- * Utility function to set global MCP log level
66
- */
67
31
  export declare function setGlobalMCPLogLevel(level: LogLevel): void;
68
- /**
69
- * Utility function to parse log level from string
70
- */
71
- export declare function parseLogLevel(level: string): LogLevel;
32
+ export declare const LogLevels: {
33
+ readonly debug: "debug";
34
+ readonly info: "info";
35
+ readonly warn: "warn";
36
+ readonly error: "error";
37
+ };
38
+ export {};