Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,26 @@ jobs:
files: |
install.sh
install.ps1

build-windows:
name: Build devcontainer-mcp-windows-x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
with:
key: x86_64-pc-windows-msvc

- name: Build
run: cargo build --release --target x86_64-pc-windows-msvc -p devcontainer-mcp

- name: Package binary
run: Compress-Archive -Path target/x86_64-pc-windows-msvc/release/devcontainer-mcp.exe -DestinationPath devcontainer-mcp-windows-x64.zip

- name: Upload release asset
uses: softprops/action-gh-release@v3
with:
files: devcontainer-mcp-windows-x64.zip
94 changes: 61 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ thiserror = "2"
anyhow = "1"
bollard = "0.18"
clap = { version = "4", features = ["derive"] }
rmcp = { version = "0.1", features = ["server", "transport-io"] }
rmcp = { version = "1.6", features = ["server", "transport-io", "schemars"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
44 changes: 22 additions & 22 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ tools:
- auth_login
- auth_select
- auth_logout
- codespaces_create
- codespaces_list
- codespaces_ssh
- codespaces_stop
- codespaces_delete
- codespaces_view
- codespaces_ports
- codespaces_file_read
- codespaces_file_write
- codespaces_file_edit
- codespaces_file_list
- devcontainer_up
- devcontainer_exec
- devcontainer_build
- devcontainer_read_config
- devcontainer_stop
- devcontainer_remove
- devcontainer_status
- devcontainer_file_read
- devcontainer_file_write
- devcontainer_file_edit
- devcontainer_file_list
- devpod_up
- devpod_stop
- devpod_delete
Expand All @@ -21,32 +43,10 @@ tools:
- devpod_context_use
- devpod_container_inspect
- devpod_container_logs
- devcontainer_up
- devcontainer_exec
- devcontainer_build
- devcontainer_read_config
- devcontainer_stop
- devcontainer_remove
- devcontainer_status
- codespaces_create
- codespaces_list
- codespaces_ssh
- codespaces_stop
- codespaces_delete
- codespaces_view
- codespaces_ports
- devpod_file_read
- devpod_file_write
- devpod_file_edit
- devpod_file_list
- devcontainer_file_read
- devcontainer_file_write
- devcontainer_file_edit
- devcontainer_file_list
- codespaces_file_read
- codespaces_file_write
- codespaces_file_edit
- codespaces_file_list
---

# DevContainer MCP Skill
Expand Down
7 changes: 7 additions & 0 deletions crates/devcontainer-mcp-core/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub enum CliBinary {
Gcloud,
/// Kubernetes CLI
Kubectl,
#[cfg(target_os = "windows")]
/// Windows Subsystem for Linux
Wsl,
}

impl CliBinary {
Expand All @@ -41,6 +44,8 @@ impl CliBinary {
CliBinary::Aws => "aws",
CliBinary::Gcloud => "gcloud",
CliBinary::Kubectl => "kubectl",
#[cfg(target_os = "windows")]
CliBinary::Wsl => "wsl",
}
}

Expand All @@ -53,6 +58,8 @@ impl CliBinary {
CliBinary::Aws => Error::AwsCliNotFound,
CliBinary::Gcloud => Error::GcloudCliNotFound,
CliBinary::Kubectl => Error::KubectlNotFound,
#[cfg(target_os = "windows")]
CliBinary::Wsl => Error::WslNotFound,
}
}
}
Expand Down
16 changes: 3 additions & 13 deletions crates/devcontainer-mcp-core/src/devcontainer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,13 @@ pub async fn status(workspace_folder: &str) -> Result<Option<docker::ContainerIn
// ---------------------------------------------------------------------------

/// Read a file from a dev container.
pub async fn file_read(
workspace_folder: &str,
path: &str,
) -> Result<CliOutput> {
pub async fn file_read(workspace_folder: &str, path: &str) -> Result<CliOutput> {
let cmd = crate::file_ops::read_file_command(path);
exec(workspace_folder, "sh", &["-c", &cmd]).await
}

/// Write (create or overwrite) a file in a dev container.
pub async fn file_write(
workspace_folder: &str,
path: &str,
content: &str,
) -> Result<CliOutput> {
pub async fn file_write(workspace_folder: &str, path: &str, content: &str) -> Result<CliOutput> {
let cmd = crate::file_ops::write_file_command(path, content);
exec(workspace_folder, "sh", &["-c", &cmd]).await
}
Expand Down Expand Up @@ -147,10 +140,7 @@ pub async fn file_edit(
}

/// List directory contents in a dev container.
pub async fn file_list(
workspace_folder: &str,
path: &str,
) -> Result<CliOutput> {
pub async fn file_list(workspace_folder: &str, path: &str) -> Result<CliOutput> {
let cmd = crate::file_ops::list_dir_command(path);
exec(workspace_folder, "sh", &["-c", &cmd]).await
}
12 changes: 2 additions & 10 deletions crates/devcontainer-mcp-core/src/devpod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,7 @@ pub async fn export(workspace: &str) -> Result<CliOutput> {
// ---------------------------------------------------------------------------

/// Read a file from a DevPod workspace.
pub async fn file_read(
workspace: &str,
path: &str,
user: Option<&str>,
) -> Result<CliOutput> {
pub async fn file_read(workspace: &str, path: &str, user: Option<&str>) -> Result<CliOutput> {
let cmd = crate::file_ops::read_file_command(path);
ssh_exec(workspace, &cmd, user, None).await
}
Expand Down Expand Up @@ -223,11 +219,7 @@ pub async fn file_edit(
}

/// List directory contents in a DevPod workspace.
pub async fn file_list(
workspace: &str,
path: &str,
user: Option<&str>,
) -> Result<CliOutput> {
pub async fn file_list(workspace: &str, path: &str, user: Option<&str>) -> Result<CliOutput> {
let cmd = crate::file_ops::list_dir_command(path);
ssh_exec(workspace, &cmd, user, None).await
}
4 changes: 4 additions & 0 deletions crates/devcontainer-mcp-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pub enum Error {
#[error("kubectl not found. Install from: https://kubernetes.io/docs/tasks/tools/")]
KubectlNotFound,

#[cfg(target_os = "windows")]
#[error("WSL (wsl.exe) not found. WSL must be installed: https://learn.microsoft.com/en-us/windows/wsl/install")]
WslNotFound,

#[error("DevPod command failed (exit code {exit_code}): {stderr}")]
DevPodCommand { exit_code: i32, stderr: String },

Expand Down
Loading