@juspay/neurolink 9.26.2 → 9.28.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 (125) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +59 -9
  3. package/dist/cli/commands/config.d.ts +4 -4
  4. package/dist/cli/commands/mcp.d.ts +87 -0
  5. package/dist/cli/commands/mcp.js +1524 -0
  6. package/dist/cli/loop/optionsSchema.js +4 -0
  7. package/dist/core/modules/ToolsManager.js +29 -2
  8. package/dist/index.d.ts +2 -1
  9. package/dist/index.js +27 -1
  10. package/dist/lib/core/modules/ToolsManager.js +29 -2
  11. package/dist/lib/index.d.ts +2 -1
  12. package/dist/lib/index.js +27 -1
  13. package/dist/lib/mcp/agentExposure.d.ts +228 -0
  14. package/dist/lib/mcp/agentExposure.js +357 -0
  15. package/dist/lib/mcp/batching/index.d.ts +11 -0
  16. package/dist/lib/mcp/batching/index.js +11 -0
  17. package/dist/lib/mcp/batching/requestBatcher.d.ts +202 -0
  18. package/dist/lib/mcp/batching/requestBatcher.js +442 -0
  19. package/dist/lib/mcp/caching/index.d.ts +11 -0
  20. package/dist/lib/mcp/caching/index.js +11 -0
  21. package/dist/lib/mcp/caching/toolCache.d.ts +221 -0
  22. package/dist/lib/mcp/caching/toolCache.js +434 -0
  23. package/dist/lib/mcp/elicitation/elicitationManager.d.ts +169 -0
  24. package/dist/lib/mcp/elicitation/elicitationManager.js +377 -0
  25. package/dist/lib/mcp/elicitation/index.d.ts +11 -0
  26. package/dist/lib/mcp/elicitation/index.js +12 -0
  27. package/dist/lib/mcp/elicitation/types.d.ts +278 -0
  28. package/dist/lib/mcp/elicitation/types.js +11 -0
  29. package/dist/lib/mcp/elicitationProtocol.d.ts +228 -0
  30. package/dist/lib/mcp/elicitationProtocol.js +376 -0
  31. package/dist/lib/mcp/enhancedToolDiscovery.d.ts +205 -0
  32. package/dist/lib/mcp/enhancedToolDiscovery.js +482 -0
  33. package/dist/lib/mcp/index.d.ts +38 -1
  34. package/dist/lib/mcp/index.js +36 -3
  35. package/dist/lib/mcp/mcpRegistryClient.d.ts +332 -0
  36. package/dist/lib/mcp/mcpRegistryClient.js +489 -0
  37. package/dist/lib/mcp/mcpServerBase.d.ts +227 -0
  38. package/dist/lib/mcp/mcpServerBase.js +374 -0
  39. package/dist/lib/mcp/multiServerManager.d.ts +310 -0
  40. package/dist/lib/mcp/multiServerManager.js +580 -0
  41. package/dist/lib/mcp/routing/index.d.ts +11 -0
  42. package/dist/lib/mcp/routing/index.js +11 -0
  43. package/dist/lib/mcp/routing/toolRouter.d.ts +219 -0
  44. package/dist/lib/mcp/routing/toolRouter.js +417 -0
  45. package/dist/lib/mcp/serverCapabilities.d.ts +341 -0
  46. package/dist/lib/mcp/serverCapabilities.js +503 -0
  47. package/dist/lib/mcp/toolAnnotations.d.ts +154 -0
  48. package/dist/lib/mcp/toolAnnotations.js +240 -0
  49. package/dist/lib/mcp/toolConverter.d.ts +178 -0
  50. package/dist/lib/mcp/toolConverter.js +259 -0
  51. package/dist/lib/mcp/toolIntegration.d.ts +136 -0
  52. package/dist/lib/mcp/toolIntegration.js +335 -0
  53. package/dist/lib/memory/hippocampusInitializer.d.ts +2 -2
  54. package/dist/lib/memory/hippocampusInitializer.js +1 -1
  55. package/dist/lib/neurolink.d.ts +275 -2
  56. package/dist/lib/neurolink.js +596 -56
  57. package/dist/lib/providers/litellm.d.ts +10 -0
  58. package/dist/lib/providers/litellm.js +104 -2
  59. package/dist/lib/types/configTypes.d.ts +56 -0
  60. package/dist/lib/types/conversation.d.ts +2 -2
  61. package/dist/lib/types/generateTypes.d.ts +4 -0
  62. package/dist/lib/types/index.d.ts +2 -1
  63. package/dist/lib/types/modelTypes.d.ts +6 -6
  64. package/dist/lib/types/streamTypes.d.ts +2 -0
  65. package/dist/lib/types/tools.d.ts +2 -0
  66. package/dist/lib/utils/pricing.js +177 -17
  67. package/dist/lib/utils/schemaConversion.d.ts +6 -1
  68. package/dist/lib/utils/schemaConversion.js +50 -28
  69. package/dist/lib/workflow/config.d.ts +16 -16
  70. package/dist/mcp/agentExposure.d.ts +228 -0
  71. package/dist/mcp/agentExposure.js +356 -0
  72. package/dist/mcp/batching/index.d.ts +11 -0
  73. package/dist/mcp/batching/index.js +10 -0
  74. package/dist/mcp/batching/requestBatcher.d.ts +202 -0
  75. package/dist/mcp/batching/requestBatcher.js +441 -0
  76. package/dist/mcp/caching/index.d.ts +11 -0
  77. package/dist/mcp/caching/index.js +10 -0
  78. package/dist/mcp/caching/toolCache.d.ts +221 -0
  79. package/dist/mcp/caching/toolCache.js +433 -0
  80. package/dist/mcp/elicitation/elicitationManager.d.ts +169 -0
  81. package/dist/mcp/elicitation/elicitationManager.js +376 -0
  82. package/dist/mcp/elicitation/index.d.ts +11 -0
  83. package/dist/mcp/elicitation/index.js +11 -0
  84. package/dist/mcp/elicitation/types.d.ts +278 -0
  85. package/dist/mcp/elicitation/types.js +10 -0
  86. package/dist/mcp/elicitationProtocol.d.ts +228 -0
  87. package/dist/mcp/elicitationProtocol.js +375 -0
  88. package/dist/mcp/enhancedToolDiscovery.d.ts +205 -0
  89. package/dist/mcp/enhancedToolDiscovery.js +481 -0
  90. package/dist/mcp/index.d.ts +38 -1
  91. package/dist/mcp/index.js +36 -3
  92. package/dist/mcp/mcpRegistryClient.d.ts +332 -0
  93. package/dist/mcp/mcpRegistryClient.js +488 -0
  94. package/dist/mcp/mcpServerBase.d.ts +227 -0
  95. package/dist/mcp/mcpServerBase.js +373 -0
  96. package/dist/mcp/multiServerManager.d.ts +310 -0
  97. package/dist/mcp/multiServerManager.js +579 -0
  98. package/dist/mcp/routing/index.d.ts +11 -0
  99. package/dist/mcp/routing/index.js +10 -0
  100. package/dist/mcp/routing/toolRouter.d.ts +219 -0
  101. package/dist/mcp/routing/toolRouter.js +416 -0
  102. package/dist/mcp/serverCapabilities.d.ts +341 -0
  103. package/dist/mcp/serverCapabilities.js +502 -0
  104. package/dist/mcp/toolAnnotations.d.ts +154 -0
  105. package/dist/mcp/toolAnnotations.js +239 -0
  106. package/dist/mcp/toolConverter.d.ts +178 -0
  107. package/dist/mcp/toolConverter.js +258 -0
  108. package/dist/mcp/toolIntegration.d.ts +136 -0
  109. package/dist/mcp/toolIntegration.js +334 -0
  110. package/dist/memory/hippocampusInitializer.d.ts +2 -2
  111. package/dist/memory/hippocampusInitializer.js +1 -1
  112. package/dist/neurolink.d.ts +275 -2
  113. package/dist/neurolink.js +596 -56
  114. package/dist/providers/litellm.d.ts +10 -0
  115. package/dist/providers/litellm.js +104 -2
  116. package/dist/types/configTypes.d.ts +56 -0
  117. package/dist/types/conversation.d.ts +2 -2
  118. package/dist/types/generateTypes.d.ts +4 -0
  119. package/dist/types/index.d.ts +2 -1
  120. package/dist/types/streamTypes.d.ts +2 -0
  121. package/dist/types/tools.d.ts +2 -0
  122. package/dist/utils/pricing.js +177 -17
  123. package/dist/utils/schemaConversion.d.ts +6 -1
  124. package/dist/utils/schemaConversion.js +50 -28
  125. package/package.json +2 -2
@@ -2,15 +2,52 @@
2
2
  * MCP Ecosystem - Main Export
3
3
  * Universal AI Development Platform with Extensible Plugin Architecture
4
4
  * Implementation based on research blueprint
5
+ *
6
+ * Enhanced in Phase 8.39.0 with:
7
+ * - MCPServerBase - Abstract base class for creating MCP servers
8
+ * - Tool Annotations - Enhanced tool hints and metadata
9
+ * - Elicitation Protocol - Interactive tool input during execution
10
+ * - Multi-Server Manager - Load balancing and coordination
11
+ * - Enhanced Tool Discovery - Advanced search and filtering
5
12
  */
6
13
  import type { McpMetadata } from "../types/mcpTypes.js";
7
14
  export type { AuthorizationUrlResult, HTTPRetryConfig, MCPOAuthConfig, OAuthClientInformation, OAuthTokens, RateLimitConfig, TokenExchangeRequest, TokenStorage, } from "../types/mcpTypes.js";
8
15
  export { mcpLogger } from "../utils/logger.js";
9
- export { calculateExpiresAt, createOAuthProviderFromConfig, FileTokenStorage, InMemoryTokenStorage, isTokenExpired, NeuroLinkOAuthProvider, } from "./auth/index.js";
10
16
  export { createMCPServer, getServerInfo, validateServerTools, validateTool, } from "./factory.js";
17
+ export { calculateExpiresAt, createOAuthProviderFromConfig, FileTokenStorage, InMemoryTokenStorage, isTokenExpired, NeuroLinkOAuthProvider, } from "./auth/index.js";
11
18
  export { DEFAULT_RATE_LIMIT_CONFIG, globalRateLimiterManager, HTTPRateLimiter, RateLimiterManager, } from "./httpRateLimiter.js";
12
19
  export { DEFAULT_HTTP_RETRY_CONFIG, isRetryableHTTPError, isRetryableStatusCode, withHTTPRetry, } from "./httpRetryHandler.js";
13
20
  export { CircuitBreakerManager, globalCircuitBreakerManager, MCPCircuitBreaker, } from "./mcpCircuitBreaker.js";
21
+ export { MCPToolRegistry } from "./toolRegistry.js";
22
+ export { ExternalServerManager } from "./externalServerManager.js";
23
+ export { MCPClientFactory } from "./mcpClientFactory.js";
24
+ export type { ExposableAgent, ExposableWorkflow, ExposureOptions, ExposureResult, } from "./agentExposure.js";
25
+ export { AgentExposureManager, exposeAgentAsTool, exposeAgentsAsTools, exposeWorkflowAsTool, exposeWorkflowsAsTools, globalAgentExposureManager, } from "./agentExposure.js";
26
+ export type { ConfirmationElicitation, Elicitation, ElicitationContext, ElicitationHandler, ElicitationManagerConfig, ElicitationRequest, ElicitationResponse, ElicitationType, FileElicitation, FormElicitation, FormField, MultiSelectElicitation, SecretElicitation, SelectElicitation, SelectOption, TextElicitation, } from "./elicitation/index.js";
27
+ export { ElicitationManager, globalElicitationManager, } from "./elicitation/index.js";
28
+ export type { ElicitationCancelMessage, ElicitationCancelParams, ElicitationProtocolAdapterConfig, ElicitationProtocolHandler, ElicitationProtocolMessage, ElicitationProtocolMessageType, ElicitationProtocolPayload, ElicitationRequestMessage, ElicitationRequestParams, ElicitationResponseMessage, ElicitationResponseParams, } from "./elicitationProtocol.js";
29
+ export { createConfirmationRequest, createElicitationCancel, createElicitationRequest, createElicitationResponse, createFormRequest, createSelectRequest, createTextInputRequest, ElicitationProtocolAdapter, elicitationResponseToProtocol, globalElicitationProtocol, isElicitationProtocolMessage, protocolMessageToElicitation, } from "./elicitationProtocol.js";
30
+ export type { CompatibilityCheckResult, EnhancedToolInfo, ToolSearchCriteria, ToolSearchResult, } from "./enhancedToolDiscovery.js";
31
+ export { EnhancedToolDiscovery } from "./enhancedToolDiscovery.js";
32
+ export type { MCPRegistryClientConfig, RegistryConfig, RegistryEntry, RegistrySearchOptions, RegistrySearchResult, RegistrySourceType, } from "./mcpRegistryClient.js";
33
+ export { getAllWellKnownServers, getWellKnownServer, globalMCPRegistryClient, MCPRegistryClient, } from "./mcpRegistryClient.js";
34
+ export type { MCPServerBaseConfig, MCPServerEvents, MCPServerTool, MCPToolAnnotations, } from "./mcpServerBase.js";
35
+ export { MCPServerBase } from "./mcpServerBase.js";
36
+ export type { LoadBalancingStrategy, MultiServerManagerConfig, ServerGroup, ServerWeight, UnifiedTool, } from "./multiServerManager.js";
37
+ export { globalMultiServerManager, MultiServerManager, } from "./multiServerManager.js";
38
+ export type { MCPPrompt, MCPResource, PromptGenerator, PromptMessage, PromptResult, RegisteredPrompt, RegisteredResource, ResourceContent, ResourceReader, ResourceSubscriptionCallback, ServerCapabilitiesConfig, } from "./serverCapabilities.js";
39
+ export { createJsonResource, createPrompt, createTextResource, ServerCapabilitiesManager, } from "./serverCapabilities.js";
40
+ export { createAnnotatedTool, filterToolsByAnnotations, getAnnotationSummary, getToolSafetyLevel, inferAnnotations, isSafeToRetry, mergeAnnotations, requiresConfirmation, validateAnnotations, } from "./toolAnnotations.js";
41
+ export type { MCPProtocolTool, NeuroLinkTool, ToolConverterOptions, } from "./toolConverter.js";
42
+ export { batchConvertToMCP, batchConvertToNeuroLink, createToolFromFunction, mcpProtocolToolToServerTool, mcpToolToNeuroLink, neuroLinkToolToMCP, sanitizeToolName, serverToolToMCPProtocol, TOOL_COMPATIBILITY, validateToolName, } from "./toolConverter.js";
43
+ export type { EnhancedExecutionContext, ToolMiddleware, ToolWrapperOptions, } from "./toolIntegration.js";
44
+ export { confirmationMiddleware, createElicitationContext, createRetryMiddleware, createTimeoutMiddleware, createToolMiddlewareChain, globalToolIntegrationManager, loggingMiddleware, ToolIntegrationManager, validationMiddleware, wrapToolsWithElicitation, wrapToolWithElicitation, } from "./toolIntegration.js";
45
+ export type { BatchConfig, BatchExecutor, BatcherEvents, BatchResult, } from "./batching/index.js";
46
+ export { createRequestBatcher, createToolCallBatcher, DEFAULT_BATCH_CONFIG, RequestBatcher, ToolCallBatcher, } from "./batching/index.js";
47
+ export type { CacheConfig, CacheEvents, CacheStats, CacheStrategy, } from "./caching/index.js";
48
+ export { createToolCache, createToolResultCache, DEFAULT_CACHE_CONFIG, ToolCache, ToolResultCache, } from "./caching/index.js";
49
+ export type { AffinityRule, CategoryMapping, MCPTool, RoutingDecision, RoutingStrategy, ServerWeight as RouterServerWeight, ToolRouterConfig, ToolRouterEvents, } from "./routing/index.js";
50
+ export { createToolRouter, DEFAULT_ROUTER_CONFIG, ToolRouter, } from "./routing/index.js";
14
51
  /**
15
52
  * Initialize the MCP ecosystem - simplified
16
53
  */
package/dist/mcp/index.js CHANGED
@@ -1,14 +1,47 @@
1
+ import { ErrorFactory } from "../utils/errorHandling.js";
1
2
  export { mcpLogger } from "../utils/logger.js";
2
- // OAuth Authentication
3
- export { calculateExpiresAt, createOAuthProviderFromConfig, FileTokenStorage, InMemoryTokenStorage, isTokenExpired, NeuroLinkOAuthProvider, } from "./auth/index.js";
4
3
  // MCP Server Factory
5
4
  export { createMCPServer, getServerInfo, validateServerTools, validateTool, } from "./factory.js";
5
+ // OAuth Authentication
6
+ export { calculateExpiresAt, createOAuthProviderFromConfig, FileTokenStorage, InMemoryTokenStorage, isTokenExpired, NeuroLinkOAuthProvider, } from "./auth/index.js";
6
7
  // HTTP Rate Limiter
7
8
  export { DEFAULT_RATE_LIMIT_CONFIG, globalRateLimiterManager, HTTPRateLimiter, RateLimiterManager, } from "./httpRateLimiter.js";
8
9
  // HTTP Retry Handler
9
10
  export { DEFAULT_HTTP_RETRY_CONFIG, isRetryableHTTPError, isRetryableStatusCode, withHTTPRetry, } from "./httpRetryHandler.js";
10
11
  // Circuit Breaker
11
12
  export { CircuitBreakerManager, globalCircuitBreakerManager, MCPCircuitBreaker, } from "./mcpCircuitBreaker.js";
13
+ // Core MCP Components
14
+ export { MCPToolRegistry } from "./toolRegistry.js";
15
+ export { ExternalServerManager } from "./externalServerManager.js";
16
+ export { MCPClientFactory } from "./mcpClientFactory.js";
17
+ // Agent and Workflow Exposure
18
+ export { AgentExposureManager, exposeAgentAsTool, exposeAgentsAsTools, exposeWorkflowAsTool, exposeWorkflowsAsTools, globalAgentExposureManager, } from "./agentExposure.js";
19
+ // Elicitation Protocol - Manager
20
+ export { ElicitationManager, globalElicitationManager, } from "./elicitation/index.js";
21
+ // Elicitation Protocol - Protocol Layer
22
+ export { createConfirmationRequest, createElicitationCancel, createElicitationRequest, createElicitationResponse, createFormRequest, createSelectRequest, createTextInputRequest, ElicitationProtocolAdapter, elicitationResponseToProtocol, globalElicitationProtocol, isElicitationProtocolMessage, protocolMessageToElicitation, } from "./elicitationProtocol.js";
23
+ // Enhanced Tool Discovery
24
+ export { EnhancedToolDiscovery } from "./enhancedToolDiscovery.js";
25
+ // MCP Registry Client
26
+ export { getAllWellKnownServers, getWellKnownServer, globalMCPRegistryClient, MCPRegistryClient, } from "./mcpRegistryClient.js";
27
+ // MCP Server Base Class
28
+ export { MCPServerBase } from "./mcpServerBase.js";
29
+ // Multi-Server Manager
30
+ export { globalMultiServerManager, MultiServerManager, } from "./multiServerManager.js";
31
+ // Server Capabilities (Resources and Prompts)
32
+ export { createJsonResource, createPrompt, createTextResource, ServerCapabilitiesManager, } from "./serverCapabilities.js";
33
+ // Tool Annotations System
34
+ export { createAnnotatedTool, filterToolsByAnnotations, getAnnotationSummary, getToolSafetyLevel, inferAnnotations, isSafeToRetry, mergeAnnotations, requiresConfirmation, validateAnnotations, } from "./toolAnnotations.js";
35
+ // Tool Converter Utilities
36
+ export { batchConvertToMCP, batchConvertToNeuroLink, createToolFromFunction, mcpProtocolToolToServerTool, mcpToolToNeuroLink, neuroLinkToolToMCP, sanitizeToolName, serverToolToMCPProtocol, TOOL_COMPATIBILITY, validateToolName, } from "./toolConverter.js";
37
+ // Tool Integration with Elicitation
38
+ export { confirmationMiddleware, createElicitationContext, createRetryMiddleware, createTimeoutMiddleware, createToolMiddlewareChain, globalToolIntegrationManager, loggingMiddleware, ToolIntegrationManager, validationMiddleware, wrapToolsWithElicitation, wrapToolWithElicitation, } from "./toolIntegration.js";
39
+ // Request Batcher - Efficient batch processing
40
+ export { createRequestBatcher, createToolCallBatcher, DEFAULT_BATCH_CONFIG, RequestBatcher, ToolCallBatcher, } from "./batching/index.js";
41
+ // Tool Cache - Result and response caching
42
+ export { createToolCache, createToolResultCache, DEFAULT_CACHE_CONFIG, ToolCache, ToolResultCache, } from "./caching/index.js";
43
+ // Tool Router - Intelligent routing for multi-server environments
44
+ export { createToolRouter, DEFAULT_ROUTER_CONFIG, ToolRouter, } from "./routing/index.js";
12
45
  /**
13
46
  * Initialize the MCP ecosystem - simplified
14
47
  */
@@ -26,7 +59,7 @@ export async function listMCPs() {
26
59
  * Execute an MCP operation - simplified
27
60
  */
28
61
  export async function executeMCP(_name, _config, _args, _context) {
29
- throw new Error("MCP execution not available - ecosystem removed");
62
+ throw ErrorFactory.invalidConfiguration("executeMCP", "Direct legacy MCP execution is deprecated. Use the new module APIs (createMCPServer, MultiServerManager, ToolRouter, etc.) instead.");
30
63
  }
31
64
  /**
32
65
  * Get MCP ecosystem statistics - simplified
@@ -0,0 +1,332 @@
1
+ /**
2
+ * MCP Registry Client
3
+ *
4
+ * Client for discovering MCP servers from centralized registries.
5
+ * Supports multiple registry sources including:
6
+ * - Official MCP Registry
7
+ * - NPM packages
8
+ * - GitHub repositories
9
+ * - Custom registries
10
+ *
11
+ * @module mcp/mcpRegistryClient
12
+ * @since 8.39.0
13
+ */
14
+ import { EventEmitter } from "events";
15
+ import type { MCPServerInfo, MCPTransportType } from "../types/mcpTypes.js";
16
+ import type { JsonObject } from "../types/common.js";
17
+ /**
18
+ * Registry source types
19
+ */
20
+ export type RegistrySourceType = "official" | "npm" | "github" | "custom";
21
+ /**
22
+ * Registry entry for an MCP server
23
+ */
24
+ export type RegistryEntry = {
25
+ /**
26
+ * Unique identifier
27
+ */
28
+ id: string;
29
+ /**
30
+ * Server name
31
+ */
32
+ name: string;
33
+ /**
34
+ * Server description
35
+ */
36
+ description: string;
37
+ /**
38
+ * Server version
39
+ */
40
+ version: string;
41
+ /**
42
+ * Author or maintainer
43
+ */
44
+ author?: string;
45
+ /**
46
+ * License
47
+ */
48
+ license?: string;
49
+ /**
50
+ * Homepage URL
51
+ */
52
+ homepage?: string;
53
+ /**
54
+ * Repository URL
55
+ */
56
+ repository?: string;
57
+ /**
58
+ * NPM package name (if applicable)
59
+ */
60
+ npmPackage?: string;
61
+ /**
62
+ * Installation command
63
+ */
64
+ installCommand?: string;
65
+ /**
66
+ * Command to run the server
67
+ */
68
+ command?: string;
69
+ /**
70
+ * Command arguments
71
+ */
72
+ args?: string[];
73
+ /**
74
+ * Required environment variables
75
+ */
76
+ requiredEnvVars?: string[];
77
+ /**
78
+ * Supported transport types
79
+ */
80
+ transports?: MCPTransportType[];
81
+ /**
82
+ * Server categories
83
+ */
84
+ categories?: string[];
85
+ /**
86
+ * Server tags
87
+ */
88
+ tags?: string[];
89
+ /**
90
+ * Tool names provided by the server
91
+ */
92
+ tools?: string[];
93
+ /**
94
+ * Download count (popularity metric)
95
+ */
96
+ downloads?: number;
97
+ /**
98
+ * Star count (if from GitHub)
99
+ */
100
+ stars?: number;
101
+ /**
102
+ * Last updated date
103
+ */
104
+ lastUpdated?: string;
105
+ /**
106
+ * Verification status
107
+ */
108
+ verified?: boolean;
109
+ /**
110
+ * Custom metadata
111
+ */
112
+ metadata?: JsonObject;
113
+ };
114
+ /**
115
+ * Registry configuration
116
+ */
117
+ export type RegistryConfig = {
118
+ /**
119
+ * Registry type
120
+ */
121
+ type: RegistrySourceType;
122
+ /**
123
+ * Registry URL or identifier
124
+ */
125
+ url?: string;
126
+ /**
127
+ * Authentication token
128
+ */
129
+ authToken?: string;
130
+ /**
131
+ * Request timeout in milliseconds
132
+ */
133
+ timeout?: number;
134
+ /**
135
+ * Enable caching
136
+ */
137
+ enableCache?: boolean;
138
+ /**
139
+ * Cache TTL in milliseconds
140
+ */
141
+ cacheTTL?: number;
142
+ };
143
+ /**
144
+ * Search options for registry queries
145
+ */
146
+ export type RegistrySearchOptions = {
147
+ /**
148
+ * Search query (name, description, tags)
149
+ */
150
+ query?: string;
151
+ /**
152
+ * Filter by categories
153
+ */
154
+ categories?: string[];
155
+ /**
156
+ * Filter by tags
157
+ */
158
+ tags?: string[];
159
+ /**
160
+ * Filter by transport type
161
+ */
162
+ transport?: MCPTransportType;
163
+ /**
164
+ * Only verified servers
165
+ */
166
+ verifiedOnly?: boolean;
167
+ /**
168
+ * Sort by field
169
+ */
170
+ sortBy?: "name" | "downloads" | "stars" | "lastUpdated";
171
+ /**
172
+ * Sort direction
173
+ */
174
+ sortDirection?: "asc" | "desc";
175
+ /**
176
+ * Maximum results
177
+ */
178
+ limit?: number;
179
+ /**
180
+ * Offset for pagination
181
+ */
182
+ offset?: number;
183
+ };
184
+ /**
185
+ * Search result
186
+ */
187
+ export type RegistrySearchResult = {
188
+ entries: RegistryEntry[];
189
+ totalCount: number;
190
+ page: number;
191
+ pageSize: number;
192
+ hasMore: boolean;
193
+ };
194
+ /**
195
+ * Registry client configuration
196
+ */
197
+ export type MCPRegistryClientConfig = {
198
+ /**
199
+ * Default registries to use
200
+ */
201
+ registries?: RegistryConfig[];
202
+ /**
203
+ * Enable automatic caching
204
+ */
205
+ enableCache?: boolean;
206
+ /**
207
+ * Default cache TTL
208
+ */
209
+ defaultCacheTTL?: number;
210
+ /**
211
+ * Request timeout
212
+ */
213
+ timeout?: number;
214
+ /**
215
+ * User agent string
216
+ */
217
+ userAgent?: string;
218
+ };
219
+ /**
220
+ * MCP Registry Client
221
+ *
222
+ * Provides methods to discover and install MCP servers from registries.
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const client = new MCPRegistryClient();
227
+ *
228
+ * // Search for servers
229
+ * const results = await client.search({ query: "database" });
230
+ *
231
+ * // Get server details
232
+ * const entry = await client.getEntry("postgres");
233
+ *
234
+ * // Convert to MCPServerInfo
235
+ * const serverInfo = client.toServerInfo(entry);
236
+ * ```
237
+ */
238
+ export declare class MCPRegistryClient extends EventEmitter {
239
+ private config;
240
+ private cache;
241
+ private customEntries;
242
+ constructor(config?: MCPRegistryClientConfig);
243
+ /**
244
+ * Search the registry
245
+ */
246
+ search(options?: RegistrySearchOptions): Promise<RegistrySearchResult>;
247
+ /**
248
+ * Get a specific entry by ID
249
+ */
250
+ getEntry(id: string): Promise<RegistryEntry | undefined>;
251
+ /**
252
+ * Get all available entries
253
+ */
254
+ getAllEntries(): Promise<RegistryEntry[]>;
255
+ /**
256
+ * Get entries by category
257
+ */
258
+ getByCategory(category: string): Promise<RegistryEntry[]>;
259
+ /**
260
+ * Get entries by tag
261
+ */
262
+ getByTag(tag: string): Promise<RegistryEntry[]>;
263
+ /**
264
+ * Get all categories
265
+ */
266
+ getCategories(): Promise<string[]>;
267
+ /**
268
+ * Get all tags
269
+ */
270
+ getTags(): Promise<string[]>;
271
+ /**
272
+ * Convert registry entry to MCPServerInfo
273
+ */
274
+ toServerInfo(entry: RegistryEntry): MCPServerInfo;
275
+ /**
276
+ * Add a custom registry entry
277
+ */
278
+ addCustomEntry(entry: RegistryEntry): void;
279
+ /**
280
+ * Remove a custom registry entry
281
+ */
282
+ removeCustomEntry(id: string): boolean;
283
+ /**
284
+ * Add a registry configuration
285
+ */
286
+ addRegistry(config: RegistryConfig): void;
287
+ /**
288
+ * Clear the cache
289
+ */
290
+ clearCache(): void;
291
+ /**
292
+ * Check if required environment variables are set
293
+ */
294
+ checkRequiredEnvVars(entry: RegistryEntry): {
295
+ ready: boolean;
296
+ missing: string[];
297
+ };
298
+ /**
299
+ * Get installation command for an entry
300
+ */
301
+ getInstallCommand(entry: RegistryEntry): string | undefined;
302
+ /**
303
+ * Get popular servers
304
+ */
305
+ getPopularServers(limit?: number): Promise<RegistryEntry[]>;
306
+ /**
307
+ * Get verified servers
308
+ */
309
+ getVerifiedServers(): Promise<RegistryEntry[]>;
310
+ /**
311
+ * Get statistics
312
+ */
313
+ getStatistics(): Promise<{
314
+ totalEntries: number;
315
+ verifiedEntries: number;
316
+ categories: number;
317
+ tags: number;
318
+ customEntries: number;
319
+ }>;
320
+ }
321
+ /**
322
+ * Global MCP registry client instance
323
+ */
324
+ export declare const globalMCPRegistryClient: MCPRegistryClient;
325
+ /**
326
+ * Quick lookup function for well-known servers
327
+ */
328
+ export declare function getWellKnownServer(id: string): RegistryEntry | undefined;
329
+ /**
330
+ * Get all well-known servers
331
+ */
332
+ export declare function getAllWellKnownServers(): RegistryEntry[];