docker

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package docker implements an MCPSource that provisions MCP servers in Docker containers. Uses the local `docker` CLI (no Docker SDK dep).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI interface {
	Run(ctx context.Context, spec RunSpec) (containerID string, err error)
	Stop(ctx context.Context, containerID string) error
	Exec(ctx context.Context, containerID string, argv []string) (stdout string, err error)
}

CLI is the minimal docker-CLI surface the source needs. Production code uses realCLI; tests supply a fake.

func NewCLI

func NewCLI() CLI

NewCLI returns a CLI backed by the local docker binary.

type Mount

type Mount struct {
	Source   string // host path
	Target   string // container path
	ReadOnly bool
}

Mount describes one -v flag on a container.

type RunSpec

type RunSpec struct {
	Image    string
	PortHost int
	PortCtr  int
	Env      map[string]string
	Mounts   []Mount
}

RunSpec is the arguments to `docker run`.

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the Docker-backed MCPSource.

func New

func New() *Source

New returns a Docker source using the local docker CLI.

func (*Source) Open

func (s *Source) Open(ctx context.Context, args map[string]any) (mcpsource.MCPConn, io.Closer, error)

Open validates args, starts the container, optionally clones a repo into /workspace, health-polls, and returns the MCP URL + closer.

Directories

Path Synopsis
Package register wires the Docker MCPSource into the global registry via a blank import.
Package register wires the Docker MCPSource into the global registry via a blank import.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL