Skip to main content
Glama

Beaunifi

An MCP (Model Context Protocol) server that intelligently beautifies and minifies JavaScript and CSS files. It can detect if a file is minified and automatically beautify it before processing, then re-minify it afterward.

Features

  • πŸ”§ Beautify JS/CSS code for easier editing

  • πŸ“¦ Minify JS/CSS code for production

  • 🧠 Auto-detect minified files and handle them intelligently

  • πŸ” Workflow mode: Beautify β†’ Edit β†’ Minify (automatic)

  • πŸ”Œ MCP Compatible: Works with Claude Code, Cursor, Antigravity, and more

Related MCP server: ellmos-codecommander-mcp

Installation

# Navigate to the project directory
git clone https://github.com/hussainbiedouh/beaunifi.git
cd beaunifi

# Create virtual environment and install dependencies
uv venv
uv pip install -e ".[dev]"

Using pip

pip install -e .

MCP Configuration

Claude Code

Add to your Claude Code settings:

{
  "mcpServers": {
    "beaunifi": {
      "command": "uv",
      "args": [
        "run",
        "--python",
        "python",
        "-m",
        "beaunifi.server"
      ],
      "cwd": "C:\\path\\to\\beaunifi"
    }
  }
}

Or use the provided config file:

# Copy the config to Claude Code directory
cp mcp-configs/claude-code.json ~/.claude/mcp-servers/beaunifi.json

OpenCode

OpenCode nests servers under mcp.servers in ~/.config/opencode/opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "beaunifi": {
        "type": "local",
        "command": [
          "C:\\path\\to\\beaunifi\\.venv\\Scripts\\python.exe",
          "-m",
          "beaunifi.server"
        ],
        "cwd": "C:\\path\\to\\beaunifi",
        "environment": {
          "PYTHONIOENCODING": "utf-8"
        }
      }
    }
  }
}

Or use the provided config file:

cp mcp-configs/opencode.json ~/.config/opencode/opencode.jsonc

Every client expects a different key, so the same file will not work across all of them. mcp-client-config has the full table and what each failure mode looks like.

Cursor

Add to your Cursor settings (~/.cursor/mcp.json):

{
  "mcpServers": {
    "beaunifi": {
      "command": "uv",
      "args": [
        "run",
        "--python",
        "python",
        "-m",
        "beaunifi.server"
      ],
      "cwd": "C:\\path\\to\\beaunifi"
    }
  }
}

Antigravity

Add to your Antigravity MCP config:

{
  "name": "beaunifi",
  "transport": {
    "type": "stdio",
    "command": "uv",
    "args": ["run", "--python", "python", "-m", "beaunifi.server"],
    "cwd": "C:\\path\\to\\beaunifi"
  }
}

Available Tools

1. beautify_js

Beautify JavaScript code

Parameters:

  • code (string): JavaScript code to beautify

  • indent_size (number, optional): Indentation size (default: 2)

2. minify_js

Minify JavaScript code

Parameters:

  • code (string): JavaScript code to minify

3. beautify_css

Beautify CSS code

Parameters:

  • code (string): CSS code to beautify

  • indent_size (number, optional): Indentation size (default: 2)

4. minify_css

Minify CSS code

Parameters:

  • code (string): CSS code to minify

5. is_minified

Check if code appears to be minified

Parameters:

  • code (string): Code to check

  • file_type (string): Either "js" or "css"

6. smart_process

Smart workflow: auto-detect minification, beautify if needed, and re-minify

Parameters:

  • code (string): Code to process

  • file_type (string): Either "js" or "css"

  • action (string): Action to perform ("read", "edit", or "write")

  • modifications (string, optional): Modifications to apply (for "edit" action)

Usage Examples

Direct Python Usage

from beaunifi.utils import beautify_js, minify_js, is_minified

# Check if code is minified
code = "function test(){return 1}"
if is_minified(code, "js"):
    pretty = beautify_js(code)
    # ... make edits ...
    final = minify_js(pretty)

MCP Tool Usage

When using with an MCP client:

"Please beautify this minified JS file: [code]"
"Minify this CSS for production: [code]"
"Smart process this file - detect if minified and handle appropriately: [code]"

Smart Process Workflow

The smart_process tool provides an intelligent workflow:

  1. Detect if the code is minified

  2. Beautify if minified (for easier editing)

  3. Perform the requested action (read/edit)

  4. Re-minify if the original was minified

This is perfect for AI assistants that need to edit minified files without losing the minification.

Development

# Run tests
uv run pytest

# Type checking
uv run mypy src/beaunifi

# Linting
uv run ruff check src/beaunifi

License

MIT

Available Tools

6 tools
beautify_cssB

Beautify CSS code to make it readable

Inputs: code (required), indent_size.

beautify_jsB

Beautify JavaScript code to make it readable

Inputs: code (required), indent_size.

is_minifiedA

Check if code appears to be minified based on line length and structure

Inputs: code (required), file_type (required).

minify_cssB

Minify CSS code for production

Inputs: code (required).

minify_jsA

Minify JavaScript code for production

Inputs: code (required).

smart_processA

Smart workflow: auto-detect if minified, beautify if needed, process, and optionally re-minify. Perfect for editing minified files.

Inputs: code (required), file_type (required), action, indent_size, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: beautify vs minify for JS and CSS are opposites, is_minified is a detector, and smart_process combines them into a workflow. No two tools overlap in function.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern (beautify_js, minify_css), but is_minified uses an is_ prefix and smart_process uses an adjective_noun style. The deviation is minor and does not cause confusion.

    Tool Count5/5

    Six tools is well-scoped for a code formatting/minification server. Each tool earns its place, covering the two primary languages plus detection and a combined workflow.

    Completeness4/5

    The set covers beautify/minify for JS and CSS, detection, and an automated workflow, which is solid for the domain. Missing support for HTML or JSON formatting is a minor gap but not a critical failure.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that provides utilities for web developers to automate API integration, convert Figma designs to code, and optimize development workflows with tools for asset management and code generation.
      8
      47 npm
      38
      Mozilla Public 2.0
    • A
      license
      B
      quality
      B
      maintenance
      Developer-focused MCP server for code analysis and local engineering workflows. Provides tools for JSON repair, encoding fixes, import organization, format conversion, diff inspection, and regex testing.
      23
      206 npm
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server for intelligently reading Java source code, supporting extraction from Maven dependencies and local projects with dual decompilers.
      2
      102 PyPI
      154
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      A lightweight MCP server that provides 40 tools for TypeScript/JavaScript refactoring and code intelligence, directly mapping to TypeScript's tsserver protocol commands for accurate structural changes and workspace analysis.
      40
      38 npm
      3
      MIT