Skip to content

feat(mcp-servers): add server selection and GitHub auth - #1083

Merged
DevelopmentCats merged 4 commits into
coder:mainfrom
Edd88-pixel:eddy/mcp-server-selection-888
Aug 27, 2026
Merged

feat(mcp-servers): add server selection and GitHub auth#1083
DevelopmentCats merged 4 commits into
coder:mainfrom
Edd88-pixel:eddy/mcp-server-selection-888

Conversation

@Edd88-pixel

@Edd88-pixel Edd88-pixel commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Why

Workspace users currently have to configure popular MCP servers and their authentication separately for each agent client. A shared Coder module makes that choice available during workspace creation while keeping credentials out of rendered Terraform and MCP configuration files.

Changes

  • Add a Coder 2.24+ multi-select parameter for GitHub MCP Server and Playwright MCP across the supported agent clients.
  • Configure selected servers through pinned mcp-add, Playwright MCP, and checksum-verified Node.js versions.
  • Add GitHub authentication modes for environment-backed tokens, Coder User Secrets, Claude Code runtime External Auth, and the official local GitHub OAuth server.
  • Keep token values out of client configuration files, logs, Terraform-rendered scripts, and process arguments.
  • Reject External Auth combinations that lack a documented dynamic authorization helper instead of reporting a false connection.
  • Skip user authentication for the prebuilds owner and recalculate it after workspace claim.
  • Pin the local GitHub MCP image by version and digest, bind its callback to loopback, and retain headless device-flow support.
  • Start the module at version 0.0.1 so its interface can evolve before 1.0.0.
  • Add Terraform and container-based coverage for baseline compatibility, authentication, missing credentials, unsupported clients, prebuild isolation, and failure propagation.

Validation

  • terraform test — 10 passed, 0 failed.
  • ./scripts/terraform_test_all.sh — 17 dependency tests and 10 module tests passed.
  • ./scripts/ts_test_auto.sh — 16 passed, 0 failed; 48 assertions.
  • ./scripts/terraform_validate.sh — passed.
  • terraform fmt -check -diff — passed.
  • Targeted Prettier and rendered-template ShellCheck — passed.
  • Docker E2E: Claude Code, Codex, and Cursor retained the unauthenticated baseline; token references were loaded without persisting the real token; Claude Code and Cursor connected to authenticated GitHub MCP, and Codex reported bearer-token authentication for the generated entry.
  • Claude Code executed the runtime headersHelper contract for Coder External Auth, including the not-connected diagnostic path.
  • The pinned official GitHub MCP image completed real initialize and tools/list requests and selected device flow in a headless container.
  • Not run: a full Coder Premium prebuild claim with two real users, because no isolated licensed deployment was available.
  • Not completed: final interactive GitHub device-flow approval and callback, because that requires user authorization in a GitHub account.

@Edd88-pixel
Edd88-pixel marked this pull request as ready for review August 27, 2026 07:40
@Edd88-pixel Edd88-pixel changed the title feat(mcp-servers): add popular server selection feat(mcp-servers): add server selection Aug 27, 2026
Comment thread registry/coder/modules/mcp-servers/README.md
@DevelopmentCats

Copy link
Copy Markdown
Collaborator

Also @Edd88-pixel I just wanna check have you tested this end to end because I was having a few issues when I was trying to test this with npx and the actual install of the mcp servers.

@Edd88-pixel Edd88-pixel changed the title feat(mcp-servers): add server selection feat(mcp-servers): add server selection and GitHub auth Aug 27, 2026
@Edd88-pixel

Copy link
Copy Markdown
Collaborator Author

@DevelopmentCats Thanks for flagging this. I’ve pushed an update with explicit GitHub authentication support and rerun the E2E tests. Claude Code, Codex, and Cursor pass the unauthenticated and token-env flows. Claude Code also supports runtime Coder External Auth through coder external-auth access-token; Codex and Cursor are rejected for that mode because they don’t expose a documented dynamic Authorization helper. The official local GitHub MCP server also passed initialize, tools/list, and headless device-flow validation. The only scenarios I couldn’t complete locally are a two-user Coder Premium prebuild claim and the final interactive GitHub OAuth approval.

@Edd88-pixel

Copy link
Copy Markdown
Collaborator Author

if you can have real instances for testing you can do them and give me feedback
this could help me greatly

@DevelopmentCats

Copy link
Copy Markdown
Collaborator

I think there could be some issues with the inline node installation stuff but its something we can address later since most people would use images or the node module anyways.

@DevelopmentCats
DevelopmentCats merged commit 2e246ad into coder:main Aug 27, 2026
5 checks passed
DevelopmentCats added a commit that referenced this pull request Aug 27, 2026
## Why

`mcp-servers` landed in the `coder` namespace in #1083, but it fits
`coder-labs` better. Moving it now while it is still at `0.0.1` and
unreleased, so no published module source has to change.

## Changes

Relocates `registry/coder/modules/mcp-servers` to
`registry/coder-labs/modules/mcp-servers` and updates every
namespace-derived path:

- `module_directory` → `$HOME/.coder-modules/coder-labs/mcp-servers`,
matching the `coder-labs/pool` convention
- Runtime paths derived from it: the Node bootstrap `dependencies` dir
and the `github-headers.sh` helper
- Registry source address in the README examples →
`registry.coder.com/coder-labs/mcp-servers/coder`
- `coder exp sync` script names in `main.tftest.hcl`, which
`coder-utils` derives from `module_directory` (`coder-mcp-servers-*` →
`coder-labs-mcp-servers-*`)
- Helper path assertions in `auth.test.ts`

No behaviour changes. The icon path (`../../../../.icons/mcp.svg`) is
unchanged because the namespace sits at the same depth.

## Validation

- `terraform fmt -check` — passed
- `terraform validate` — passed
- `terraform test` — 10 passed, 0 failed

The `main.tftest.hcl` sync-name assertions failed on the first run and
caught the `coder-utils` `caller_name` derivation, which is included
above. Container-based tests were not run locally; CI covers those.
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.

2 participants