[PR #5095] feat: Adds support for Cursor provider and other ACP backends #11243

Closed
opened 2026-02-16 18:16:03 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5095

State: closed
Merged: No


Summary

  • While ACP is already supported for custom IDE integrations (IDE/ACP-> OpenCode -> LLM), this adds support to use ACP as a backend LLM provider (OpenCode -> ACP)
  • Enables OpenCode to consume tokens from Cursor CLI for example while still using the regular OpenCode TUI.
  • This is useful for folks who have Cursor subscriptions for example, but want to use OpenCode's (amazing!) TUI
  • By enabling ACP as a backend provider, we don't need a uniq translation layer for OpenCode to multiple CLI backends

Resolves

Implementation Details

Core Components

  1. ACPClient (client.ts) - Manages subprocess lifecycle and ACP protocol communication
  2. ACPLanguageModel (model.ts) - Implements LanguageModelV2 interface with streaming support
  3. Message Converters (converters.ts) - Bidirectional conversion between Vercel AI SDK and ACP message formats
  4. MCP Converter (mcp-converter.ts) - Converts OpenCode MCP configurations to ACP format
  5. Provider Factory (factory.ts) - Creates ACP provider instances from configuration

Key Features

  • Full streaming support for real-time responses
  • Tool execution, passes along MCP servers, which are executed by the ACP
  • MCP server integration - OpenCode MCP servers exposed to ACP backends
  • Proper subprocess lifecycle management and cleanup
  • Comprehensive error handling

Testing

  • Tested with cursor-agent integration
  • Verified streaming responses
  • Confirmed MCP server exposure to ACP backend

Documentation

  • Added comprehensive README.md with setup instructions
  • Includes configuration examples for cursor-agent, goose, and gemini-cli
  • Documents architecture and design decisions
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5095 **State:** closed **Merged:** No --- ## Summary - While ACP is already supported for custom IDE integrations (`IDE/ACP-> OpenCode -> LLM`), this adds support to use ACP as a backend LLM provider (`OpenCode -> ACP`) - Enables OpenCode to consume tokens from Cursor CLI for example while still using the regular OpenCode TUI. - This is useful for folks who have Cursor subscriptions for example, but want to use OpenCode's (amazing!) TUI - By enabling ACP as a backend provider, we don't need a uniq translation layer for OpenCode to multiple CLI backends ## Resolves - Closes #3735 - CLI Providers feature request - Closes #2072 - Support for Cursor CLI - Closes #402 - Gemini CLI support for free tier access - Closes #5182 ## Implementation Details ### Core Components 1. **ACPClient** (`client.ts`) - Manages subprocess lifecycle and ACP protocol communication 2. **ACPLanguageModel** (`model.ts`) - Implements LanguageModelV2 interface with streaming support 3. **Message Converters** (`converters.ts`) - Bidirectional conversion between Vercel AI SDK and ACP message formats 4. **MCP Converter** (`mcp-converter.ts`) - Converts OpenCode MCP configurations to ACP format 5. **Provider Factory** (`factory.ts`) - Creates ACP provider instances from configuration ### Key Features - Full streaming support for real-time responses - Tool execution, passes along MCP servers, which are executed by the ACP - MCP server integration - OpenCode MCP servers exposed to ACP backends - Proper subprocess lifecycle management and cleanup - Comprehensive error handling ## Testing - Tested with cursor-agent integration - Verified streaming responses - Confirmed MCP server exposure to ACP backend ## Documentation - Added comprehensive README.md with setup instructions - Includes configuration examples for cursor-agent, goose, and gemini-cli - Documents architecture and design decisions
yindo added the pull-request label 2026-02-16 18:16:03 -05:00
yindo closed this issue 2026-02-16 18:16:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11243