Skip to content

feat: Adds support for Cursor provider and other ACP backends#5095

Closed
aweis89 wants to merge 43 commits intoanomalyco:devfrom
aweis89:enable-acp
Closed

feat: Adds support for Cursor provider and other ACP backends#5095
aweis89 wants to merge 43 commits intoanomalyco:devfrom
aweis89:enable-acp

Conversation

@aweis89
Copy link

@aweis89 aweis89 commented Dec 5, 2025

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

@rekram1-node
Copy link
Collaborator

we already have acp support, whats this for

@aweis89
Copy link
Author

aweis89 commented Dec 5, 2025

we already have acp support, whats this for

This is for an ACP backend provider. For example, if you have a cursor account, and you want to use Opencode TUI's interface, but you want it to use cursor CLI agent as it's backend LLM:

Screenshot 2025-12-04 at 7 37 02 PM

Right now we have: IDE via ACP -> OpenCode -> LLM Provider
With this change you can now do: OpenCode -> Cursor CLI via ACP
The ACP becomes the LLM provider as apposed to the frontend interface.
This is useful for folks who want to use OpenCode but already have a subscription for cursor.
They can now use OpenCode while comsuming their tokens from Cursor

@rekram1-node
Copy link
Collaborator

okay i see

@aweis89 aweis89 changed the title feat: Add ACP (Agent Client Protocol) provider support feat: Adds support for Cursor provider and other ACP backends Dec 5, 2025
@aweis89
Copy link
Author

aweis89 commented Dec 5, 2025

okay i see

Been using this all morning. It's pretty awesome to be able to use my Cursor subscription with OpenCode's best-in-class TUI!

@aweis89 aweis89 force-pushed the enable-acp branch 3 times, most recently from 8641762 to d94185f Compare December 7, 2025 06:26
Implemented a Proxy for the tools record when an ACP provider is active.
This dynamically provides pass-through tool definitions for unknown
tool calls, allowing them to be correctly proxied to the ACP.
@aweis89
Copy link
Author

aweis89 commented Dec 21, 2025

Screenshot 2025-12-20 at 8 29 02 PM

@aweis89
Copy link
Author

aweis89 commented Dec 21, 2025

Any chance this is something we can merge @rekram1-node?

@jensenojs
Copy link
Contributor

same ask here

Resolved conflicts in:
- transform.ts: Added @ai-sdk/google-vertex fall-through case while keeping ACP context logic
- llm.ts: Merged ACP tool/jsonSchema imports with extractReasoningMiddleware from dev
@Nasseratic
Copy link

Awesome work @aweis89 ❤️

@NazmiAltun
Copy link

@rekram1-node any plans to have this feature ?

@oraclian94
Copy link

oraclian94 commented Jan 12, 2026

I hope this PR gets merged soon!

- update normalization to handle 'path' for both read and edit tools
Treat wrapped "ConnectError: ... ECONNRESET" (common via ACP subprocess backends) as retryable by unwrapping cause/message, and add a regression test.
@LeonMueller-OneAndOnly
Copy link
Contributor

Here is another interesting approach for getting cursor to work in opencode

https://github.com/R44VC0RP/cursor-opencode-auth

@aweis89
Copy link
Author

aweis89 commented Jan 18, 2026

Here is another interesting approach for getting cursor to work in opencode

https://github.com/R44VC0RP/cursor-opencode-auth

Were you able to get this working?

@rekram1-node
Copy link
Collaborator

rekram1-node commented Jan 18, 2026

It's super cool what you've made but unfortunately this isn't something we have bandwidth to maintain at the moment, this may be better suited to be written as a plugin, if you did make one we are happy to add to ecosystem page

@Nomadcxx
Copy link
Contributor

This isn't something we have bandwidth to maintain at the moment, this may be better suited to be written as a plugin

Noooooooooo

@kaan-zeroday
Copy link

@aweis89 Can you publish as plugin?

@oraclian94
Copy link

Noooooooooo!!!!

@aweis89
Copy link
Author

aweis89 commented Jan 22, 2026

I've been using this recently published plugin lately and it actually works quite well

@aweis89 aweis89 closed this Jan 22, 2026
@b1rdex b1rdex mentioned this pull request Jan 24, 2026
1 task
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.

[FEATURE]: TUI as an ACP Client [FEATURE]: CLI Providers Support for Cursor? Allow using Gemini CLI for free Gemini requests

Comments