mcp-server-wslc
v1.0.3MCP 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).
| Parameter | Type | Description |
|---|---|---|
format | string | Output format for the container list |
container_create
Create a new WSL container. Returns the container ID on success.
| Parameter | Type | Description |
|---|---|---|
image * | string | Container image name (e.g., ubuntu:24.04) |
command | string | Command to run in the container |
commandArgs | array | Arguments for the command |
cpus | number | CPU count (e.g. 0.5, 1, 2.5) |
env | object | Environment variables (key=value pairs) |
interactive | boolean | Keep stdin open |
memory | string | Memory limit (e.g. 512M, 1G) |
name | string | Container name |
publish | array | Port mappings (e.g. ['8080:80', '443:443']) |
rm | boolean | Remove container after it stops |
tty | boolean | Allocate a pseudo-TTY |
volume | array | Volume bind mounts (e.g. ['/host:/container']) |
workdir | string | Working directory inside the container |
container_run
Run a new WSL container. Defaults to foreground; use detach for background.
| Parameter | Type | Description |
|---|---|---|
image * | string | Container image name (e.g., ubuntu:24.04) |
command | string | Command to run in the container |
commandArgs | array | Arguments for the command |
cpus | number | CPU count (e.g. 0.5, 1, 2.5) |
detach | boolean | Run container in background |
env | object | Environment variables (key=value pairs) |
interactive | boolean | Keep stdin open |
memory | string | Memory limit (e.g. 512M, 1G) |
name | string | Container name |
publish | array | Port mappings (e.g. ['8080:80', '443:443']) |
rm | boolean | Remove container after it stops |
tty | boolean | Allocate a pseudo-TTY |
volume | array | Volume bind mounts (e.g. ['/host:/container']) |
workdir | string | Working directory inside the container |
container_inspect
Display detailed information about a WSL container.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
container_start
Start a stopped WSL container.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
attach | boolean | Attach to container stdout/stderr |
interactive | boolean | Attach to stdin and keep it open |
container_stop
Stop a running WSL container.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
signal | string | Signal to send to the container (e.g. SIGTERM, SIGKILL) |
time | integer | Seconds 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.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
signal | string | Signal to send on stop (e.g. SIGTERM) |
time | integer | Seconds to wait before killing on stop (default: 5) |
container_remove
Remove a WSL container.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
force | boolean | Force removal even if running |
container_logs
View logs from a WSL container.
| Parameter | Type | Description |
|---|---|---|
containerId * | string | Container ID or name |
follow | boolean | Follow log output (streaming) |
since | string | Show logs since timestamp (Unix epoch seconds or RFC3339, e.g. 2024-01-15T10:30:00Z) |
tail | integer | Number of lines to show from the end |
timestamps | boolean | Show timestamps in log output |
until | string | Show 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.
| Parameter | Type | Description |
|---|---|---|
command * | string | Command to run inside the container |
containerId * | string | Container ID or name |
commandArgs | array | Arguments for the command |
detach | boolean | Run in detached mode |
env | object | Environment variables (key=value pairs) |
interactive | boolean | Keep stdin open |
tty | boolean | Allocate a pseudo-TTY |
user | string | User to run the command as (name|uid|uid:gid) |
workdir | string | Working directory inside the container |
container_stats
Display resource usage snapshot for running WSL containers.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Show all containers regardless of status |
containerId | string | Container ID or name. Omit to show all containers. |
format | string | Output format |
noTrunc | boolean | Do not truncate output |
list_images
List all WSL container images. Use the optional 'format' parameter to control output format (table, json).
| Parameter | Type | Description |
|---|---|---|
format | string | Output format for the image list |
image_pull
Pull a container image from a registry.
| Parameter | Type | Description |
|---|---|---|
image * | string | Image name (e.g., ubuntu:24.04, registry.example.com/app:v1) |
image_push
Push a container image to a registry.
| Parameter | Type | Description |
|---|---|---|
image * | string | Image name (e.g., registry.example.com/app:v1) |
image_build
Build a container image from a Dockerfile.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to the build context directory |
buildArg | object | Build-time variables (KEY=VALUE) |
file | string | Path to the Dockerfile (default: 'Dockerfile' in context) |
label | object | Metadata labels |
noCache | boolean | Do not use cache when building the image |
pull | boolean | Always attempt to pull a newer version of the image |
tag | array | Tags for the built image (e.g. ['myapp:latest', 'myapp:v1']) |
target | string | Target build stage |
verbose | boolean | Enable verbose output |
image_tag
Tag a container image with a new name/tag.
| Parameter | Type | Description |
|---|---|---|
source * | string | Current image reference in image-name[:tag] format |
target * | string | New image reference in image-name[:tag] format |
image_inspect
Display detailed information about a container image.
| Parameter | Type | Description |
|---|---|---|
image * | string | Image name or ID |
image_remove
Remove a container image.
| Parameter | Type | Description |
|---|---|---|
image * | string | Image name or ID |
force | boolean | Force removal even if in use |
noPrune | boolean | Do not delete untagged parents |
network_list
List all WSL networks.
| Parameter | Type | Description |
|---|---|---|
format | string | Output format |
quiet | boolean | Only display network names |
network_create
Create a new WSL network.
| Parameter | Type | Description |
|---|---|---|
name * | string | Network name |
driver | string | Network driver name (default: bridge) |
label | object | Network metadata labels |
opt | object | Driver-specific options (KEY=VALUE) |
network_remove
Remove one or more WSL networks.
| Parameter | Type | Description |
|---|---|---|
name * | string | Network name |
force | boolean | Do not error if the network does not exist |
volume_list
List all WSL volumes.
| Parameter | Type | Description |
|---|---|---|
format | string | Output format |
quiet | boolean | Only display volume names |
volume_create
Create a new named volume that can be attached to containers.
| Parameter | Type | Description |
|---|---|---|
driver | string | Volume driver name (e.g. 'guest', 'vhd', default: guest) |
label | object | Volume metadata labels |
name | string | Volume name (auto-generated if omitted) |
opt | object | Driver-specific options (KEY=VALUE) |
volume_remove
Remove one or more volumes. Volumes in use by a container cannot be removed.
| Parameter | Type | Description |
|---|---|---|
name * | string | Volume name |
force | boolean | Do 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.
| Parameter | Type | Description |
|---|---|---|
password | string | Password or personal access token (PAT). Prefer passwordStdin for security. |
passwordStdin | boolean | Read password from stdin (more secure than --password flag) |
server | string | Registry server URL (default: session-defined default) |
username | string | Username |
registry_logout
Log out from a container registry. If no server is specified, the session default is used.
| Parameter | Type | Description |
|---|---|---|
server | string | Registry 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.