feat: multi-backend devcontainer-mcp with auth broker#4
Merged
aniongithub merged 7 commits intomainfrom Apr 22, 2026
Merged
Conversation
added 7 commits
April 21, 2026 15:24
…aces backends - Rename devpod-mcp → devcontainer-mcp across all crates, CI, docs, install script - Add shared CliOutput type and run_cli() helper in cli.rs - Add devcontainer CLI backend (up/exec/build/read-config + bollard stop/remove) - Add GitHub Codespaces backend (create/list/ssh/stop/delete/view/ports) - Add 14 new MCP tools (7 devcontainer_* + 7 codespaces_*), 29 total - Update install.sh with --backends flag for selective backend setup - Update README.md and SKILL.md for all three backends
…, opens browser When a codespaces_* tool fails due to a missing OAuth scope, automatically: 1. Run gh auth refresh --clipboard to copy the device code 2. Open the browser to github.com/login/device 3. Return a structured JSON response telling the agent to ask the user to approve
Uses the agency_devcontainer pattern: - initialize.sh runs on host, grabs gh token, writes .devcontainer/gh.env - runArgs --env-file injects GH_TOKEN into container - gh.env is gitignored (contains secrets) - Also adds sshd + gh CLI features for Codespaces SSH support
Auth broker design: MCP server manages credentials, agent uses opaque handles. - auth/mod.rs: AuthProvider trait, handle resolution, provider registry - auth/github.rs: gh auth status/login/token integration - cli.rs: run_cli_with_env() for subprocess env overrides - codespaces.rs: all functions take auth env, auto-auth hack removed - tools.rs: 3 new auth tools (auth_status, auth_login, auth_select) + all codespaces_* tools now require auth handle param - devcontainer.json: removed initializeCommand/env-file hacks - tasks.json: fix cargo task type to shell Tested end-to-end: auth_status → codespaces_create → codespaces_list → codespaces_delete
- SKILL.md: add auth tools, auth workflow, machine type guidance - README.md: add auth tools section, update prerequisites and install - install.sh: simplify to just binary + SKILL.md, detect backends at runtime
- auth/azure.rs: az account list/login --use-device-code - auth/aws.rs: aws sts get-caller-identity, sso login, profile switching - auth/gcloud.rs: gcloud auth list/login --no-browser - auth/kubernetes.rs: kubectl config get-contexts/use-context - cli.rs: add Az, Aws, Gcloud, Kubectl binary variants - error.rs: add AzCliNotFound, AwsCliNotFound, GcloudCliNotFound, KubectlNotFound
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames
devpod-mcp→devcontainer-mcpand adds two new backends (devcontainer CLI, GitHub Codespaces) alongside the existing DevPod backend, plus an auth broker system. 32 MCP tools total.3 backends
devpod_*)devcontainer_*)codespaces_*)authparam)Auth broker (3 new tools)
auth_status— list accounts/handles for a providerauth_login— initiate login flow (opens browser, copies device code)auth_select— verify a handle is still validAgent uses opaque handles like
"github-aniongithub"— never sees raw tokens.Tested end-to-end
auth_status→codespaces_create→codespaces_list→codespaces_delete✅All CI checks pass (fmt, check, test, clippy) ✅