@dw8k/mcp-fallback-server
Version:
MCP fallback server that extracts keywords from prompts and triggers tool recommendations.
26 lines • 902 B
JavaScript
import axios from 'axios';
import { config } from '../config/index.js';
/**
* Adapts the RecommendationNotifier port to interact with the GUI Backend API.
*/
export class GuiAdapter {
http;
constructor() {
this.http = axios.create({
baseURL: config.guiBeApiBaseUrl,
});
}
async notifyKeywords(keywords) {
try {
await this.http.post('/recommendations', { keywords });
// console.log(`Keywords notification sent: ${keywords.join(', ')}`);
}
catch (error) {
console.error('Error sending keywords notification to GUI backend:', error);
// Depending on error handling strategy, you might throw a custom error.
// For now, we just log the error.
// throw new Error('Failed to send keywords to GUI backend.');
}
}
}
//# sourceMappingURL=gui.adapter.js.map