Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Libmake

БесплатноНе проверен

AI-native, embeddable/linkable build automation tool. Includes a Python MCP server with the tools such as build graph visualization.

GitHubEmbed

Описание

AI-native, embeddable/linkable build automation tool. Includes a Python MCP server with the tools such as build graph visualization.

README

codecov

Embeddable build automation tool similar to GNU make.

libmake currently implements an embeddable build graph API plus a focused subset of POSIX make: explicit rules loaded through C calls or a minimal Makefile parser, Makefile emission for supported graphs, ordered prerequisite traversal, mtime rebuild checks, recipe execution, and basic diagnostics.

POSIX error handling status (core)

Current status against POSIX make reference (proprietary, not in the repository):

  • Implemented now:

    • Recursive prerequisite traversal and rebuild-on-stale/missing target logic.
    • Minimal Makefile loading for explicit target rules, prerequisites, semicolon recipes, and tab-indented recipes.
    • Makefile emission from embedded lmk_rule() graphs for differential testing against system make.
    • Termination when recipe command returns non-zero.
    • Diagnostics for missing rule and circular dependency detection.
  • Missing / not yet POSIX-complete:

    • Command prefixes: - (ignore error), @ (silent), + (force execution).
    • Options: -i, -k, -S, -n, -q, -s, -t, -r, -p, -e.
    • Special targets: .POSIX, .IGNORE, .SILENT, .PRECIOUS, .DEFAULT, .SUFFIXES, .SCCS_GET behavior.
    • Required async signal cleanup semantics for in-progress targets.
    • Full macro expansion rules and include processing.

Differential testing strategy

A practical way to progress toward POSIX usability is differential testing: construct graphs through the embeddable C API, emit equivalent Makefiles, and compare behavior of system make, libmake -f, and the embedded graph itself.

This repository now includes a baseline harness:

  • tests/posix-core/run.sh
  • tests/posix-core/lmk_runner.c

The harness builds a tiny libmake runner and checks emitted Makefiles plus secondary parser fixtures for:

  • Basic build success
  • Up-to-date no-op behavior
  • Rebuild when a prerequisite becomes newer
  • Missing target failure path
  • Recipe failure path

Run it with:

sh tests/posix-core/run.sh

This creates an executable baseline to expand incrementally with additional POSIX features as they are implemented.

MCP server

An MCP (Model Context Protocol) server exposes the build graph and build execution to LLMs, enabling agentic build debugging and tool orchestration. It treats libmake as a graph provider: the default provider is this repo's ./libmake, which constructs its graph through embedded C calls, but LIBMAKE_PROVIDER can point at another executable with the same introspection contract.

Setup

uv venv mcp/.venv
source mcp/.venv/bin/activate
uv pip install -r mcp/requirements.txt

Running

Test interactively with the MCP Inspector:

mcp dev mcp/server.py

Configure in Claude Code or Claude Desktop (settings.json):

{
  "mcpServers": {
    "libmake": {
      "command": "mcp/.venv/bin/python3",
      "args": ["mcp/server.py"],
      "cwd": "/path/to/libmake"
    }
  }
}

Set LIBMAKE_PROJECT_DIR to override the working directory if needed. Set LIBMAKE_PROVIDER to point at a different graph-provider executable.

Tools

Tool Description
list_targets List all build targets with dependency and command counts
show_target Show full detail for a target (commands, deps, file mtime)
build Trigger a build and return exit code, stdout, stderr, duration
dry_run Explain what a build would do without executing
dump_makefile Emit the provider graph as a Makefile
visualize_graph Generate a Mermaid diagram of the dependency graph
clean Run libmake clean to remove build artifacts

Resources

URI Description
libmake://graph Full build graph as JSON
libmake://makefile Provider graph emitted as a Makefile
libmake://build-log Most recent build output
libmake://source/{filename} Read a source file from src/

CLI introspection flags

The MCP server relies on the graph-provider CLI contract:

  • ./libmake --dump-graph — serialize the build graph as JSON
  • ./libmake --dump-makefile — serialize the build graph as a Makefile subset
  • ./libmake --dry-run <target> — explain rebuild decisions as JSON
  • ./libmake <target> — build a target

The standalone CLI can also load the supported Makefile subset before running those provider actions:

  • ./libmake -f Makefile [target] — load a Makefile subset and build the requested or first non-special target

Code Coverage

codecov

from github.com/nealpro/libmake

Установка Libmake

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/nealpro/libmake

FAQ

Libmake MCP бесплатный?

Да, Libmake MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Libmake?

Нет, Libmake работает без API-ключей и переменных окружения.

Libmake — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Libmake в Claude Desktop, Claude Code или Cursor?

Открой Libmake на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Libmake with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории ai