Minimal MCP server for Nix tooling, written in Rust. It uses the rust-mcp-sdk and exposes a set of helpful Nix/NixOS tools through the Model Context Protocol (MCP).
The binary can run as either:
- MCP over stdio
- MCP over HTTP (with SSE or JSON-only responses)
nix_evaluate
: Evaluate a Nix expression.nix_log
: Get build log for an installable.nix_packages_search
: Search packages in an installable.nix_packages_why_depends
: Show why a package depends on another.nix_flakes_show
: Show a flake's outputs.nix_flakes_metadata
: Show flake metadata.nix_config_check
: Runnix config check
.nix_config_show
: Runnix config show
.nix_manual_list
: List Markdown files in the Nix manual source.nix_manual_read
: Read a Markdown file from the Nix manual.nixos_wiki_search
: Search the NixOS wiki.nixos_wiki_read_page
: Read a page from the NixOS wiki.nixos_channels
: List available NixOS channels with their status.manix_search
: Search docs with manix.nixhub_package_versions
: Get the version history (releases, commit hashes) for a specific package using nixhub.
Note: Most tools shell out to nix
; ensure nix
is installed and available on PATH
.
With Cargo:
- Debug:
cargo build
- Release:
cargo build --release
With Nix (flake):
- Build:
nix build .#rime
(binary at./result/bin/rime
)
Help:
- Cargo:
cargo run -- --help
- Nix:
nix run .#rime -- --help
Stdio transport:
- Cargo:
cargo run -- stdio
- Nix:
nix run .#rime -- stdio
HTTP transport:
- Cargo:
cargo run -- http --host 127.0.0.1 --port 8080
- Nix:
nix run .#rime -- http --host 127.0.0.1 --port 8080
Add the following snippet into your ~/.codex/config.toml
:
[mcp_servers.rime]
command = "/path/to/rime"
args = ["stdio"]
Add a new MCP server into your opencode config, e.g. globally at ~/.config/opencode/opencode.json
:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"rime": {
"type": "local",
"command": ["/path/to/rime", "stdio"],
"enabled": true
}
}
}
Run the following command:
claude mcp add rime -- /path/to/rime stdio
Add the following rime
to mcpServers
in your Gemini config, e.g. globally at ~/.gemini/settings.json
.
{
"mcpServers": {
"rime": {
"command": "/path/to/rime",
"args": ["stdio"]
}
}
}
Add rime
to .vscode/mcp.json
:
{
"servers": {
"rime": {
"type": "stdio",
"command": "/path/to/rime",
"args": ["stdio"]
}
}
}