close
Skip to content

Add oauth field to OpenCode Nightwatch MCP config#703

Merged
pushpak1300 merged 2 commits intomainfrom
add-opencode-nightwatch-oauth
Mar 20, 2026
Merged

Add oauth field to OpenCode Nightwatch MCP config#703
pushpak1300 merged 2 commits intomainfrom
add-opencode-nightwatch-oauth

Conversation

@DGarbs51
Copy link
Copy Markdown
Contributor

Adds empty oauth object to OpenCode httpMcpServerConfig to properly support Nightwatch MCP authentication.

Changes

  • Added oauth field (as stdClass) to OpenCode::httpMcpServerConfig()
  • Updated test to verify oauth serializes as {} in JSON

Technical Details

Uses new \stdClass instead of an empty array because:

  1. FileWriter::addServerConfig filters out empty PHP arrays, so 'oauth' => [] would never be written
  2. json_encode of stdClass produces a JSON object "oauth": {} rather than an array

This ensures Nightwatch MCP can properly authenticate with OpenCode.

Made with Cursor

DGarbs51 and others added 2 commits March 19, 2026 19:02
Add empty oauth object to OpenCode httpMcpServerConfig to properly support Nightwatch MCP authentication. Uses stdClass to ensure it serializes as {} in JSON rather than being filtered out as an empty array.
@pushpak1300 pushpak1300 merged commit 212fa0b into main Mar 20, 2026
@pushpak1300 pushpak1300 deleted the add-opencode-nightwatch-oauth branch March 20, 2026 06:27
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