claude-code: load MCP config via plugin dir
Claude Code rejects `--mcp-config` once the Home Manager wrapper injects it around subcommands, which breaks commands like `claude mcp list`. Claude Code 2.1.76 fixed `--plugin-dir` so it no longer consumes following subcommands, so use that path for the generated MCP config instead. Generate a plugin directory with a manifest and `.mcp.json`, wrap `claude` with `--plugin-dir` before user arguments, and snapshot that wrapper directly in the tests. Keep the existing LSP support in the generated plugin directory as well, and add coverage for the combined MCP+LSP case plus the MCP integration merge path. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
d47357a4c8
commit
4fcef56c15
11 changed files with 205 additions and 39 deletions
36
tests/modules/programs/claude-code/expected-mcp-plugin.json
Normal file
36
tests/modules/programs/claude-code/expected-mcp-plugin.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"mcpServers": {
|
||||
"customTransport": {
|
||||
"customOption": "value",
|
||||
"timeout": 5000,
|
||||
"type": "websocket",
|
||||
"url": "wss://example.com/mcp"
|
||||
},
|
||||
"database": {
|
||||
"args": [
|
||||
"-y",
|
||||
"@bytebase/dbhub",
|
||||
"--dsn",
|
||||
"postgresql://user:pass@localhost:5432/db"
|
||||
],
|
||||
"command": "npx",
|
||||
"env": {
|
||||
"DATABASE_URL": "postgresql://user:pass@localhost:5432/db"
|
||||
},
|
||||
"type": "stdio"
|
||||
},
|
||||
"filesystem": {
|
||||
"args": [
|
||||
"-y",
|
||||
"@modelcontextprotocol/server-filesystem",
|
||||
"/tmp"
|
||||
],
|
||||
"command": "npx",
|
||||
"type": "stdio"
|
||||
},
|
||||
"github": {
|
||||
"type": "http",
|
||||
"url": "https://api.githubcopilot.com/mcp/"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue