Skip to content

redhat-community-ai-tools/brew-mcp

Repository files navigation

Brew MCP Server

A Model Context Protocol (MCP) server that exposes Brew build system functionality to AI assistants like Cursor AI.

Features

This MCP server provides three main tools:

  • get_brew_tag_info - Get detailed information about a specific Brew tag
  • list_brew_packages - List all unique package names associated with a given tag
  • list_brew_builds - List all builds associated with a given tag
  • get_tag_inheritance_info - Get the tag inheritance information about a specific Brew tag.

Installation

Option 1: Direct Installation

Install the required dependencies:

pip install -r requirements.txt

Option 2: Container Installation with Podman

Build the container image:

podman build -t brew-mcp-server .

Cursor AI Integration

Transport Options

This server supports two transport methods:

  1. SSE (Server-Sent Events) - HTTP-based transport
  2. stdio - Standard input/output transport

Configuration for Podman Usage

SSE Transport (Recommended for persistent connections)

First, run the container with SSE transport:

podman run -d -p 8050:8050 --env MCP_TRANSPORT=sse --name brew-mcp-server brew-mcp-server

stdio Transport (For direct communication)

The stdio transport runs the container on-demand for each request.

Cursor Settings Configuration

Open Cursor AI → Settings (Cmd/Ctrl + ,) → Search for "MCP" → Add the server configuration:

{
  "mcpServers": {
    "local-brew-mcp-server-sse": {
      "transport": "sse",
      "url": "http://localhost:8050/sse",
      "name": "brew-mcp-server",
      "description": "Local Brew MCP Server for Red Hat build system integration (SSE transport via podman)"
    },
    "local-brew-mcp-server-stdio": {
      "transport": "stdio",
      "command": "podman",
      "args": [
        "run",
        "--rm",
        "-i",
        "--env", "MCP_TRANSPORT=stdio",
        "brew-mcp-server"
      ],
      "name": "brew-mcp-server",
      "description": "Local Brew MCP Server for Red Hat build system integration (stdio transport via podman)"
    }
  },
  "client": {
    "name": "cursor-mcp-client",
    "version": "1.0.0"
  },
  "connection": {
    "timeout": 30,
    "retries": 3
  }
}

Note: You can use either transport method, but not both simultaneously. Choose one based on your needs:

  • Use SSE for persistent connections and better performance
  • Use stdio for simpler setup or if you prefer on-demand execution

Usage Examples

Once integrated with Cursor AI, you can use natural language to interact with the Brew system:

Example Queries

  • "Get information about the RHEL-8.8.0 tag"
  • "List all packages under the my-project-tag"
  • "Show builds for the latest RHEL tag"
  • "What are the parent tags for RHEL-9.3.0?"

Container Management

SSE Transport Container Commands

# Start the server
podman run -d -p 8050:8050 --env MCP_TRANSPORT=sse --name brew-mcp-server brew-mcp-server

# Check logs
podman logs brew-mcp-server

# Stop the server
podman stop brew-mcp-server

# Remove the container
podman rm brew-mcp-server

stdio Transport

The stdio transport automatically manages container lifecycle - no manual container management needed.

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Cursor AI     │───▶│   Podman        │───▶│  Brew Client    │
│   (Client)      │    │  Container      │    │ (brew_client.py)│
└─────────────────┘    │ (mcp_server.py) │    └─────────────────┘
                       └─────────────────┘             │
                                                       ▼
                                              ┌─────────────────┐
                                              │ Brew/Koji Hub   │
                                              │ (brewhub.eng... │
                                              └─────────────────┘

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published