Skip to content

feat: Add MCP (Model Context Protocol) server integration #158

Description

@gitctrlx

Proposal

Add a new crate to expose bux as an MCP (Model Context Protocol) server, enabling AI assistants (e.g., Claude) to execute code in isolated micro-VMs.

Motivation

AI assistants need safe, isolated environments for code execution. bux provides strong isolation via micro-VMs, making it ideal for this use case. MCP integration would allow seamless integration with AI tools without requiring users to manage VM lifecycle manually.

Proposed Tools

The MCP server should expose the following tools:

  • create_vm: Create a VM from an OCI image
  • exec: Execute commands in a VM
  • write_file: Write files to a VM
  • read_file: Read files from a VM
  • stop_vm: Stop a VM
  • list_vms: List all VMs

Implementation

Create with:

  • MCP server implementation (using official MCP SDK)
  • Tool handlers wrapping bux Runtime API
  • Configuration for data directory and payload paths
  • Optional: resource limits and timeout controls

Alternatives

  • Use bux-serve HTTP API with custom MCP bridge (more complex)
  • Direct CLI invocation via MCP (less efficient, no state management)

Additional Context

MCP specification: https://modelcontextprotocol.io

This would enable use cases like:

  • AI code execution in sandboxed environments
  • Safe testing of untrusted code
  • Isolated dependency management for AI workflows

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions