openapi-directory-mcp
Version:
Model Context Protocol server for accessing enhanced triple-source OpenAPI directory (APIs.guru + additional APIs + custom imports)
127 lines • 4.47 kB
TypeScript
import { ICacheManager } from "../cache/types.js";
import { ApiGuruAPI, ApiGuruMetrics, ApiGuruServices } from "../types/api.js";
import { ProviderStats } from "../utils/version-data.js";
/**
* Triple-source API client that combines data from primary (APIs.guru), secondary, and custom sources
* Precedence: Custom > Secondary > Primary (Custom always wins)
*/
export declare class DualSourceApiClient {
private primaryClient;
private secondaryClient;
private customClient;
private cache;
constructor(primaryBaseURL: string, secondaryBaseURL: string, cacheManager: ICacheManager);
private fetchWithCache;
/**
* List all providers from all three sources
*/
getProviders(): Promise<{
data: string[];
}>;
/**
* List all APIs for a particular provider from all sources
* Custom specs take precedence over secondary and primary
*/
getProvider(provider: string): Promise<Record<string, ApiGuruAPI>>;
/**
* List all serviceNames for a particular provider
* Try custom first, then secondary, then primary
*/
getServices(provider: string): Promise<ApiGuruServices>;
/**
* Retrieve one version of a particular API (without service)
* Custom takes highest precedence, then secondary, then primary
*/
getAPI(provider: string, api: string): Promise<ApiGuruAPI>;
/**
* Retrieve one version of a particular API with a serviceName
* Custom takes highest precedence, then secondary, then primary
*/
getServiceAPI(provider: string, service: string, api: string): Promise<ApiGuruAPI>;
/**
* List all APIs from all three sources with custom taking highest precedence
*/
listAPIs(): Promise<Record<string, ApiGuruAPI>>;
/**
* Get paginated APIs with minimal data from all three sources
*/
getPaginatedAPIs(page?: number, limit?: number): Promise<{
results: Array<{
id: string;
title: string;
description: string;
provider: string;
preferred: string;
categories: string[];
}>;
pagination: {
page: number;
limit: number;
total_results: number;
total_pages: number;
has_next: boolean;
has_previous: boolean;
};
}>;
/**
* Get API directory summary from both sources
*/
getAPISummary(): Promise<{
total_apis: number;
total_providers: number;
categories: string[];
popular_apis: Array<{
id: string;
title: string;
provider: string;
}>;
recent_updates: Array<{
id: string;
title: string;
updated: string;
}>;
}>;
/**
* Get combined metrics from all three sources accounting for overlaps
*/
getMetrics(): Promise<ApiGuruMetrics>;
/**
* Search APIs across all three sources with intelligent merging
*/
searchAPIs(query: string, provider?: string, page?: number, limit?: number): Promise<{
results: Array<{
id: string;
title: string;
description: string;
provider: string;
preferred: string;
categories: string[];
}>;
pagination: {
page: number;
limit: number;
total_results: number;
total_pages: number;
has_next: boolean;
has_previous: boolean;
};
}>;
getAPISummaryById(apiId: string): Promise<any>;
getAPIEndpoints(apiId: string, page?: number, limit?: number, tag?: string): Promise<any>;
getEndpointDetails(apiId: string, method: string, path: string): Promise<any>;
getEndpointSchema(apiId: string, method: string, path: string): Promise<any>;
getEndpointExamples(apiId: string, method: string, path: string): Promise<any>;
getOpenAPISpec(url: string): Promise<any>;
getPopularAPIs(): Promise<Record<string, ApiGuruAPI>>;
getRecentlyUpdatedAPIs(limit?: number): Promise<Record<string, ApiGuruAPI>>;
getProviderStats(provider: string): Promise<ProviderStats>;
/**
* Invalidate caches that depend on custom specs
*/
invalidateCustomSpecCaches(): void;
/**
* Warm critical caches after custom spec changes
*/
warmCriticalCaches(): Promise<void>;
}
//# sourceMappingURL=dual-source-client.d.ts.map