Skip to content

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

Merged
allenhutchison merged 4 commits intogoogle-gemini:mainfrom
SteffenDE:sd-acp-mcp-sdk
Dec 16, 2025
Merged

Use official ACP SDK and support HTTP/SSE based MCP servers#13856
allenhutchison merged 4 commits intogoogle-gemini:mainfrom
SteffenDE:sd-acp-mcp-sdk

Conversation

@SteffenDE
Copy link
Copy Markdown
Contributor

Summary

Closes #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 #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 #13795 to make ACP work at all. I can drop that commit once that PR is merged.

Related Issues

#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:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @SteffenDE, I'm Gemini Code Assist1! 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 👍 and 👎 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.

Footnotes

  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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant and valuable refactoring that replaces a custom implementation of the Agent Client Protocol with the official ACP SDK. This greatly improves maintainability and aligns the project with the standard. The PR also successfully adds support for HTTP/SSE based MCP servers. The changes are well-executed, but I've identified one critical issue in the new output handling logic that could disrupt the ACP communication by writing non-protocol data to stdout.

@michalslaski
Copy link
Copy Markdown

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

@SteffenDE
Copy link
Copy Markdown
Contributor Author

I removed the code from #13795 (fixed in #14159) and rebased!

@jwflicker
Copy link
Copy Markdown

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

@swissspidy
Copy link
Copy Markdown
Contributor

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

@michalslaski
Copy link
Copy Markdown

Tested the latest changes and merges by running the steps again. Several rounds of messages and code changes went well.

@allenhutchison allenhutchison self-assigned this Dec 15, 2025
Copy link
Copy Markdown
Contributor

@allenhutchison allenhutchison left a comment

Choose a reason for hiding this comment

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

Overall this looks great. I'm glad that we can move to the standard library from our custom implementation. It looks like there are some merge conflicts with files you've deleted so if you can just clear the conflicts and get this into a mergeable state I'm happy to help you get it in.

@allenhutchison
Copy link
Copy Markdown
Contributor

Looks like you have some build failures in the current version of the branch. Can you run npm run preflight and address those issues?

@SteffenDE
Copy link
Copy Markdown
Contributor Author

@allenhutchison should be good now, sorry!

@allenhutchison allenhutchison added this pull request to the merge queue Dec 16, 2025
Merged via the queue into google-gemini:main with commit ba10064 Dec 16, 2025
20 of 21 checks passed
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.

5 participants