-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
The MCP server's tool handlers are async functions but are called without await in src/mcp/server.ts. This causes all MCP tools (get_rules, get_pending_rules, etc.) to return {} instead of actual data.
Root Cause
In src/mcp/server.ts, lines ~200-250:
case 'get_rules': {
const parsed = GetRulesInputSchema.parse(args);
const result = handleGetRules(parsed); // ← Missing await!
return {
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
};
}Since handleGetRules is defined as async function, calling it without await returns a Promise. When JSON.stringify serializes a Promise, it outputs {}.
Impact
get_rulesreturns{}instead of{ rules: [...] }get_pending_rulesreturns{}instead of{ rules: [...] }- All MCP tools return empty objects instead of actual data
Reproduction
- Install claude-learner v2.0.0
- Log a correction via
log_correctiontool - Call
get_rulesorget_pending_rules - Observe empty
{}response
Fix
Add await to all handler calls in src/mcp/server.ts:
case 'get_rules': {
const parsed = GetRulesInputSchema.parse(args);
const result = await handleGetRules(parsed); // ← Add await
return {
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
};
}Same fix needed for: handleCheckRule, handleLogCorrection, handleGetPendingRules, handleApproveRule, handleRejectRule, handleRecordCompliance
Workaround
Use CLI commands (claude-learner rules) or query SQLite directly until fixed.
Environment
- claude-learner v2.0.0
- Node v22.21.1
- Linux
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels