-
Notifications
You must be signed in to change notification settings - Fork 31
Feat/implement mcp #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/implement mcp #151
Conversation
Code ReviewI've found several issues in this PR that need attention: 1. 🐛 Critical Bug: Debounce function doesn't actually debounceFile: The This is used in Fix: The function needs to track and clear the timer: export function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void {
let timer: ReturnType<typeof setTimeout>;
return (...args: Parameters<T>) => {
clearTimeout(timer);
timer = setTimeout(() => {
func(...args);
}, delay);
};
}Reference: Lines 1 to 8 in cd100d9
2. 🔒 Security: Missing admin authorization on reconnect endpointFile: The While the UI only shows the reconnect button to admins, any authenticated user can call Fix: Change to reconnect: adminProtectedProcedure.mutation(async () => {
await mcpService.handleCacheMcpServerState();
return mcpService.cachedMcpState;
}),Reference: nao/apps/backend/src/trpc/mcp.routes.ts Lines 8 to 13 in cd100d9
3. 📝 CLAUDE.md: Use full names instead of abbreviationsPer CLAUDE.md: "Use descriptive names — code should read like prose; avoid abbreviations" a)
Reference: nao/apps/backend/src/utils/utils.ts Lines 44 to 50 in cd100d9
b)
Reference: nao/apps/backend/src/mcp/mcp.client.ts Lines 7 to 9 in cd100d9
4. 📝 CLAUDE.md: Remove unnecessary JSDoc commentFile: Per CLAUDE.md: "Minimize comments — only comment complex or ambiguous logic" The 5-line JSDoc on Recommendation: Remove the JSDoc comment. Reference: nao/apps/backend/src/utils/tools.ts Lines 231 to 239 in cd100d9
|
|
Remove the changes in the |
760a942 to
9eb6773
Compare
Standlc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the MCP service and client classes not well integrated and architected. They both share always the same properties (cached tools for example) and seem to be at the same level of abstraction (the client doesn't really do more "low" level things than the service that parses the mcp config (which is pretty low level) for example).
The "client" really handles all the MCP servers and tools, which is not what a client typically does (a client should be given the configuration for what server to talk to how to talk to it).
Some method names could be clearer: handleCacheMcpServerState gives a lot of details (caching, state, server) about the internals of the service. Instead, loadTools is clear, accurate, and straight to the point.
…hing into mcp.service
69be439 to
a3c0fb2
Compare
a3c0fb2 to
96c2b13
Compare
Enregistrement.de.l.ecran.2026-02-09.a.16.26.45.mov