mcp-server-wslc

v1.0.3
mcp-server-wslc Checked 1 day ago Published 4 months ago

MCP server for WSL container management via wslc CLI

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_containers

List all WSL containers. Use the optional 'format' parameter to control output format (table, json).

ParameterTypeDescription
formatstringOutput format for the container list

container_create

Create a new WSL container. Returns the container ID on success.

ParameterTypeDescription
image *stringContainer image name (e.g., ubuntu:24.04)
commandstringCommand to run in the container
commandArgsarrayArguments for the command
cpusnumberCPU count (e.g. 0.5, 1, 2.5)
envobjectEnvironment variables (key=value pairs)
interactivebooleanKeep stdin open
memorystringMemory limit (e.g. 512M, 1G)
namestringContainer name
publisharrayPort mappings (e.g. ['8080:80', '443:443'])
rmbooleanRemove container after it stops
ttybooleanAllocate a pseudo-TTY
volumearrayVolume bind mounts (e.g. ['/host:/container'])
workdirstringWorking directory inside the container

container_run

Run a new WSL container. Defaults to foreground; use detach for background.

ParameterTypeDescription
image *stringContainer image name (e.g., ubuntu:24.04)
commandstringCommand to run in the container
commandArgsarrayArguments for the command
cpusnumberCPU count (e.g. 0.5, 1, 2.5)
detachbooleanRun container in background
envobjectEnvironment variables (key=value pairs)
interactivebooleanKeep stdin open
memorystringMemory limit (e.g. 512M, 1G)
namestringContainer name
publisharrayPort mappings (e.g. ['8080:80', '443:443'])
rmbooleanRemove container after it stops
ttybooleanAllocate a pseudo-TTY
volumearrayVolume bind mounts (e.g. ['/host:/container'])
workdirstringWorking directory inside the container

container_inspect

Display detailed information about a WSL container.

ParameterTypeDescription
containerId *stringContainer ID or name

container_start

Start a stopped WSL container.

ParameterTypeDescription
containerId *stringContainer ID or name
attachbooleanAttach to container stdout/stderr
interactivebooleanAttach to stdin and keep it open

container_stop

Stop a running WSL container.

ParameterTypeDescription
containerId *stringContainer ID or name
signalstringSignal to send to the container (e.g. SIGTERM, SIGKILL)
timeintegerSeconds to wait before killing (default: 5)

container_restart

Restart a WSL container. Since wslc has no native restart command, this stops then starts the container.

ParameterTypeDescription
containerId *stringContainer ID or name
signalstringSignal to send on stop (e.g. SIGTERM)
timeintegerSeconds to wait before killing on stop (default: 5)

container_remove

Remove a WSL container.

ParameterTypeDescription
containerId *stringContainer ID or name
forcebooleanForce removal even if running

container_logs

View logs from a WSL container.

ParameterTypeDescription
containerId *stringContainer ID or name
followbooleanFollow log output (streaming)
sincestringShow logs since timestamp (Unix epoch seconds or RFC3339, e.g. 2024-01-15T10:30:00Z)
tailintegerNumber of lines to show from the end
timestampsbooleanShow timestamps in log output
untilstringShow logs until timestamp (Unix epoch seconds or RFC3339, e.g. 2024-01-15T10:30:00Z)

container_exec

Execute a command inside a running WSL container.

ParameterTypeDescription
command *stringCommand to run inside the container
containerId *stringContainer ID or name
commandArgsarrayArguments for the command
detachbooleanRun in detached mode
envobjectEnvironment variables (key=value pairs)
interactivebooleanKeep stdin open
ttybooleanAllocate a pseudo-TTY
userstringUser to run the command as (name|uid|uid:gid)
workdirstringWorking directory inside the container

container_stats

Display resource usage snapshot for running WSL containers.

ParameterTypeDescription
allbooleanShow all containers regardless of status
containerIdstringContainer ID or name. Omit to show all containers.
formatstringOutput format
noTruncbooleanDo not truncate output

list_images

List all WSL container images. Use the optional 'format' parameter to control output format (table, json).

ParameterTypeDescription
formatstringOutput format for the image list

image_pull

Pull a container image from a registry.

ParameterTypeDescription
image *stringImage name (e.g., ubuntu:24.04, registry.example.com/app:v1)

image_push

Push a container image to a registry.

ParameterTypeDescription
image *stringImage name (e.g., registry.example.com/app:v1)

image_build

Build a container image from a Dockerfile.

ParameterTypeDescription
path *stringPath to the build context directory
buildArgobjectBuild-time variables (KEY=VALUE)
filestringPath to the Dockerfile (default: 'Dockerfile' in context)
labelobjectMetadata labels
noCachebooleanDo not use cache when building the image
pullbooleanAlways attempt to pull a newer version of the image
tagarrayTags for the built image (e.g. ['myapp:latest', 'myapp:v1'])
targetstringTarget build stage
verbosebooleanEnable verbose output

image_tag

Tag a container image with a new name/tag.

ParameterTypeDescription
source *stringCurrent image reference in image-name[:tag] format
target *stringNew image reference in image-name[:tag] format

image_inspect

Display detailed information about a container image.

ParameterTypeDescription
image *stringImage name or ID

image_remove

Remove a container image.

ParameterTypeDescription
image *stringImage name or ID
forcebooleanForce removal even if in use
noPrunebooleanDo not delete untagged parents

network_list

List all WSL networks.

ParameterTypeDescription
formatstringOutput format
quietbooleanOnly display network names

network_create

Create a new WSL network.

ParameterTypeDescription
name *stringNetwork name
driverstringNetwork driver name (default: bridge)
labelobjectNetwork metadata labels
optobjectDriver-specific options (KEY=VALUE)

network_remove

Remove one or more WSL networks.

ParameterTypeDescription
name *stringNetwork name
forcebooleanDo not error if the network does not exist

volume_list

List all WSL volumes.

ParameterTypeDescription
formatstringOutput format
quietbooleanOnly display volume names

volume_create

Create a new named volume that can be attached to containers.

ParameterTypeDescription
driverstringVolume driver name (e.g. 'guest', 'vhd', default: guest)
labelobjectVolume metadata labels
namestringVolume name (auto-generated if omitted)
optobjectDriver-specific options (KEY=VALUE)

volume_remove

Remove one or more volumes. Volumes in use by a container cannot be removed.

ParameterTypeDescription
name *stringVolume name
forcebooleanDo not error if the volume does not exist

registry_login

Log in to a container registry. If no server is specified, the session default is used. Prefer using passwordStdin over password to avoid exposing credentials in process lists.

ParameterTypeDescription
passwordstringPassword or personal access token (PAT). Prefer passwordStdin for security.
passwordStdinbooleanRead password from stdin (more secure than --password flag)
serverstringRegistry server URL (default: session-defined default)
usernamestringUsername

registry_logout

Log out from a container registry. If no server is specified, the session default is used.

ParameterTypeDescription
serverstringRegistry server URL (default: session-defined default)

system_version

Get wslc CLI version information.

system_prune

Remove all stopped containers and unused images, networks, and volumes to free up resources.