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 Environment Service
A Model Context Protocol (MCP) server that provides secure access to build environments for software projects. This service allows AI assistants to interact with containerized build environments, execute builds, run tests, and manage git operations without requiring local installation of all dependencies.
Features
Isolated Build Environment: Docker-based environment with all build dependencies pre-installed
Safe Command Execution: Validated commands to prevent accidental harmful operations
Git Operations: Limited to safe operations (status, log, checkout, pull, branch, diff)
Build Management: Execute make targets, run tests, and manage build artifacts
Environment Inspection: Query installed tools, versions, and environment variables
Available Commands
list
List all available repositories with build environments.
Example:
make
Run make command with specified arguments.
Parameters:
args(optional): Arguments to pass to make (e.g., "clean", "all", "test")repo(optional): Repository name (uses default if not specified)
Examples:
git
Run git commands (limited to safe operations).
Allowed operations: status, log, checkout, pull, branch, diff, fetch, show
Parameters:
args(required): Git command and argumentsrepo(optional): Repository name
Examples:
ls
List files and directories in the build environment.
Parameters:
args(optional): Arguments to pass to ls (e.g., "-la", "-lh build/")repo(optional): Repository name
Examples:
env
Show build environment information including installed tools and versions.
Parameters:
repo(optional): Repository name
Example:
Installation
Prerequisites
Docker and Docker Compose
Python 3.10 or higher
pip
Setup Steps
Clone the repository:
cd mcp-build-environmentInstall Python dependencies:
pip install -e . # Or for development: pip install -e ".[dev]"Build the Docker environment:
cd docker docker-compose build docker-compose up -dClone your repository into the build environment:
docker-compose exec build-env git clone <your-repo-url> /build/<repo-name>Update configuration: Edit
config/repos.jsonto add your repositories:{ "default_repo": "velocipyde", "repos": { "velocipyde": { "path": "/build/velocipyde", "description": "Velocipyde project", "git_url": "https://github.com/jbroll/velocipyde.git", "default_branch": "main" } } }
Configuration
MCP Client Configuration
Add the server to your MCP client configuration (e.g., Claude Desktop):
Repository Configuration
Edit config/repos.json to configure available repositories:
Security
This service implements basic security measures to prevent accidents:
Path Traversal Protection: Blocks
../patterns and absolute pathsCommand Injection Protection: Blocks pipes, redirects, and command substitution
Git Command Whitelist: Only allows safe git operations
Argument Validation: Validates all command arguments before execution
Important: These are safety measures to prevent accidents, not comprehensive security controls. Do not expose this service to untrusted users or networks.
Development
Project Structure
Running Tests
Code Formatting
Type Checking
Usage Examples
Building a Project
Checking Environment
Troubleshooting
Container not running
Repository not found
Ensure the repository is cloned in the container:
Permission issues
Ensure the build directory has proper permissions:
Environment variable not set
Check that BUILD_ENV_BASE is set correctly:
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests
Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
Open an issue on GitHub
Check existing documentation
Review the MCP protocol specification
Roadmap
Support for multiple concurrent build environments
Build caching and artifact management
Integration with CI/CD systems
Enhanced security controls
Build history and logs
Performance metrics and monitoring
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Provides secure access to containerized build environments for software projects, enabling AI assistants to execute builds, run tests, manage git operations, and inspect build artifacts without requiring local installation of dependencies.