mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Extract MCP-related helper functions (renderEnv, mkEnvFilesWrapper, wrapEnvFilesCommand, addType, transformMcpServer) into a new shared library module at modules/lib/mcp.nix. - Add lib.hm.mcp for sharing transformMcpServer logic across consumers - Add enabled/disabled conflict detection assertion - Add tests for new library functions
27 lines
588 B
Nix
27 lines
588 B
Nix
{
|
|
programs.mcp = {
|
|
enable = true;
|
|
servers = {
|
|
everything = {
|
|
command = "npx";
|
|
args = [
|
|
"-y"
|
|
"@modelcontextprotocol/server-everything"
|
|
];
|
|
env.NPM_TOKEN.file = "/run/secrets/npm-token";
|
|
};
|
|
context7 = {
|
|
url = "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}
|
|
'';
|
|
}
|