Skip to content

fix: use {"mcpServers":{}} instead of {} for empty MCP config#440

Open
sebastiankraska wants to merge 1 commit into
nashsu:mainfrom
sebastiankraska:fix-provider-test-fail
Open

fix: use {"mcpServers":{}} instead of {} for empty MCP config#440
sebastiankraska wants to merge 1 commit into
nashsu:mainfrom
sebastiankraska:fix-provider-test-fail

Conversation

@sebastiankraska

Copy link
Copy Markdown

Fixes #437

Note

I am not a Rust developer. I used Claude Code to fix this.

What I experienced

Clicking Test connection under Settings > LLM Models > Claude Code CLI (local) failed with:

claude CLI exited with code 1: Error: Invalid MCP configuration: mcpServers: Invalid input: expected record, received undefined

This happened regardless of the "Isolate local CLI configuration" toggle.

Root cause

When the connection test runs with isolation enabled, LLM Wiki passes --mcp-config {} to the Claude CLI.

Newer versions of Claude CLI validate that the JSON contains a mcpServers key. {} leaves it as undefined, which fails schema validation.

Fix

Pass {"mcpServers":{}} instead of {}. The config is still empty (no MCP servers), but the required key is now explicitly present. Updated the unit test to match.

Verified

After the fix, Test connection succeeds: Connected in 2450 ms. Response: Ready

@wangxw03

Copy link
Copy Markdown

thanks a lot!wish this pr merged as soon as possible !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants