2.home-manager/tests/modules/programs/claude-code/mcp-integration.nix
Austin Horstman 1c029fb0dc claude-code: load plugins without wrapper
Persist managed plugins in Claude Code's personal skills directory so strict-parser subcommands do not receive injected --plugin-dir arguments. Retain version-gated legacy behavior for older and unversioned packages.
2026-07-10 14:19:11 -05:00

76 lines
1.9 KiB
Nix

{
programs = {
claude-code = {
package = null;
enable = true;
enableMcpIntegration = true;
mcpServers = {
github = {
type = "http";
url = "https://api.githubcopilot.com/mcp/";
enabled = true;
};
filesystem = {
type = "stdio";
command = "npx";
args = [
"-y"
"@modelcontextprotocol/server-filesystem"
"/tmp"
];
};
};
};
mcp = {
enable = true;
servers = {
filesystem = {
type = "stdio";
command = "npx";
args = [
"-y"
"@modelcontextprotocol/server-filesystem"
"/other-tmp"
];
};
database = {
command = "npx";
args = [
"-y"
"@bytebase/dbhub"
"--dsn"
"postgresql://user:pass@localhost:5432/db"
];
env = {
DATABASE_URL = "postgresql://user:pass@localhost:5432/db";
};
};
customTransport = {
type = "websocket";
url = "wss://example.com/mcp";
customOption = "value";
timeout = 5000;
};
disabled-server = {
command = "echo";
args = [ "test" ];
disabled = true;
};
};
};
};
nmt.script = ''
assertPathNotExists "$TESTED/home-path/bin/claude"
pluginDir="$TESTED/home-files/.claude/skills/claude-code-home-manager"
assertFileContent "$pluginDir/.claude-plugin/plugin.json" ${./expected-plugin-manifest.json}
assertFileContent "$pluginDir/.mcp.json" ${./expected-mcp-integration-plugin.json}
assertPathNotExists "$pluginDir/.lsp.json"
settingsPath="$TESTED/home-files/.claude/settings.json"
assertFileContent "$settingsPath" ${./expected-mcp-settings.json}
'';
}