- Explore MCP Servers
- unison-mcp-demo
Unison Mcp Demo
What is Unison Mcp Demo
Unison MCP Demo is a demonstration of a Model Context Protocol (MCP) server designed for interacting with the Unison codebase manager. It provides an interface for large language models (LLMs) to access and query information from a Unison codebase.
Use cases
Use cases include assisting developers in navigating large codebases, retrieving definitions and types for better code comprehension, and enhancing the development workflow by integrating LLM capabilities with Unison.
How to use
To use Unison MCP Demo, ensure you have Python 3.12 or higher and Unison installed. Configure your LLM environment (e.g., in VSCode) to enable MCP discovery and run the server using the provided command. This setup allows the LLM to interact with the Unison codebase effectively.
Key features
Key features include browsing namespaces, retrieving definitions of terms and types, substring matching for finding terms, listing all projects/branches, and automatic project/branch selection based on the current UCM context.
Where to use
Unison MCP Demo can be used in software development environments where Unison is employed, particularly in projects that require efficient codebase management and interaction with LLMs for code retrieval and understanding.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Unison Mcp Demo
Unison MCP Demo is a demonstration of a Model Context Protocol (MCP) server designed for interacting with the Unison codebase manager. It provides an interface for large language models (LLMs) to access and query information from a Unison codebase.
Use cases
Use cases include assisting developers in navigating large codebases, retrieving definitions and types for better code comprehension, and enhancing the development workflow by integrating LLM capabilities with Unison.
How to use
To use Unison MCP Demo, ensure you have Python 3.12 or higher and Unison installed. Configure your LLM environment (e.g., in VSCode) to enable MCP discovery and run the server using the provided command. This setup allows the LLM to interact with the Unison codebase effectively.
Key features
Key features include browsing namespaces, retrieving definitions of terms and types, substring matching for finding terms, listing all projects/branches, and automatic project/branch selection based on the current UCM context.
Where to use
Unison MCP Demo can be used in software development environments where Unison is employed, particularly in projects that require efficient codebase management and interaction with LLMs for code retrieval and understanding.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Unison MCP Server
A Model Context Protocol (MCP) server for interacting with Unison codebase manager.
Overview
This MCP server provides an interface for LLMs to interact with a Unison codebase through the Unison API. It exposes resources that allow models to query information about the Unison codebase - mostly retrieving definitions.
MCP Features
- Browse the namespaces in the project
- Retrieve definitions of terms and types
- Find terms and types via substring-matching
- List all projects/branches in a Unison codebase
- Project/branch selection (automatic to the current UCM context, but can be set ‘manually’)
Possible future work:
- Dependency graph retrieval - see what terms/functions depend on which
- ‘Eject’ a namespace into a scratch file
- Safe REPL for arbitrary Unison expressions - might require a ‘captive’ UCM instance
- Auto doc retrieval
- Automatic extraction of examples from documentation
- Search by type signatures
- Hints to help LLM navigate the codebase more effectively - e.g: recommending starting with README
- The ability to search Unison Share, to help identify possible libraries to use
Setup
Prerequisites
- Python 3.12 or higher
- Unison (
ucm).
Usage
Installation
You need to make this MCP server available to your LLM. I’m not sure on the best way to do this, but here is my setup:
I use VSCode, so I set two settings to true:
"chat.mcp.discovery.enabled": true, "chat.mcp.enabled": true
I then ran uv run mcp install main.py - this put the following info in my Claude Desktop config file:
{
"mcpServers": {
"unison": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"/absolute/path/to/unison_mcp/main.py"
]
}
}
}
Reference used: [https://code.visualstudio.com/docs/copilot/chat/mcp-servers]
Development
To add new resources, create additional resource handlers using the @mcp.resource() decorator.
Development Tools
This project is set up to use uv, ruff, pre-commit, and mypy.
Setup Development Environment
Run the setup script to install development dependencies and pre-commit hooks:
./setup_dev.sh
Code Quality Tools - quickstart
-
Formatting & Linting: We use Ruff for both formatting and linting
# Check code style uvx ruff check . # Apply automatic fixes uvx ruff check --fix . # Format code uvx ruff format . -
Type Checking: MyPy is used for static type checking
uvx mypy . -
Pre-commit Hooks: All checks run automatically on commit
# Run all checks manually pre-commit run --all-files
The configuration for these tools is in pyproject.toml and pre-commit-config.yaml.
License
MIT
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










