Skip to content

Conversation

agu-z
Copy link
Contributor

@agu-z agu-z commented Sep 8, 2025

TLDR

The Zed integration supported connecting to MCP servers, but until now it only supported the stdio transport. This PR allows the Client to include HTTP and SSE server configurations as well.

Dive Deeper

When a new session is created via the Zed integration, the Client sends a list of MCP servers that Gemini CLI should connect to. Still, the existing schema only supported stdio servers.

Now the config object may include a type field that can be set to either http or sse. This field is optional, defaulting to stdio for backwards compatibility.

@agu-z agu-z requested a review from a team as a code owner September 8, 2025 13:14
Copy link
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.

Summary of Changes

Hello @agu-z, 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 significantly enhances the Zed integration by enabling it to connect to MCP servers using modern web protocols like HTTP and Server-Sent Events (SSE). This expansion moves beyond the previous stdio-only limitation, providing greater flexibility and compatibility for how the Gemini CLI interacts with various MCP server configurations.

Highlights

  • Expanded MCP Server Connectivity: The Zed integration now supports connecting to MCP servers using HTTP and Server-Sent Events (SSE) transports, in addition to the existing stdio method.
  • Schema Updates for New Transports: The mcpServerSchema has been refactored into a union type to accommodate configurations for HTTP, SSE, and stdio servers, including new httpHeaderSchema for specifying headers.
  • Agent Capability Declaration: The GeminiAgent now explicitly declares its capability to handle HTTP and SSE MCP server connections, enabling broader integration possibilities.
  • Dynamic Server Configuration Handling: The logic for processing incoming MCP server configurations has been updated to correctly parse and instantiate MCPServerConfig objects based on the specified transport type (stdio, http, or sse).
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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
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 extends the Zed integration to support HTTP and SSE based MCP servers, in addition to the existing stdio transport. The changes involve updating the Zod schemas to accommodate the new server types and their configurations, and modifying the session creation logic to correctly instantiate MCPServerConfig for these new transports. My review focuses on improving the maintainability and readability of the new code. I've suggested refactoring the Zod schema to reduce duplication and simplifying the server configuration logic to make it more concise. These changes will make the code easier to understand and extend in the future.

@gemini-cli gemini-cli bot added the status/need-issue Pull request needs to be associated with an issue label Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-issue Pull request needs to be associated with an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant