mcp-omnisearch
Version:
MCP server for integrating Omnisearch with LLMs
26 lines (25 loc) • 1.13 kB
JavaScript
import { ErrorType, ProviderError, } from '../../common/types.js';
import { GitHubSearchProvider } from '../search/github/index.js';
export class UnifiedGitHubSearchProvider {
constructor() {
this.name = 'github_search';
this.description = 'Search GitHub for code, repositories, or users. Supports advanced syntax (filename:, path:, repo:, user:, language:, in:file).';
this.provider = new GitHubSearchProvider();
}
async search(params) {
const { search_type = 'code', sort, ...searchParams } = params;
switch (search_type) {
case 'code':
return this.provider.search_code(searchParams);
case 'repositories':
return this.provider.search_repositories({
...searchParams,
sort,
});
case 'users':
return this.provider.search_users(searchParams);
default:
throw new ProviderError(ErrorType.INVALID_INPUT, `Invalid search_type: ${search_type}. Valid options: code, repositories, users`, this.name);
}
}
}