diff --git a/client/src/types.ts b/client/src/types.ts index 8844d57..4a2afb4 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -23,4 +23,7 @@ export interface MCPServer { features?: string[]; prerequisites?: string[]; lastEnrichmentTime?: number; + githubLatestCommit?: string; + githubForks?: number; + licenseType?: string | null; } \ No newline at end of file diff --git a/server/src/lib/githubEnrichment.ts b/server/src/lib/githubEnrichment.ts index 80a20cf..61d46ad 100644 --- a/server/src/lib/githubEnrichment.ts +++ b/server/src/lib/githubEnrichment.ts @@ -37,7 +37,7 @@ export interface EnrichedMcpServer extends McpServer { latest_commit_id?: string; fork_count?: number; owner_name?: string; - license_type?: string | null; + license_type?: string | undefined; } /** @@ -115,7 +115,7 @@ export interface GithubRepoInfo { latest_commit_id: string; fork_count: number; owner_name: string; - license_type: string | null; // Will be null if no license information available + license_type: string | undefined; // Will be undefined if no license information available } /** @@ -161,7 +161,7 @@ export async function fetchGithubInfo(githubUrl: string): Promise { // If a is recommended and b is not, a comes first if (a.isRecommended && !b.isRecommended) return -1; // If b is recommended and a is not, b comes first if (!a.isRecommended && b.isRecommended) return 1; - // If both have the same recommendation status, maintain original order - return 0; + // If both have the same recommendation status, sort by githubStars (descending) + return (b.githubStars || 0) - (a.githubStars || 0); }); // Apply pagination if parameters are provided @@ -231,7 +232,7 @@ router.post('/search_servers', async (req: Request, res: Response): Promise