claude-flow 2.7.33 → 2.7.35
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/.claude/settings.local.json +9 -2
- package/.claude/skills/agentic-jujutsu/SKILL.md +1 -1
- package/CHANGELOG.md +140 -0
- package/bin/claude-flow +1 -1
- package/dist/src/cli/commands/mcp.js +61 -7
- package/dist/src/cli/commands/mcp.js.map +1 -1
- package/dist/src/cli/init/index.js +55 -33
- package/dist/src/cli/init/index.js.map +1 -1
- package/dist/src/cli/simple-cli.js +182 -172
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/init/agent-copier.js +9 -3
- package/dist/src/cli/simple-commands/init/agent-copier.js.map +1 -1
- package/dist/src/core/DatabaseManager.js +39 -9
- package/dist/src/core/DatabaseManager.js.map +1 -1
- package/dist/src/mcp/async/job-manager-mcp25.js +240 -0
- package/dist/src/mcp/async/job-manager-mcp25.js.map +1 -0
- package/dist/src/mcp/index.js +8 -0
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/protocol/version-negotiation.js +182 -0
- package/dist/src/mcp/protocol/version-negotiation.js.map +1 -0
- package/dist/src/mcp/registry/mcp-registry-client-2025.js +210 -0
- package/dist/src/mcp/registry/mcp-registry-client-2025.js.map +1 -0
- package/dist/src/mcp/server-factory.js +189 -0
- package/dist/src/mcp/server-factory.js.map +1 -0
- package/dist/src/mcp/server-mcp-2025.js +283 -0
- package/dist/src/mcp/server-mcp-2025.js.map +1 -0
- package/dist/src/mcp/tool-registry-progressive.js +319 -0
- package/dist/src/mcp/tool-registry-progressive.js.map +1 -0
- package/dist/src/mcp/tools/_template.js +62 -0
- package/dist/src/mcp/tools/_template.js.map +1 -0
- package/dist/src/mcp/tools/loader.js +228 -0
- package/dist/src/mcp/tools/loader.js.map +1 -0
- package/dist/src/mcp/tools/system/search.js +224 -0
- package/dist/src/mcp/tools/system/search.js.map +1 -0
- package/dist/src/mcp/tools/system/status.js +168 -0
- package/dist/src/mcp/tools/system/status.js.map +1 -0
- package/dist/src/mcp/validation/schema-validator-2025.js +198 -0
- package/dist/src/mcp/validation/schema-validator-2025.js.map +1 -0
- package/dist/src/utils/error-recovery.js +215 -0
- package/dist/src/utils/error-recovery.js.map +1 -0
- package/dist/src/utils/metrics-reader.js +10 -0
- package/dist/src/utils/metrics-reader.js.map +1 -1
- package/docs/.claude-flow/metrics/performance.json +3 -3
- package/docs/.claude-flow/metrics/task-metrics.json +3 -3
- package/docs/.github-release-issue-v2.7.33.md +488 -0
- package/docs/AGENTDB_BRANCH_MERGE_VERIFICATION.md +436 -0
- package/docs/AUTOMATIC_ERROR_RECOVERY_v2.7.35.md +321 -0
- package/docs/BRANCH_REVIEW_SUMMARY.md +439 -0
- package/docs/CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md +384 -0
- package/docs/DEEP_CODE_REVIEW_v2.7.33.md +1159 -0
- package/docs/DOCKER_TEST_RESULTS_v2.7.35.md +305 -0
- package/docs/MCP_2025_FEATURE_CONFIRMATION.md +698 -0
- package/docs/NPM_PUBLISH_GUIDE_v2.7.33.md +628 -0
- package/docs/REGRESSION_TEST_REPORT_v2.7.33.md +397 -0
- package/docs/RELEASE_NOTES_v2.7.33.md +618 -0
- package/docs/RELEASE_READINESS_SUMMARY.md +377 -0
- package/docs/RELEASE_SUMMARY_v2.7.33.md +456 -0
- package/docs/agentic-flow-agentdb-mcp-integration.md +1198 -0
- package/docs/features/automatic-error-recovery.md +333 -0
- package/docs/github-issues/README.md +88 -0
- package/docs/github-issues/wsl-enotempty-automatic-recovery.md +470 -0
- package/docs/mcp-2025-implementation-summary.md +459 -0
- package/docs/mcp-spec-2025-implementation-plan.md +1330 -0
- package/docs/phase-1-2-implementation-summary.md +676 -0
- package/docs/regression-analysis-phase-1-2.md +555 -0
- package/docs/troubleshooting/wsl-better-sqlite3-error.md +239 -0
- package/package.json +5 -2
- package/scripts/create-github-issue.sh +64 -0
- package/scripts/test-docker-wsl.sh +198 -0
- package/src/cli/commands/mcp.ts +86 -9
- package/src/cli/init/index.ts +72 -42
- package/src/cli/simple-commands/init/agent-copier.js +10 -5
- package/src/core/DatabaseManager.ts +55 -9
- package/src/mcp/async/job-manager-mcp25.ts +456 -0
- package/src/mcp/index.ts +60 -0
- package/src/mcp/protocol/version-negotiation.ts +329 -0
- package/src/mcp/registry/mcp-registry-client-2025.ts +334 -0
- package/src/mcp/server-factory.ts +426 -0
- package/src/mcp/server-mcp-2025.ts +507 -0
- package/src/mcp/tool-registry-progressive.ts +539 -0
- package/src/mcp/tools/_template.ts +174 -0
- package/src/mcp/tools/loader.ts +362 -0
- package/src/mcp/tools/system/search.ts +276 -0
- package/src/mcp/tools/system/status.ts +206 -0
- package/src/mcp/validation/schema-validator-2025.ts +294 -0
- package/src/utils/error-recovery.ts +325 -0
- package/docs/AGENTDB_V1.6.1_DEEP_REVIEW.md +0 -386
- package/docs/AGENT_FOLDER_STRUCTURE_FIX.md +0 -192
- package/docs/RECENT_RELEASES_SUMMARY.md +0 -375
- package/docs/V2.7.31_RELEASE_NOTES.md +0 -375
- /package/.claude/agents/analysis/{analyze-code-quality.md → code-review/analyze-code-quality.md} +0 -0
- /package/.claude/agents/architecture/{arch-system-design.md → system-design/arch-system-design.md} +0 -0
- /package/.claude/agents/data/{data-ml-model.md → ml/data-ml-model.md} +0 -0
- /package/.claude/agents/development/{dev-backend-api.md → backend/dev-backend-api.md} +0 -0
- /package/.claude/agents/devops/{ops-cicd-github.md → ci-cd/ops-cicd-github.md} +0 -0
- /package/.claude/agents/documentation/{docs-api-openapi.md → api-docs/docs-api-openapi.md} +0 -0
- /package/.claude/agents/specialized/{spec-mobile-react-native.md → mobile/spec-mobile-react-native.md} +0 -0
- /package/.claude/agents/testing/{tdd-london-swarm.md → unit/tdd-london-swarm.md} +0 -0
- /package/.claude/agents/testing/{production-validator.md → validation/production-validator.md} +0 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Factory
|
|
3
|
+
*
|
|
4
|
+
* Creates appropriate MCP server instance based on configuration.
|
|
5
|
+
* Provides seamless transition from legacy MCP to MCP 2025-11 with feature flags.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { IEventBus } from '../interfaces/event-bus.js';
|
|
9
|
+
import type { ILogger } from '../interfaces/logger.js';
|
|
10
|
+
import type { MCPConfig } from '../utils/types.js';
|
|
11
|
+
import { MCPServer, type IMCPServer } from './server.js';
|
|
12
|
+
import { MCP2025Server, type MCP2025ServerConfig } from './server-mcp-2025.js';
|
|
13
|
+
import { ProgressiveToolRegistry } from './tool-registry-progressive.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* MCP server feature flags for gradual rollout
|
|
17
|
+
*/
|
|
18
|
+
export interface MCPFeatureFlags {
|
|
19
|
+
// Enable MCP 2025-11 features
|
|
20
|
+
enableMCP2025?: boolean;
|
|
21
|
+
|
|
22
|
+
// Individual feature flags
|
|
23
|
+
enableVersionNegotiation?: boolean;
|
|
24
|
+
enableAsyncJobs?: boolean;
|
|
25
|
+
enableRegistryIntegration?: boolean;
|
|
26
|
+
enableSchemaValidation?: boolean;
|
|
27
|
+
|
|
28
|
+
// Backward compatibility
|
|
29
|
+
supportLegacyClients?: boolean;
|
|
30
|
+
|
|
31
|
+
// Progressive disclosure (already implemented in Phase 1)
|
|
32
|
+
enableProgressiveDisclosure?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Extended MCP configuration with 2025-11 support
|
|
37
|
+
*/
|
|
38
|
+
export interface ExtendedMCPConfig extends MCPConfig {
|
|
39
|
+
// Feature flags
|
|
40
|
+
features?: MCPFeatureFlags;
|
|
41
|
+
|
|
42
|
+
// MCP 2025-11 specific config
|
|
43
|
+
mcp2025?: {
|
|
44
|
+
serverId?: string;
|
|
45
|
+
|
|
46
|
+
// Async job configuration
|
|
47
|
+
async?: {
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
maxJobs?: number;
|
|
50
|
+
jobTTL?: number;
|
|
51
|
+
persistence?: 'memory' | 'redis' | 'sqlite';
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Registry configuration
|
|
55
|
+
registry?: {
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
url?: string;
|
|
58
|
+
apiKey?: string;
|
|
59
|
+
updateInterval?: number;
|
|
60
|
+
retryAttempts?: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Validation configuration
|
|
64
|
+
validation?: {
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
strictMode?: boolean;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Tool discovery
|
|
70
|
+
toolsDirectory?: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* MCP Server Factory
|
|
76
|
+
*
|
|
77
|
+
* Creates appropriate server instance based on configuration:
|
|
78
|
+
* - MCP2025Server if MCP 2025-11 features enabled
|
|
79
|
+
* - Legacy MCPServer for backward compatibility
|
|
80
|
+
*/
|
|
81
|
+
export class MCPServerFactory {
|
|
82
|
+
/**
|
|
83
|
+
* Create MCP server instance based on configuration
|
|
84
|
+
*/
|
|
85
|
+
static async createServer(
|
|
86
|
+
config: ExtendedMCPConfig,
|
|
87
|
+
eventBus: IEventBus,
|
|
88
|
+
logger: ILogger,
|
|
89
|
+
orchestrator?: any,
|
|
90
|
+
swarmCoordinator?: any,
|
|
91
|
+
agentManager?: any,
|
|
92
|
+
resourceManager?: any,
|
|
93
|
+
messagebus?: any,
|
|
94
|
+
monitor?: any
|
|
95
|
+
): Promise<IMCPServer | MCP2025Server> {
|
|
96
|
+
const features = config.features || {};
|
|
97
|
+
|
|
98
|
+
// Determine if MCP 2025-11 should be enabled
|
|
99
|
+
const useMCP2025 = features.enableMCP2025 === true;
|
|
100
|
+
|
|
101
|
+
if (useMCP2025) {
|
|
102
|
+
logger.info('Creating MCP 2025-11 server with enhanced features');
|
|
103
|
+
return await this.createMCP2025Server(
|
|
104
|
+
config,
|
|
105
|
+
eventBus,
|
|
106
|
+
logger,
|
|
107
|
+
orchestrator
|
|
108
|
+
);
|
|
109
|
+
} else {
|
|
110
|
+
logger.info('Creating legacy MCP server (backward compatibility mode)');
|
|
111
|
+
return this.createLegacyServer(
|
|
112
|
+
config,
|
|
113
|
+
eventBus,
|
|
114
|
+
logger,
|
|
115
|
+
orchestrator,
|
|
116
|
+
swarmCoordinator,
|
|
117
|
+
agentManager,
|
|
118
|
+
resourceManager,
|
|
119
|
+
messagebus,
|
|
120
|
+
monitor
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Create MCP 2025-11 server with enhanced features
|
|
127
|
+
*/
|
|
128
|
+
private static async createMCP2025Server(
|
|
129
|
+
config: ExtendedMCPConfig,
|
|
130
|
+
eventBus: IEventBus,
|
|
131
|
+
logger: ILogger,
|
|
132
|
+
orchestrator?: any
|
|
133
|
+
): Promise<MCP2025Server> {
|
|
134
|
+
const features = config.features || {};
|
|
135
|
+
const mcp2025Config = config.mcp2025 || {};
|
|
136
|
+
|
|
137
|
+
// Build MCP 2025-11 server configuration
|
|
138
|
+
const serverConfig: MCP2025ServerConfig = {
|
|
139
|
+
serverId: mcp2025Config.serverId || `claude-flow-${Date.now()}`,
|
|
140
|
+
transport: config.transport || 'stdio',
|
|
141
|
+
|
|
142
|
+
// Feature flags
|
|
143
|
+
enableMCP2025: true,
|
|
144
|
+
supportLegacyClients: features.supportLegacyClients !== false, // Default true
|
|
145
|
+
|
|
146
|
+
// Async jobs
|
|
147
|
+
async: {
|
|
148
|
+
enabled: features.enableAsyncJobs !== false, // Default true
|
|
149
|
+
maxJobs: mcp2025Config.async?.maxJobs || 100,
|
|
150
|
+
jobTTL: mcp2025Config.async?.jobTTL || 3600000, // 1 hour
|
|
151
|
+
persistence: mcp2025Config.async?.persistence || 'memory',
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
// Registry integration
|
|
155
|
+
registry: {
|
|
156
|
+
enabled: features.enableRegistryIntegration === true,
|
|
157
|
+
url: mcp2025Config.registry?.url || 'https://registry.mcp.run',
|
|
158
|
+
apiKey: mcp2025Config.registry?.apiKey,
|
|
159
|
+
updateInterval: mcp2025Config.registry?.updateInterval || 60000,
|
|
160
|
+
retryAttempts: mcp2025Config.registry?.retryAttempts || 3,
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Schema validation
|
|
164
|
+
validation: {
|
|
165
|
+
enabled: features.enableSchemaValidation !== false, // Default true
|
|
166
|
+
strictMode: mcp2025Config.validation?.strictMode || false,
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// Tool registry (progressive disclosure)
|
|
170
|
+
toolsDirectory: mcp2025Config.toolsDirectory,
|
|
171
|
+
orchestratorContext: orchestrator,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// Create and initialize server
|
|
175
|
+
const server = new MCP2025Server(serverConfig, eventBus, logger);
|
|
176
|
+
await server.initialize();
|
|
177
|
+
|
|
178
|
+
logger.info('MCP 2025-11 server created successfully', {
|
|
179
|
+
serverId: serverConfig.serverId,
|
|
180
|
+
features: {
|
|
181
|
+
versionNegotiation: true,
|
|
182
|
+
asyncJobs: serverConfig.async.enabled,
|
|
183
|
+
registry: serverConfig.registry.enabled,
|
|
184
|
+
validation: serverConfig.validation.enabled,
|
|
185
|
+
progressiveDisclosure: true,
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
return server;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Create legacy MCP server for backward compatibility
|
|
194
|
+
*/
|
|
195
|
+
private static createLegacyServer(
|
|
196
|
+
config: ExtendedMCPConfig,
|
|
197
|
+
eventBus: IEventBus,
|
|
198
|
+
logger: ILogger,
|
|
199
|
+
orchestrator?: any,
|
|
200
|
+
swarmCoordinator?: any,
|
|
201
|
+
agentManager?: any,
|
|
202
|
+
resourceManager?: any,
|
|
203
|
+
messagebus?: any,
|
|
204
|
+
monitor?: any
|
|
205
|
+
): MCPServer {
|
|
206
|
+
// Remove extended properties for legacy server
|
|
207
|
+
const legacyConfig: MCPConfig = {
|
|
208
|
+
transport: config.transport,
|
|
209
|
+
host: config.host,
|
|
210
|
+
port: config.port,
|
|
211
|
+
tlsEnabled: config.tlsEnabled,
|
|
212
|
+
enableMetrics: config.enableMetrics,
|
|
213
|
+
auth: config.auth,
|
|
214
|
+
loadBalancer: config.loadBalancer,
|
|
215
|
+
sessionTimeout: config.sessionTimeout,
|
|
216
|
+
maxSessions: config.maxSessions,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const server = new MCPServer(
|
|
220
|
+
legacyConfig,
|
|
221
|
+
eventBus,
|
|
222
|
+
logger,
|
|
223
|
+
orchestrator,
|
|
224
|
+
swarmCoordinator,
|
|
225
|
+
agentManager,
|
|
226
|
+
resourceManager,
|
|
227
|
+
messagebus,
|
|
228
|
+
monitor
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
logger.info('Legacy MCP server created successfully', {
|
|
232
|
+
transport: config.transport,
|
|
233
|
+
mode: 'backward-compatibility',
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
return server;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Detect optimal server configuration based on environment
|
|
241
|
+
*/
|
|
242
|
+
static detectOptimalConfig(currentConfig: MCPConfig): ExtendedMCPConfig {
|
|
243
|
+
const extended: ExtendedMCPConfig = {
|
|
244
|
+
...currentConfig,
|
|
245
|
+
features: {
|
|
246
|
+
// Enable MCP 2025-11 by default in development, opt-in for production
|
|
247
|
+
enableMCP2025: process.env.NODE_ENV !== 'production',
|
|
248
|
+
|
|
249
|
+
// Individual features (can be overridden)
|
|
250
|
+
enableVersionNegotiation: true,
|
|
251
|
+
enableAsyncJobs: true,
|
|
252
|
+
enableRegistryIntegration: false, // Opt-in
|
|
253
|
+
enableSchemaValidation: true,
|
|
254
|
+
supportLegacyClients: true, // Always support legacy
|
|
255
|
+
enableProgressiveDisclosure: true, // Phase 1 feature
|
|
256
|
+
},
|
|
257
|
+
mcp2025: {
|
|
258
|
+
async: {
|
|
259
|
+
enabled: true,
|
|
260
|
+
maxJobs: 100,
|
|
261
|
+
jobTTL: 3600000,
|
|
262
|
+
persistence: 'memory',
|
|
263
|
+
},
|
|
264
|
+
registry: {
|
|
265
|
+
enabled: false,
|
|
266
|
+
url: process.env.MCP_REGISTRY_URL || 'https://registry.mcp.run',
|
|
267
|
+
apiKey: process.env.MCP_REGISTRY_API_KEY,
|
|
268
|
+
},
|
|
269
|
+
validation: {
|
|
270
|
+
enabled: true,
|
|
271
|
+
strictMode: false,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
return extended;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Validate server configuration
|
|
281
|
+
*/
|
|
282
|
+
static validateConfig(config: ExtendedMCPConfig): {
|
|
283
|
+
valid: boolean;
|
|
284
|
+
errors: string[];
|
|
285
|
+
warnings: string[];
|
|
286
|
+
} {
|
|
287
|
+
const errors: string[] = [];
|
|
288
|
+
const warnings: string[] = [];
|
|
289
|
+
|
|
290
|
+
// Basic validation
|
|
291
|
+
if (!config.transport) {
|
|
292
|
+
errors.push('Transport type is required');
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// MCP 2025-11 specific validation
|
|
296
|
+
if (config.features?.enableMCP2025) {
|
|
297
|
+
if (config.features.enableRegistryIntegration && !config.mcp2025?.registry?.apiKey) {
|
|
298
|
+
warnings.push('Registry integration enabled but no API key provided');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (config.mcp2025?.async?.persistence === 'redis') {
|
|
302
|
+
warnings.push('Redis persistence not yet implemented, falling back to memory');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (config.mcp2025?.async?.persistence === 'sqlite') {
|
|
306
|
+
warnings.push('SQLite persistence not yet implemented, falling back to memory');
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Transport validation
|
|
311
|
+
if (config.transport === 'http') {
|
|
312
|
+
if (!config.host) {
|
|
313
|
+
warnings.push('HTTP transport enabled but no host specified, using default');
|
|
314
|
+
}
|
|
315
|
+
if (!config.port) {
|
|
316
|
+
warnings.push('HTTP transport enabled but no port specified, using default');
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
valid: errors.length === 0,
|
|
322
|
+
errors,
|
|
323
|
+
warnings,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Convenience function for creating MCP server
|
|
330
|
+
*/
|
|
331
|
+
export async function createMCPServer(
|
|
332
|
+
config: MCPConfig | ExtendedMCPConfig,
|
|
333
|
+
eventBus: IEventBus,
|
|
334
|
+
logger: ILogger,
|
|
335
|
+
options?: {
|
|
336
|
+
orchestrator?: any;
|
|
337
|
+
swarmCoordinator?: any;
|
|
338
|
+
agentManager?: any;
|
|
339
|
+
resourceManager?: any;
|
|
340
|
+
messagebus?: any;
|
|
341
|
+
monitor?: any;
|
|
342
|
+
autoDetectFeatures?: boolean;
|
|
343
|
+
}
|
|
344
|
+
): Promise<IMCPServer | MCP2025Server> {
|
|
345
|
+
// Auto-detect optimal configuration if requested
|
|
346
|
+
const extendedConfig = options?.autoDetectFeatures
|
|
347
|
+
? MCPServerFactory.detectOptimalConfig(config)
|
|
348
|
+
: (config as ExtendedMCPConfig);
|
|
349
|
+
|
|
350
|
+
// Validate configuration
|
|
351
|
+
const validation = MCPServerFactory.validateConfig(extendedConfig);
|
|
352
|
+
|
|
353
|
+
if (!validation.valid) {
|
|
354
|
+
throw new Error(`Invalid MCP configuration: ${validation.errors.join(', ')}`);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Log warnings
|
|
358
|
+
for (const warning of validation.warnings) {
|
|
359
|
+
logger.warn('MCP configuration warning', { warning });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Create server
|
|
363
|
+
return await MCPServerFactory.createServer(
|
|
364
|
+
extendedConfig,
|
|
365
|
+
eventBus,
|
|
366
|
+
logger,
|
|
367
|
+
options?.orchestrator,
|
|
368
|
+
options?.swarmCoordinator,
|
|
369
|
+
options?.agentManager,
|
|
370
|
+
options?.resourceManager,
|
|
371
|
+
options?.messagebus,
|
|
372
|
+
options?.monitor
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Check if MCP 2025-11 features are available
|
|
378
|
+
*/
|
|
379
|
+
export function isMCP2025Available(): boolean {
|
|
380
|
+
try {
|
|
381
|
+
// Check if required dependencies are available
|
|
382
|
+
require.resolve('uuid');
|
|
383
|
+
require.resolve('ajv');
|
|
384
|
+
require.resolve('ajv-formats');
|
|
385
|
+
return true;
|
|
386
|
+
} catch {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Get MCP server capabilities based on configuration
|
|
393
|
+
*/
|
|
394
|
+
export function getServerCapabilities(config: ExtendedMCPConfig): string[] {
|
|
395
|
+
const capabilities: string[] = [];
|
|
396
|
+
|
|
397
|
+
if (config.features?.enableMCP2025) {
|
|
398
|
+
capabilities.push('mcp-2025-11');
|
|
399
|
+
|
|
400
|
+
if (config.features.enableVersionNegotiation) {
|
|
401
|
+
capabilities.push('version-negotiation');
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (config.features.enableAsyncJobs) {
|
|
405
|
+
capabilities.push('async-jobs');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (config.features.enableRegistryIntegration) {
|
|
409
|
+
capabilities.push('registry');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (config.features.enableSchemaValidation) {
|
|
413
|
+
capabilities.push('schema-validation');
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (config.features.enableProgressiveDisclosure) {
|
|
417
|
+
capabilities.push('progressive-disclosure');
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (config.features?.supportLegacyClients !== false) {
|
|
422
|
+
capabilities.push('backward-compatible');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return capabilities;
|
|
426
|
+
}
|