A Nix-based configuration framework for MCP servers with declarative module management and multi-client config generation, supporting Claude Desktop, VS Code, Zed and more.
mcp-servers-nix is a Nix-based configuration framework for Model Control Protocol (MCP) servers, designed to address scattered configurations and lack of reproducibility.
Key Features#
- Modular Configuration: Declaratively enable and compose multiple MCP servers via
programs.<name>.enable - Reproducible Builds: Nix ensures reproducible and declarative server configuration management
- Secure Credential Handling: Load sensitive information at runtime via
envFileandpasswordCommand, avoiding hardcoded secrets in/nix/store - Multi-Client Output: Supports Claude Desktop, Claude Code, VS Code, Codex CLI, OpenCode, Zed config formats
- Multi-Framework Integration: Flakes, flake-parts, devenv, Home Manager
- Version Pinning: Server versions are pinned for improved stability
Project Structure#
.
├── flake.nix # Flake entry point
├── default.nix # Classic Nix entry
├── lib/ # Core library functions
├── modules/
│ ├── flake-parts.nix # Flake-parts integration
│ ├── devenv.nix # devenv integration
│ └── servers/ # MCP server module definitions
├── pkgs/
│ ├── official/ # Official server packages
│ ├── reference/ # Reference implementations
│ └── community/ # Community packages
├── tests/ # Automated tests
├── examples/ # Example configurations
└── docs/ # Documentation
Quick Start#
Run MCP server directly (no installation required):
nix run github:natsukium/mcp-servers-nix#mcp-server-fetch
Generate configuration file:
let
pkgs = import <nixpkgs> { };
mcp-servers-nix = import (fetchTarball
"https://github.com/natsukium/mcp-servers-nix/archive/main.tar.gz") { inherit pkgs; };
in
mcp-servers-nix.lib.mkConfig pkgs {
programs.filesystem = {
enable = true;
args = [ "/path/to/allowed/directory" ];
};
}
Supported Output Formats#
| Client | Config File |
|---|---|
| Claude Desktop | claude_desktop_config.json |
| Claude Code | .mcp.json |
| VS Code | settings.json / .vscode/mcp.json |
| Codex CLI | .mcp.toml |
| OpenCode | opencode.json |
| Zed | context_servers |
Available Modules#
clickup, codex, context7, deepl, esa, everything, fetch, filesystem, git, github, grafana, mastra, memory, netdata, nixos, notion, playwright, sequential-thinking, serena, slite, tavily, terraform, textlint, time and 20+ pre-configured servers.
Security Configuration#
programs.github = {
enable = true;
envFile = /path/to/secrets/.env;
passwordCommand = "pass mcp/github";
};
Primary languages: Nix (97.7%), Python (1.3%), Shell (1.0%). License: Apache-2.0.