-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed as not planned
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Problem Statement
The current opencode mcp add command only supports interactive mode, requiring users to manually input server name, type, and command/URL through prompts. This makes it difficult to automate MCP server setup in scripts, add multiple servers efficiently, use in CI/CD pipelines, or share exact server configurations with teams.
Proposed Solution
Add support for non-interactive syntax to the McpAddCommand that accepts server name and command as arguments:
opencode mcp add name command
Examples:
- opencode mcp add playwright npx @playwright/mcp@latest
- opencode mcp add filesystem opencode x @modelcontextprotocol/server-filesystem /path/to/dir
Implementation Details
The non-interactive mode should:
- Accept server name as first argument
- Accept command as second argument (quoted if contains spaces)
- Default to local type (most common use case)
- Use project config scope by default (can add --global flag for global scope)
- Maintain backward compatibility with interactive mode when no arguments provided
Benefits
- Automation: Enables script-based MCP server setup
- CI/CD Integration: Allows automated environment configuration
- Documentation: Exact commands can be shared in documentation
- Efficiency: Faster addition of known server configurations
- Backward Compatibility: Existing interactive workflow remains unchanged
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)