1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 23:21:02 +01:00
home-manager/tests/modules/programs/claude-code/mcp.nix
Austin Horstman 8b4ac14968
claude-code: init module (#7685)
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-16 21:33:06 -05:00

55 lines
1.2 KiB
Nix

{ config, ... }:
{
programs.claude-code = {
package = config.lib.test.mkStubPackage {
name = "claude-code";
buildScript = ''
mkdir -p $out/bin
touch $out/bin/claude
chmod 755 $out/bin/claude
'';
};
enable = true;
mcpServers = {
github = {
type = "http";
url = "https://api.githubcopilot.com/mcp/";
};
filesystem = {
type = "stdio";
command = "npx";
args = [
"-y"
"@modelcontextprotocol/server-filesystem"
"/tmp"
];
};
database = {
type = "stdio";
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;
};
};
};
nmt.script = ''
normalizedWrapper=$(normalizeStorePaths home-path/bin/claude)
assertFileContent $normalizedWrapper ${./expected-mcp-wrapper}
'';
}