Get the FREE Ultimate OpenClaw Setup Guide →

mcp -mercurial

A Model Context Protocol server for Mercurial repository interaction

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio metal-shark-sharktech-mcp-server-mercurial npx -y mcp-server-mercurial

How to use

This Mercurial MCP Server exposes model-assisted operations for Mercurial repositories, enabling reading, searching, and manipulating repositories through the Model Context Protocol. It includes core commands to inspect status, diffs, commits, and history, as well as topic-based workflow commands that mirror Mercurial’s topic/branch concepts. Tools such as hg_status, hg_diff, hg_commit, hg_add, hg_remove, hg_move, hg_revert, and hg_log give an LM-friendly interface for repository understanding and automation. Topic-related commands (hg_topic, hg_topics, hg_topic_current, hg_update, hg_stack) support organizing work around specific features or topics, while advanced operations like hg_rebase and hg_evolve help manage history with care. The server is designed to work in environments with Mercurial installed and available in PATH, enabling LLM-driven automation for development workflows.

How to install

Prerequisites:

  • Node.js 18 or higher
  • Mercurial (hg) installed and available in PATH
  • (Optional) Mercurial extensions such as topics and evolve for enhanced topic workflows

From source installation:

  1. Clone the repository: git clone <repository>
  2. Navigate into the project directory: cd mcp-mercurial-server
  3. Install dependencies: npm install
  4. Build the project (if applicable): npm run build
  5. Link for local usage (optional): npm link
  6. Run or integrate with MCP tooling as needed (see configuration below).

Usage example with MCP tooling:

  • If using the Claude Desktop style config, you can reference the server via the mcpServers entry shown in the Configuration section.

Additional notes

Notes and tips:

  • Ensure Mercurial is installed and accessible in your system PATH before running the server.
  • The server speaks the MCP protocol to integrate with LLMs; use the inspector or debugging tools as described in the README when troubleshooting.
  • If you customize the server command, verify that the executable name matches how you start the server in your environment (e.g., local npm link, global install, or npx invocation).
  • For topic-based workflows, make sure the required Mercurial extensions (topics, evolve) are installed and enabled in your Mercurial configuration.
  • When using hg_commit, specify explicit files to avoid accidental changes amplifying unintended portions of the repo.
  • Review current topic with hg_topic_current before making changes to ensure alignment with the intended feature area.

Related MCP Servers

Sponsor this space

Reach thousands of developers