Adjust test and allow running in interactive mode

This commit is contained in:
Paul Carleton 2025-10-30 13:26:21 +00:00
commit b78f6a54df
No known key found for this signature in database

View file

@ -31,29 +31,17 @@ export function createClientInitializationCheck(initializeRequest: any, expected
};
}
export function createServerInfoCheck(serverInfo: { name?: string; version?: string } | null): ConformanceCheck {
const hasName = !!serverInfo?.name;
const hasVersion = !!serverInfo?.version;
const status: CheckStatus = hasName && hasVersion ? 'SUCCESS' : 'FAILURE';
const errors: string[] = [];
if (!hasName) errors.push('Server name missing');
if (!hasVersion) errors.push('Server version missing');
export function createServerInfoCheck(serverInfo: { name: string; version: string }): ConformanceCheck {
return {
id: 'server-info',
name: 'ServerInfo',
description: 'Test server info returned to client',
status,
status: 'INFO',
timestamp: new Date().toISOString(),
specReferences: [{ id: 'MCP-Lifecycle', url: 'https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle' }],
details: {
serverName: serverInfo?.name,
serverVersion: serverInfo?.version,
hasName,
hasVersion
},
errorMessage: errors.length > 0 ? errors.join('; ') : undefined,
logs: errors.length > 0 ? errors : undefined
serverName: serverInfo.name,
serverVersion: serverInfo.version
}
};
}