@hpbyte/h-codex-mcp
Version:
Model Context Protocol for h-codexx
38 lines • 1.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const h_codex_core_1 = require("@hpbyte/h-codex-core");
const schemas_1 = require("./schemas");
class CodeSearchTool {
register(server) {
server.registerTool('code-search', {
title: 'Semantically search the codebase',
description: 'Perform semantic search on indexed code chunks',
inputSchema: schemas_1.CodeSearchInputSchema,
}, async ({ query, projects }) => {
try {
const result = await h_codex_core_1.semanticSearch.search(query, { projects });
return {
content: [
{
type: 'text',
text: JSON.stringify(result, null, 2),
},
],
};
}
catch (error) {
return {
content: [
{
type: 'text',
text: `Error searching code: ${error instanceof Error ? error.message : String(error)}`,
},
],
};
}
});
}
}
const tool = new CodeSearchTool();
exports.default = tool;
//# sourceMappingURL=code-search.js.map