Labsco
mparker3 logo

Makefile MCP Server

from mparker3

Exposes Makefile targets as callable tools for AI assistants.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

makefilemcpserver

An MCP (Model Context Protocol) server that exposes Makefile targets as callable tools for AI assistants like Claude, Cursor, etc.

โš ๏ธ ALPHA SOFTWARE - LOCAL USE ONLY โš ๏ธ
This server executes Make commands with user-provided arguments. Only use in trusted environments. It intelligently parses out commands and args. This almost certainly won't work flawlessly for your Makefile. In fact, it might not even work at all.

How It Works

  1. The server reads your Makefile at startup
  2. Each Make target becomes a tool with the name make_<target>
  3. Comments directly above targets become tool descriptions
  4. MCP clients can then run any target with optional arguments. We do some best-effort parsing of args from docs + commands, a better approach would just be to offload it to yet another LLM call(s) at startup.

Security Considerations

โš ๏ธ WARNING: This server executes shell commands via Make. It currently has minimal input validation.

  • Anything you expose in your Makefile, any MCP client will have access to. Highly recommend running locally only.
  • The server does some de rigeur input sanitization, but no guarantees that an enterprising security researcher can't figure out a way around it.

Development

# Install dependencies
npm install

# Build once
npm run build

# Build and watch for changes
npm run watch

# Run the MCP Inspector for debugging
npm run inspector

Debugging

Since MCP servers communicate over stdio, use the MCP Inspector:

npm run inspector

Then open the provided URL to access debugging tools.

Roadmap

  • Support for multiple Makefiles
  • Configuration for timeout values
  • Better error messages and logging
  • Tests and CI/CD pipeline