Skip to content

[pull] main from coder:main #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 8, 2025
Merged

[pull] main from coder:main #197

merged 4 commits into from
May 8, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented May 8, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

ThomasK33 and others added 4 commits May 7, 2025 21:53
Part of #17649

---

# Allow MCP server to run without authentication

This PR enhances the MCP server to operate without requiring authentication, making it more flexible for environments where authentication isn't available or necessary. Key changes:

- Replaced `InitClient` with `TryInitClient` to allow the MCP server to start without credentials
- Added graceful handling when URL or authentication is missing
- Made authentication status visible in server logs
- Added logic to skip user-dependent tools when no authenticated user is present
- Made the `coder_report_task` tool available with just an agent token (no user token required)
- Added comprehensive tests to verify operation without authentication

These changes allow the MCP server to function in more environments while still using authentication when available, improving flexibility for CI/CD and other automated environments.
Fix #17704

During the [refactoring of WorkspaceApp response
type](https://github.com/coder/coder/pull/17700/files#diff-a7e67944708c3c914a24a02d515a89ecd414bfe61890468dac08abde55ba8e96R112),
I updated the logic to check if the session token should be injected
causing external apps to not load correctly.

To also avoid future confusions, we are only going to rely on the
`app.external` prop to open apps externally instead of verifying if the
URL does not use the HTTP protocol. I did some research and I didn't
find out a use case where it would be a problem.

I'm going to refactor this code very soon to allow opening apps from the
workspaces page, so I will write the tests to cover this use case there.

**Not included:**
During my next refactoring I'm also going to change the code to support
token injections directly in the HREF instead of making it happen during
the click event.
We have `code.svg` but not `code-insiders.svg`
@pull pull bot added the ⤵️ pull label May 8, 2025
@pull pull bot merged commit b6182fe into PterX:main May 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants