fix: resolve tool count discrepancy in Docker environments (#6)

- Implement dynamic n8n API configuration checking
- Remove static config export in favor of lazy getter function
- Fix management tools not being registered when env vars set after startup
- Optimize logger performance with cached environment variables
- Clean up debug logging and remove console.error usage
- Bump version to 2.7.1

This ensures all 38 tools (22 documentation + 16 management) are properly
registered regardless of when environment variables become available.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-01 10:41:09 +02:00
parent d291709774
commit 71385cc7ef
7 changed files with 78 additions and 55 deletions

View File

@@ -40,11 +40,14 @@ const workflowDiffSchema = z.object({
export async function handleUpdatePartialWorkflow(args: unknown): Promise<McpToolResponse> {
try {
// Debug: Log what Claude Desktop sends
logger.info('[DEBUG] Full args from Claude Desktop:', JSON.stringify(args, null, 2));
logger.info('[DEBUG] Args type:', typeof args);
if (args && typeof args === 'object') {
logger.info('[DEBUG] Args keys:', Object.keys(args as any));
// Debug logging (only in debug mode)
if (process.env.DEBUG_MCP === 'true') {
logger.debug('Workflow diff request received', {
argsType: typeof args,
hasWorkflowId: args && typeof args === 'object' && 'workflowId' in args,
operationCount: args && typeof args === 'object' && 'operations' in args ?
(args as any).operations?.length : 0
});
}
// Validate input