Skip to content

Conversation

@travis-hoover-glean
Copy link

Summary

  • Adds OpenCode as a supported MCP client with a custom builder
  • OpenCode uses a distinct config format: mcp as the servers property, local/remote type values, a combined command array, and environment for env vars
  • Follows the same custom builder pattern as Goose and Codex

Changes

  • New: configs/opencode.json — client config defining transports, paths, and property mappings
  • New: OpenCodeConfigBuilder — custom builder with stdio (local), HTTP (remote), and normalization logic
  • Modified: schemas.ts — added 'opencode' to ClientIdSchema, validation schemas, and validateGeneratedConfig
  • Modified: types.ts — added OpenCodeMCPConfig interface, updated MCPConfig, ConfigForClient, ServersKeyForClient
  • Modified: constants.ts — added OPENCODE to CLIENT, CLIENT_DISPLAY_NAME, and getDisplayName()
  • Modified: registry.ts — imported config and registered builder
  • Modified: builders/index.ts, src/index.ts — added exports

Test plan

  • npm run build — clean build
  • npm run typecheck — no type errors
  • npm run test — all 313 tests pass
  • npm run test:all — full lint + typecheck + test suite passes

OpenCode uses a distinct config format with "mcp" as the servers property,
"local"/"remote" type values, a combined command array, and "environment"
for env vars. This adds full support via a custom builder following the
same pattern as Goose and Codex.
@travis-hoover-glean travis-hoover-glean requested a review from a team as a code owner February 12, 2026 00:27
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d849fe646

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

function isOpenCodeMCPConfig(
config: OpenCodeMCPConfig | MCPServersRecord
): config is OpenCodeMCPConfig {
return typeof config === 'object' && config !== null && 'mcp' in config;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish wrapped and flat OpenCode config shapes

getNormalizedServersConfig accepts either a wrapped { mcp: ... } object or a flat MCPServersRecord, but this guard only checks whether the key mcp exists. A flat servers map can validly include a server named mcp (for example when includeRootObject: false and serverName is "mcp"), in which case the function misclassifies the input as wrapped and then normalizes server fields (type, command, etc.) as if they were server entries, producing corrupted normalized output.

Useful? React with 👍 / 👎.

Copy link
Contributor

@steve-calvert-glean steve-calvert-glean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The only thing you need to do is regenerate the CLIENTS.md, for which there is an npm command in package.json.

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