Skip to content

Commit ee9d702

Browse files
committed
Add oauth field to OpenCode Nightwatch MCP config
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.
1 parent b3e5f87 commit ee9d702

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Install/Agents/OpenCode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function httpMcpServerConfig(string $url): array
7676
'type' => 'remote',
7777
'enabled' => true,
7878
'url' => $url,
79+
'oauth' => new \stdClass,
7980
];
8081
}
8182

tests/Unit/Install/Agents/OpenCodeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
test('httpMcpServerConfig returns remote type config', function (): void {
1616
$agent = new OpenCode($this->strategyFactory);
1717

18-
expect($agent->httpMcpServerConfig('https://nightwatch.laravel.com/mcp'))->toBe([
18+
$config = $agent->httpMcpServerConfig('https://nightwatch.laravel.com/mcp');
19+
20+
expect($config)->toMatchArray([
1921
'type' => 'remote',
2022
'enabled' => true,
2123
'url' => 'https://nightwatch.laravel.com/mcp',
2224
]);
25+
expect(json_encode($config['oauth']))->toBe('{}');
2326
});

0 commit comments

Comments
 (0)