hammer-mcp-server

qcjames53/hammer-mcp-server

3.1

If you are the rightful owner of hammer-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Hammer MCP Server is a Model Context Protocol server implementation that facilitates interaction between Large Language Models (LLMs) and the Hammer CLI.

Hammer MCP Server

A Model Context Protocol (MCP) server implementation that enables LLMs to interact with Hammer CLI.

Installation

  1. Install hammer locally:
sudo dnf install rubygem-hammer_cli rubygem-hammer_cli_foreman ruby-devel gcc make
sudo gem install hammer_cli_katello
hammer --help
  1. Set up your ~/.hammer/cli_config.yml as shown (change hostname):
:modules:
  - hammer_cli_foreman
  - hammer_cli_katello

:foreman:
  :enable_module: true
  :host: 'https://<foreman hostname>'
  :verify_ssl: false
  :username: admin
  :password: changeme

:katello:
  :enable_module: true

:log_dir: '~/.hammer/log'
:log_level: 'debug'
  1. Fetch your CA cert and install (change hostname):
hammer --fetch-ca-cert https://<foreman hostname>
sudo install ~/.hammer/certs/<foreman hostname>_443.pem /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust
hammer --help
  1. Make sure your hammer binary is authenticated and can run normal hammer commands.
  2. Install dependencies
uv sync

Usage

Run the server with:

uv run hammer-mcp-server

Or with custom options:

uv run hammer-mcp-server --transport streamable-http --log-level DEBUG

Development

Install development dependencies:

uv sync --group dev

Format and lint code:

uv run ruff check .
uv run ruff format .

MCP Inspector:

sudo dnf install nodejs
npx @modelcontextprotocol/inspector

Connect to http://localhost:8080/mcp using" Streamable HTTP".