Provides secure access to Docker-based containerized build environments for executing builds, running tests, and managing development workflows in isolated containers.
Enables safe Git operations within build environments including status checks, branch management, commits viewing, and repository synchronization with whitelisted commands.
Allows execution of Make build targets within containerized environments for compiling projects, running tests, and managing build artifacts.
MCP Build Service
A Model Context Protocol (MCP) server that provides access to git repositories for build and test operations. This allows AI assistants to run builds, execute tests, and inspect git repositories on your behalf.
What does it do?
This service provides AI assistants with tools to:
List available git repositories
Execute git commands (status, log, checkout, pull, fetch, diff, show, branch)
Run make targets (build, test, clean, etc.)
List directory contents
Read files from repositories
Query installed build tools and versions
The service runs in a directory containing git repositories and exposes them through the MCP protocol.
Use case
The typical workflow is:
You develop code in your workspace and push to a git branch
AI assistant uses this service to checkout your branch in a build environment
AI assistant runs builds and tests on that branch
AI assistant reports results back to you
You make fixes based on feedback and repeat
This separates your development environment from the build/test environment that the AI uses.
Installation
Setup
Create or designate a directory containing your git repositories:
Usage
Local mode (stdio)
Start the service in the directory containing your repositories:
Configure Claude Desktop to use it. Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Remote mode (HTTP)
Start with HTTP transport:
The service generates a session key on startup. Configure Claude Desktop with:
Command-line options
Available tools
The service exposes these MCP tools:
list - List available repositories
git - Execute git commands (limited to: status, log, checkout, pull, branch, diff, fetch, show)
make - Run make with specified arguments (executes whatever is in the Makefile)
ls - List files and directories
env - Show installed tools and versions
read_file - Read file contents (with optional line range for large files)
Security considerations
Git operations: The service restricts git commands to a whitelist (status, log, checkout, pull, branch, diff, fetch, show). Dangerous operations like git push --force or git reset --hard are blocked.
Command validation: The service blocks path traversal patterns (../) and some command injection patterns (pipes, redirects, command substitution).
Make targets: The service runs whatever make targets you specify. These execute the commands defined in the repository's Makefile, which could be anything. The service does not sandbox or restrict what Makefiles can do.
Authentication (HTTP mode): Requires a session key passed as a Bearer token or query parameter. Keys can be auto-generated or provided.
Recommendation: Run this service in an environment appropriate for build operations (e.g., a dedicated build VM, container, or CI environment). It validates some inputs but does not provide comprehensive sandboxing.
Example usage with AI assistant
Once configured, you can ask your AI assistant:
"List the available repositories"
"Checkout the feature-branch in my-project and run make test"
"What's the build output from the latest commit on main?"
"Show me the diff between main and feature-branch"
The AI will use the service automatically through MCP tool calls.
Troubleshooting
No repositories found
Verify you started mcp-build in the parent directory of your git repos
Check each directory has a
.gitsubdirectory
Repository not found
Repository names must match directory names exactly
Use the list tool to see available names
Build failures
Use the env tool to check installed build tools
Verify the Makefile exists and has the target you're trying to run
Connection issues (HTTP mode)
Check the session key matches what the service printed at startup
Verify firewall allows the port
Test with curl:
curl -H "Authorization: Bearer KEY" http://host:port/api/repos
HTTP API
In addition to the MCP protocol, the service provides HTTP endpoints:
Quick operations (REST):
GET /api/repos- List repositoriesGET /api/repos/{repo}/env- Environment infoPOST /api/repos/{repo}/ls- List filesPOST /api/repos/{repo}/read_file- Read file contentsPOST /api/repos/{repo}/git/quick- Quick git operations (status, branch, log)
Long operations (streaming SSE):
POST /stream/repos/{repo}/make- Stream build outputPOST /stream/repos/{repo}/git- Stream git operations (pull, fetch, diff, show, checkout)
All endpoints require authentication via session key.
Development
Run tests:
Project structure:
License
MIT License
This server cannot be installed