gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Use official ACP SDK and support HTTP/SSE based MCP servers

Open SteffenDE opened this issue 1 month ago • 6 comments

Summary

Closes https://github.com/google-gemini/gemini-cli/pull/12427.

Refactors the Zedintegration code to use the official Agent Client Protocol SDK.

Adds support for using the ACP "Zed Integration" with SSE and HTTP based MCP servers. See https://agentclientprotocol.com/protocol/session-setup#mcp-servers.

Details

In https://github.com/google-gemini/gemini-cli/pull/12427, michalslaski asked for a way to reuse the official ACP schema without copying over the code. I decided to refactor the code to use the official SDK.

Note: I needed to cherrypick a patch from https://github.com/google-gemini/gemini-cli/pull/13795 to make ACP work at all. I can drop that commit once that PR is merged.

Related Issues

https://github.com/google-gemini/gemini-cli/pull/12427

How to Validate

Since Zed doesn't support non-stdio MCPs, I tested this using tidewave.ai's ACP integration. You could also manually send JSON-RPC messages over stdio to verify.

Pre-Merge Checklist

  • [ ] Updated relevant documentation and README (if needed)
  • [ ] Added/updated tests (if needed)
  • [ ] Noted breaking changes (if any)
  • [ ] Validated on required platforms/methods:
    • [x] MacOS
      • [x] npm run
      • [x] npx
      • [ ] Docker
      • [ ] Podman
      • [ ] Seatbelt
    • [ ] Windows
      • [ ] npm run
      • [ ] npx
      • [ ] Docker
    • [x] Linux
      • [x] npm run
      • [x] npx
      • [ ] Docker

SteffenDE avatar Nov 26 '25 13:11 SteffenDE

Summary of Changes

Hello @SteffenDE, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the Zed integration by migrating its Agent Client Protocol (ACP) implementation to the official SDK. This change not only simplifies the internal architecture by removing custom protocol handling but also significantly expands the integration's capabilities by enabling communication with HTTP and SSE-based MCP servers. The update ensures broader compatibility and a more robust foundation for agent-client interactions.

Highlights

  • Official ACP SDK Adoption: The Zed integration code has been refactored to utilize the official Agent Client Protocol (ACP) SDK, replacing previous custom implementations and schemas.
  • HTTP/SSE MCP Server Support: Support has been added for HTTP and Server-Sent Events (SSE) based MCP (Multi-Client Protocol) servers, enhancing the flexibility of agent communication.
  • Codebase Simplification: The custom ACP connection logic, schemas, and associated test files have been removed, leading to a more streamlined and maintainable codebase.
  • Improved Output Handling: Output listeners have been initialized to ensure proper flushing of buffered output and logs to stderr in non-interactive modes, preventing data loss.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot] avatar Nov 26 '25 13:11 gemini-code-assist[bot]

Tested the PR with tidewave.ai (see screencast).

Steps:

  1. Build gemini-cli from this PR (make build)
  2. Generate a sample React+Vite application in Google AI Studio (app.new)
  3. Download the sample app and start it (npm run dev)
  4. Download Tidewave app for your operating system and configure it for React (see docs)
  5. Start Tidewave and visit localhost:9832
  6. Configure Gemini CLI as an External Agent of Tidewave (npx /your/path/to/gemini-cli --experimental-acp)
  7. Try referencing an element on the web page in the Tidewave Chat prompt

michalslaski avatar Dec 08 '25 10:12 michalslaski

I removed the code from https://github.com/google-gemini/gemini-cli/pull/13795 (fixed in https://github.com/google-gemini/gemini-cli/pull/14159) and rebased!

SteffenDE avatar Dec 08 '25 11:12 SteffenDE

experimental-acp not accepting SSE MCP on session/new #8672

jwflicker avatar Dec 10 '25 09:12 jwflicker

@allenhutchison @NTaylorMullen any takers for reviewing this one? Only heard crickets so far when looking for reviewers :)

swissspidy avatar Dec 11 '25 12:12 swissspidy