Skip to content

Conversation

@cooco119
Copy link

@cooco119 cooco119 commented Jan 20, 2026

Summary

Add support for additional opencode MCP configuration options when loading Claude Code .mcp.json files:

  • timeout: Custom timeout in milliseconds for MCP server requests
  • oauth: OAuth configuration for remote servers (type definitions only)

Motivation

Long-running MCP operations (e.g., multi-agent arena discussions) were timing out because the transformer wasn't passing through the timeout field from Claude Code's .mcp.json configuration to opencode's MCP config format.

Reference: https://opencode.ai/docs/mcp-servers

Changes

types.ts

  • Added timeout?: number to ClaudeCodeMcpServer, McpLocalConfig, and McpRemoteConfig
  • Added McpOAuthConfig interface for OAuth configuration
  • Added oauth?: McpOAuthConfig | false to McpRemoteConfig

transformer.ts

  • Pass through timeout field for both local and remote MCP servers

transformer.test.ts (new)

  • Added comprehensive tests for transformer functionality
  • Tests cover timeout handling for both local and remote servers

Testing

bun test src/features/claude-code-mcp-loader/
# 16 pass, 0 fail

Example Usage

In Claude Code's .mcp.json:

{
  "mcpServers": {
    "arena": {
      "command": "npx",
      "args": ["-y", "agent-arena"],
      "timeout": 600000
    }
  }
}

This timeout will now be properly passed through to opencode's MCP configuration.


Summary by cubic

Adds timeout support and OAuth type definitions to the Claude Code MCP loader so .mcp.json timeouts pass through to opencode and long-running requests don’t fail.

  • New Features
    • Passes through timeout for local (stdio) and remote servers.
    • Adds McpOAuthConfig and optional oauth on remote servers (types only).
    • Adds transformer tests for timeout handling and error cases.

Written for commit 4ee2467. Summary will update on new commits.

…ervers

Add support for additional opencode MCP configuration options:
- timeout: Custom timeout in ms for MCP server requests
- oauth: OAuth configuration for remote servers (McpOAuthConfig type)

This allows Claude Code .mcp.json configurations to specify timeout values
that are properly passed through to opencode, which is essential for
long-running MCP operations like multi-agent arena discussions.

Reference: https://opencode.ai/docs/mcp-servers
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@cooco119
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 20, 2026
@cooco119 cooco119 marked this pull request as draft January 20, 2026 00:48
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.

1 participant