
Makefile MCP
io.github.ai-ronin-systemsPublished by GitHub account ai-ronin-systemsv0.3.0Updated Oct 25, 2026
Expose trusted GNU Make targets as governed MCP tools without a generic shell.
Overview
Turns an existing GNU Makefile into typed MCP tools so an assistant can run only approved make targets instead of a generic shell.
- What you can do
- List and inspect the Make targets discovered in a repository's Makefile
- Run exposed targets as MCP tools, either one typed tool per target or via generic list, describe and run calls
- Restrict runs to allow-listed context and target pairs with typed, validated inputs in governed mode
- Require human approval for tasks marked dangerous, and write hash-chained audit records of each run attempt
- Preview a target with GNU Make dry-run and check configuration with a doctor command
- When to use it
- Useful when you want an AI assistant to run a repository's existing test, lint, build or deploy targets through Make, without handing it an arbitrary shell. Best for teams that already keep automation in a Makefile and want explicit exposure, approval and audit of what agents may execute.
- Requirements
- Local process on Linux or macOS (Windows not supported), with Python 3.11+ and GNU Make installed; run via uvx or pipx. No authentication or environment variables are declared. Governed mode needs a .makefile-mcp.yaml policy file, and policy changes require a restart.
Installation
In SourceWeft
- Open Makefile MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Makefile MCP
[PyPI] [Python] [CI] [License]
Expose trusted GNU Make targets to AI agents — without exposing a generic shell or replacing Make with another workflow system.
Makefile MCP turns an existing Makefile into typed MCP tools. It is zero-config and run-safe by default, and deny-by-default when governed.
Threat model
Design for a compromised agent: any text it reads can carry a prompt injection. Makefile MCP keeps the worst case short. A hijacked agent can run only the targets you listed, with values you typed, and a human approves the risky ones. Read the threat model for the threats, controls, tests that prove them, and limits.
Details: threat model, SECURITY.md, and security model.
Quick start
Given:
Makefile MCP exposes make_test and make_lint as MCP tools. Other targets are listed but not runnable until you govern them.
One-shot use: uvx makefile-mcp serve.
Why Makefile MCP
Makefile MCP is intentionally narrow: the repository's Makefile remains the executable source of truth, while Makefile MCP supplies a governed agent-facing capability boundary.
See Design rationale for the full capability/property map and the alternatives deliberately left out.
Architecture
One catalog. One execution path. Thin CLI and MCP adapters.
See Architecture.
Governed mode
Without .makefile-mcp.yaml, Makefile MCP runs in auto mode: every conservatively discovered root target is listed, but only test, lint, check, and fmt can run, with no caller-controlled Make variables. --legacy-auto-run restores the old run-everything behavior (deprecated).
Add .makefile-mcp.yaml to switch to explicit governance:
Only enabled (context, target) pairs are callable. dangerous tasks additionally need human approval (defaults.require_approval), and audit writes one JSON line per call. See Governed mode, Configuration, and Contexts and capabilities.
MCP presentations
Makefile MCP supports three MCP presentations over the same callable catalog. Choose the presentation that best fits your requirements.
See MCP presentations and client setup.
Security
Makefile MCP assumes the repository, Makefiles, included Make code, wrapper scripts, and provisioned tools are trusted operator-controlled code. The security boundary is the invocation: an MCP/CLI caller chooses an exposed task/context and, in governed mode, supplies declared values. Makefile MCP authorizes and validates that request; it does not sandbox hostile Makefiles.
Runtime bounds, cancellation/process-group cleanup, stdin isolation, and locking are primarily execution-correctness properties. They limit failure modes around trusted automation rather than turning Make into a sandbox. The built-in MCP server is stdio-only: no HTTP listener, remote-auth layer, TLS, tenancy, or network-service lifecycle is hidden inside the product.
See SECURITY.md for the security policy, reporting process, trust boundary, and limitations. Detailed implementation notes are in docs/security.md.
Intentional scope limits
- GNU Make on Linux/macOS; Windows is not currently supported.
- Trusted repository assumption: Makefiles, includes, scripts, and provisioned tools are operator-controlled code.
- Static discovery is deliberately conservative, not a complete GNU Make parser.
- Preview is GNU Make dry-run, not sandboxing; Make evaluation can still have side effects.
- Direct tool inventory is registered at startup; generic catalog calls can observe supported Makefile changes.
.makefile-mcp.yamlis startup policy; changes require restart and fail closed until then.- Foreground/bounded tasks only; deliberately detached daemons are outside Makefile MCP's process-group containment model.
- No HTTP server, auth stack, scheduler, job queue, workflow persistence, plugin execution framework, or arbitrary shell tool.
- Reload behavior:
.makefile-mcp.yamlis startup policy. Restart Makefile MCP after adding, removing, or editing it.- Makefile discovery refreshes when the conventional
Makefileor tracked literal includes change. - Generic calls see the refreshed catalog immediately.
- Direct tool inventory is a startup snapshot: adding or removing direct tools requires a restart. Existing direct tools still re-check the live catalog when invoked.
Requirements
Python 3.11+ · GNU Make · Linux or macOS
Documentation
- Threat model — why agents should not get a shell, threats and controls, the policy and audit log, guarantees and limits. Start here.
- Architecture — runtime flow, responsibilities, lifecycle, invariants, and dependency rules.
- Design rationale — key tradeoffs, full product-property map, and deliberately rejected alternatives.
- CLI reference — commands, options, result model, root detection, and exit codes.
- Configuration — authoritative
.makefile-mcp.yamlfields, defaults, approval, audit log, and precedence. - Static Make discovery — supported syntax, fail-closed behavior, includes, limitations, and cache semantics.
- Governed mode — explicit exposure, typed inputs, risk metadata, human approval, and operating model.
- MCP presentations —
direct,generic,both, schemas, result/error semantics, naming, and lifecycle. - Contexts and capabilities — monorepo scoping,
(context, target)authorization, and semantic mappings. - MCP client setup — Codex, Claude Code, LangChain/LangGraph, Cursor, VS Code, and
uvxexamples. - Security — trust boundary, Make input safety, arbitrary strings, discovery, environment/path controls, and execution bounds.
- Development — contributor workflows, code ownership, regression expectations, and Definition of Done.
- Deployment — Docker/stdio deployment, production checklist, and provisioning custom tools plus Makefiles.
- Releasing — version/tag contract, clean-package smoke test, PyPI Trusted Publishing, provenance, GitHub Releases, and MCP Registry metadata.
Security reporting: SECURITY.md. Contributing: CONTRIBUTING.md.
Source: README.md at commit f08160c
Tools
0Version history
2- v0.3.0LatestOct 25, 2026
- v0.2.2Oct 15, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts