-
Notifications
You must be signed in to change notification settings - Fork 7.9k
zed integration: Load MCP servers over HTTP/SSE #8001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
-
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. ↩
There was a problem hiding this 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.
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 eitherhttp
orsse
. This field is optional, defaulting to stdio for backwards compatibility.