Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
NIX_MCP_ROOTSNoColon-separated workspace roots used as the configured filesystem boundary when MCP client roots are not provided.
NIX_MCP_PROFILENoPolicy profile controlling advertised mutation tools and execution authority. Supported values are safe (default), developer, operator, and v1-compat.safe
NIX_MCP_DEPLOY_PATHNoExplicit path to the deploy-rs executable used for deployment planning and application.
NIX_MCP_ALLOW_PROFILENoSet to 1 to advertise and permit the profile_manage tool.
NIX_MCP_ALLOW_SIGNINGNoSet to 1 to permit store signing without enabling deletion, GC, repair, or optimisation.
NIX_MCP_DEPLOY_TARGETSNoComma-separated allowlist of permitted deployment targets, for example host1,root@host2.
NIX_MCP_ALLOW_PROVISIONINGNoSet to 1 to permit nixos-anywhere application under operator policy.
NIX_MCP_NIXOS_REBUILD_PATHNoExplicit path to the nixos-rebuild executable used for deployment planning and application.
NIX_MCP_NIXOS_ANYWHERE_PATHNoExplicit path to the nixos-anywhere executable used for deployment planning and application.
NIX_MCP_ALLOW_STORE_MAINTENANCENoSet to 1 to advertise store maintenance and permit destructive store operations.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Start with workspace_inspect when the target is unknown. Use focused build/check/run/develop tools before command. Call discover for advanced operations; discovery never grants authority. Every execution returns a runId: use run_inspect for diagnostics and bounded logs. Deployment always requires deploy_plan followed by deploy_apply. Never replace a policy denial with raw shell execution.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
workspace_inspectA

Start here in a Nix repository. Detect the flake, outputs, Nix version, deployment adapters, and the most useful next tool.

discoverA

Find the best MCP tool or version-supported Nix operation for an intent. Use before command when no first-class tool fits.

buildB

Build one or more packages, NixOS systems, checks, or store paths. Returns output paths and a durable run ID for diagnostics.

checkA

Validate flake outputs and checks. Prefer this for repository-wide quality gates; use build for one focused output.

runC

Run a flake application without installing it. Application arguments are passed as an array after --, never through a shell.

developB

Execute an argument-array command in a project dev shell. Use run for a flake app and build for a derivation.

evalB

Inspect a Nix value without building its result. Supports flake attributes, expressions, files, typed function arguments, raw text, and JSON.

syntax_checkA

Parse one or more Nix files without evaluating or building them. Uses nix-instantiate --parse for compatibility.

searchC

Search nixpkgs or another flake for packages. Use flake_inspect to list a project's complete output tree.

flake_inspectB

Inspect flake outputs, locked inputs, revision metadata, or resolved flake information. Use eval for one exact value.

derivation_inspectA

Show the build recipe for an installable or .drv path, optionally including the recursive derivation graph.

closure_inspectC

Measure a closure, inspect references, explain a dependency chain, or compare two closures.

run_inspectA

Read status, extracted diagnostics, or bounded stdout/stderr from an earlier MCP run. Use nix log through command for unrelated derivations.

commandA

Execute a non-interactive installed Nix operation returned by discover. Options are validated against the runtime command catalog and effect policy.

Prompts

Interactive templates invoked by user choice

NameDescription
inspect-and-buildExplore a workspace and build the most relevant requested output.
diagnose-failureInspect structured diagnostics and then only the relevant log region.
inspect-derivationAnalyze a derivation recipe and its runtime closure.
update-flake-inputUpdate one lock input and verify the result.
plan-deploymentCreate, review, and optionally apply a fingerprinted deployment plan.
use-nix-toolApply one tool according to its manual.

Resources

Contextual data attached and managed by the client

NameDescription
Nix capability catalogFirst-class tools, manuals, installed Nix operations, effects, and policy availability.
Inspect Nix WorkspaceStart here in a Nix repository. Detect the flake, outputs, Nix version, deployment adapters, and the most useful next tool.
Discover Nix CapabilityFind the best MCP tool or version-supported Nix operation for an intent. Use before command when no first-class tool fits.
Build Nix InstallablesBuild one or more packages, NixOS systems, checks, or store paths. Returns output paths and a durable run ID for diagnostics.
Check Nix FlakeValidate flake outputs and checks. Prefer this for repository-wide quality gates; use build for one focused output.
Run Nix ApplicationRun a flake application without installing it. Application arguments are passed as an array after --, never through a shell.
Run in Nix Development ShellExecute an argument-array command in a project dev shell. Use run for a flake app and build for a derivation.
Evaluate Nix ValueInspect a Nix value without building its result. Supports flake attributes, expressions, files, typed function arguments, raw text, and JSON.
Check Nix SyntaxParse one or more Nix files without evaluating or building them. Uses nix-instantiate --parse for compatibility.
Search Nix PackagesSearch nixpkgs or another flake for packages. Use flake_inspect to list a project's complete output tree.
Inspect Nix FlakeInspect flake outputs, locked inputs, revision metadata, or resolved flake information. Use eval for one exact value.
Inspect Nix DerivationShow the build recipe for an installable or .drv path, optionally including the recursive derivation graph.
Inspect Nix ClosureMeasure a closure, inspect references, explain a dependency chain, or compare two closures.
Inspect Nix MCP RunRead status, extracted diagnostics, or bounded stdout/stderr from an earlier MCP run. Use nix log through command for unrelated derivations.
Run Discovered Nix OperationExecute a non-interactive installed Nix operation returned by discover. Options are validated against the runtime command catalog and effect policy.
inspect-build-debug
update-input
derivation-analysis
deployment
/app

TDQS

B3.4/5.0

Scored across 14 tools

Disambiguation4/5

Descriptions actively draw boundaries between the easy-to-confuse pairs (run vs develop vs build, check vs build, eval vs flake_inspect), which is unusually careful. The only real overlap is the inspect family, where workspace_inspect and flake_inspect both surface flake/output information, and run_inspect's name collides conceptually with 'run'.

Naming Consistency3/5

Two clear conventions coexist: bare verbs (build, check, run, eval, search, develop, discover) and noun+inspect (closure_inspect, workspace_inspect, flake_inspect, derivation_inspect, run_inspect), plus syntax_check which follows neither exactly. Each family is internally consistent and readable, but the set as a whole mixes patterns, and 'command' is a bare noun.

Tool Count5/5

14 tools sits squarely in the well-scoped range and every tool maps to a recognizable Nix workflow (inspect, build, eval, run, develop, validate, search, diagnose). Nothing looks redundant or padded for the scope of a Nix repository assistant.

Completeness4/5

Coverage is broad: evaluation, building, checks, dev shells, package search, flake/derivation/closure inspection, syntax parsing, and post-run diagnostics. Gaps exist around flake lock/update and store management (gc, copy, delete), but the discover + command escape hatch provides a validated path to those operations.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues