Skip to content

feat: multi-backend devcontainer-mcp with auth broker#4

Merged
aniongithub merged 7 commits intomainfrom
feature-multi-backend
Apr 22, 2026
Merged

feat: multi-backend devcontainer-mcp with auth broker#4
aniongithub merged 7 commits intomainfrom
feature-multi-backend

Conversation

@aniongithub
Copy link
Copy Markdown
Owner

Summary

Renames devpod-mcpdevcontainer-mcp and adds two new backends (devcontainer CLI, GitHub Codespaces) alongside the existing DevPod backend, plus an auth broker system. 32 MCP tools total.

3 backends

Backend Tools Auth
DevPod (devpod_*) 15 tools None for local Docker
devcontainer CLI (devcontainer_*) 7 new tools None (local Docker)
Codespaces (codespaces_*) 7 new tools Required (auth param)

Auth broker (3 new tools)

  • auth_status — list accounts/handles for a provider
  • auth_login — initiate login flow (opens browser, copies device code)
  • auth_select — verify a handle is still valid

Agent uses opaque handles like "github-aniongithub" — never sees raw tokens.

Tested end-to-end

auth_statuscodespaces_createcodespaces_listcodespaces_delete
All CI checks pass (fmt, check, test, clippy) ✅

Ani Balasubramaniam 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
@aniongithub aniongithub merged commit 911d780 into main Apr 22, 2026
1 check passed
@aniongithub aniongithub deleted the feature-multi-backend branch April 22, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant