UNPKG

mongodocs-mcp

Version:

Lightning-fast semantic search for MongoDB documentation via Model Context Protocol. 10,000+ documents, <500ms search.

83 lines 1.98 kB
/** * Universal Document Fetcher - The ONLY fetcher you need * Intelligently fetches from GitHub, Web, and APIs * * This replaces: * - DocumentFetcher (GitHub only) * - VoyageDocumentFetcher (Voyage only) * - MegaDocumentFetcher (overcomplicated) * - Inline fetching in index-docs.ts */ import { Document } from '../types/index.js'; export interface FetchSource { type: 'github' | 'web' | 'api'; name: string; repo?: string; branch?: string; url?: string; product: string; version: string; priority: number; } export declare class UniversalFetcher { private githubToken; private rateLimiter; constructor(); /** * Fetch from any source intelligently */ fetchFromSource(source: FetchSource): Promise<Document[]>; /** * Fetch from multiple sources in parallel */ fetchFromSources(sources: FetchSource[]): Promise<Document[]>; /** * GitHub repository fetching (optimized from original) */ private fetchFromGitHub; /** * Web page fetching (from original mega-fetcher) */ private fetchFromWeb; /** * API fetching (for future expansion) */ private fetchFromAPI; /** * Clone or update a git repository */ private cloneOrUpdateRepo; /** * Find documentation files recursively */ private findDocFiles; /** * Process a file into a document */ private processFile; /** * Process API response item */ private processAPIItem; /** * Clean content based on file type */ private cleanContent; /** * Extract clean text from HTML */ private extractCleanText; /** * Extract title from content */ private extractTitle; /** * Generate unique document ID */ private generateId; /** * Deduplicate documents by ID */ private deduplicateDocuments; } //# sourceMappingURL=universal-fetcher.d.ts.map