Get the FREE Ultimate OpenClaw Setup Guide →

mcp s-nix

A Nix-based configuration framework for Model Control Protocol (MCP) servers with ready-to-use packages.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio natsukium-mcp-servers-nix nix run github:natsukium/mcp-servers-nix#mcp-server-fetch \
  --env NIX_PATH="to-be-configured" \
  --env MCP_SERVER_NAME="fetch"

How to use

mcp-servers-nix provides a Nix-based framework for configuring and deploying MCP servers. It offers a modular approach where you can compose multiple server configurations and deploy them declaratively using Nix flakes, flake-parts, devenv, or Home Manager. The repository includes pre-configured modules for a variety of common MCP servers and an example command to fetch and run an MCP server directly. You can also use the mkConfig workflow to generate a server-specific configuration file that integrates with different editor/IDE targets (Claude Desktop, Claude Code, VS Code, Codex CLI, etc.). The primary workflow is to fetch a pre-packaged MCP server and run it, or to build a custom configuration with mkConfig and then run the resulting server bundle. The available modules cover a broad set of integrations, enabling you to tailor credentials, envFile handling, and security-focused options while pinning server versions for reproducibility.

How to install

Prerequisites:

  • Nix installed on the host (with Flakes support if you plan to use flakes)
  • Basic familiarity with Nix expressions and, optionally, flakes or flake-parts workflows

Install and run a server:

  1. Install Nix and enable flakes if you plan to use flake-based configurations.

  2. Fetch and run a pre-configured MCP server package provided by the project:

    nix run github:natsukium/mcp-servers-nix#mcp-server-fetch

  3. Optionally generate a configuration file using mkConfig and a minimal base configuration:

    nix-build config.nix && cat result

    The output will be a JSON-like mcpServers object that you can feed into your deployment workflow. Example of a generated configuration:

    { "mcpServers": { "filesystem": { "command": "/nix/store/...-mcp-server-filesystem-.../bin/mcp-server-filesystem", "args": [ "/path/to/allowed/directory" ] } } }

  4. Deploy the generated configuration using your preferred method (Flakes, flake-parts, devenv, or Home Manager) and start the MCP server according to your environment.

Notes:

  • If you plan to wire in credentials or secrets, consider using the repo’s envFile and passwordCommand approaches for secure handling.
  • Pin server versions to ensure reproducible builds across environments.

Additional notes

Tips and considerations:

  • Use envFile and passwordCommand to securely manage credentials; avoid embedding secrets directly in configuration files.
  • When using flavors, the output structure adapts to the flavor-specific mcpServers key (e.g., filesystem, claude_desktop_config.json, .mcp.json for Claude Code, etc.).
  • The framework supports a wide range of modules; you can add or remove servers by adjusting the modules you enable in your mkConfig or nix configuration.
  • If you encounter environment variable or path issues, verify the Nix store path is stable and that you are pinning the correct package version to avoid drift between environments.
  • For development workflows, the provided Examples directory contains concrete, end-to-end configurations (claude-desktop.nix, vscode.nix, librechat.nix, etc.).

Related MCP Servers

Sponsor this space

Reach thousands of developers