feat: implement MCP v2 improvements - simple MVP fixes
Based on Claude Desktop evaluation feedback, implemented minimal fixes: ## Day 1 - Deploy & Debug - Added /version and /test-tools endpoints for deployment verification - Added debug logging to list_nodes and list_ai_tools - Fixed version display in health and initialization responses ## Day 2 - Core Fixes - Fixed multi-word search to handle phrases like "send slack message" - Added property deduplication to eliminate duplicate webhook/email properties - Fixed package name mismatch to handle both formats (@n8n/ prefix variations) ## Day 3 - Polish & Test - Added simple in-memory cache with 1-hour TTL for essentials - Added documentation fallback when nodes lack documentation - All features tested and verified working Total code changes: ~62 lines as planned No overengineering, just simple focused fixes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
37
src/utils/simple-cache.ts
Normal file
37
src/utils/simple-cache.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Simple in-memory cache with TTL support
|
||||
* No external dependencies needed
|
||||
*/
|
||||
export class SimpleCache {
|
||||
private cache = new Map<string, { data: any; expires: number }>();
|
||||
|
||||
constructor() {
|
||||
// Clean up expired entries every minute
|
||||
setInterval(() => {
|
||||
const now = Date.now();
|
||||
for (const [key, item] of this.cache.entries()) {
|
||||
if (item.expires < now) this.cache.delete(key);
|
||||
}
|
||||
}, 60000);
|
||||
}
|
||||
|
||||
get(key: string): any {
|
||||
const item = this.cache.get(key);
|
||||
if (!item || item.expires < Date.now()) {
|
||||
this.cache.delete(key);
|
||||
return null;
|
||||
}
|
||||
return item.data;
|
||||
}
|
||||
|
||||
set(key: string, data: any, ttlSeconds: number = 300): void {
|
||||
this.cache.set(key, {
|
||||
data,
|
||||
expires: Date.now() + (ttlSeconds * 1000)
|
||||
});
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.cache.clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user