mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
mcp: init module
This commit is contained in:
parent
1f34c2c855
commit
083b20c1a0
5 changed files with 119 additions and 0 deletions
4
tests/modules/programs/mcp/default.nix
Normal file
4
tests/modules/programs/mcp/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
mcp-servers = ./servers.nix;
|
||||
mcp-empty-servers = ./empty-servers.nix;
|
||||
}
|
||||
9
tests/modules/programs/mcp/empty-servers.nix
Normal file
9
tests/modules/programs/mcp/empty-servers.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = { };
|
||||
};
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/mcp/mcp.json
|
||||
'';
|
||||
}
|
||||
17
tests/modules/programs/mcp/mcp.json
Normal file
17
tests/modules/programs/mcp/mcp.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"mcpServers": {
|
||||
"context7": {
|
||||
"headers": {
|
||||
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
|
||||
},
|
||||
"serverUrl": "https://mcp.context7.com/mcp"
|
||||
},
|
||||
"everything": {
|
||||
"args": [
|
||||
"-y",
|
||||
"@modelcontextprotocol/server-everything"
|
||||
],
|
||||
"command": "npx"
|
||||
}
|
||||
}
|
||||
}
|
||||
25
tests/modules/programs/mcp/servers.nix
Normal file
25
tests/modules/programs/mcp/servers.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
everything = {
|
||||
command = "npx";
|
||||
args = [
|
||||
"-y"
|
||||
"@modelcontextprotocol/server-everything"
|
||||
];
|
||||
};
|
||||
context7 = {
|
||||
serverUrl = "https://mcp.context7.com/mcp";
|
||||
headers = {
|
||||
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/mcp/mcp.json
|
||||
assertFileContent home-files/.config/mcp/mcp.json \
|
||||
${./mcp.json}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue