Labsco
MCP SERVER

Unison MCP Server

by mizchi

Drive the Unison Codebase Manager from an assistant — find and view definitions, add and update code, run expressions, manage projects, branches and libraries.

Code Intelligence & Repository Indexing
Summary
The generic command tool is the reason this ages well.

Alongside the named tools there is one that passes any UCM command straight through, so a command the wrapper does not know about still works — at the cost of you needing to know the syntax, since errors are returned as UCM produced them. Point UCM at the same codebase from a terminal and you can watch what the assistant is doing rather than inferring it from tool output.

What it is

A Haskell MCP server that speaks to UCM, Unison's codebase manager, so an assistant can work in a Unison codebase directly. Because Unison stores code by content hash rather than in files, the usual read-and-edit approach does not apply — every operation here goes through UCM.

What you get
  • Working with definitions — `mcp__unison__ucm_find` to search, `mcp__unison__ucm_view` for source, `mcp__unison__ucm_add` for new ones, `mcp__unison__ucm_update` for existing, `mcp__unison__ucm_delete`, `mcp__unison__ucm_ls` to list a namespace
  • `mcp__unison__ucm_run` to evaluate an expression, and `mcp__unison__ucm_test` which generates `scratch.u` when it is missing
  • `mcp__unison__ucm_dependencies` to show what a definition depends on
  • Projects and branches — `mcp__unison__ucm_list_projects`, `mcp__unison__ucm_switch_project`, `mcp__unison__ucm_project_create`, `mcp__unison__ucm_list_branches`, `mcp__unison__ucm_switch_branch`, `mcp__unison__ucm_branch_create`, `mcp__unison__ucm_merge`
  • Libraries — `mcp__unison__ucm_lib_install`, `mcp__unison__ucm_share_install` for a specific version from Unison Share, and `mcp__unison__ucm_share_search`, which reports library information rather than performing a real search
  • `mcp__unison__ucm_command` as an escape hatch that runs any UCM command with its arguments, so commands added to UCM later still work — errors come back from UCM unchanged
Requirements

Unison installed and `ucm` on your PATH — `brew install unisonweb/unison/unison-language` on macOS. Building needs Haskell Stack; clone the repository and `stack build`, then find the binary with `stack path --local-install-root`. Register it with `claude mcp add unison <binary path> <path to your unison project>` — the project directory is an argument, not an environment variable. To work in the same codebase from a terminal at the same time, start UCM with `ucm --codebase <repo>/.unison`. MIT.

Setup effort

One command — claude mcp add unison /path/to/binary/unison-mcp-server-exe /path/to/your/unison/project