This extension provides a connection to a Git Model Context Server for Zed's AI assistant. It enables the assistant to understand and interact with Git repositories, providing contextual information about version control.
The Git context server provides information about:
- Repository status
- Commit history
- File changes
- Branch information
- And more through the MCP server
- Install the extension in Zed
- Ensure you have Node.js installed (for uvx package manager)
- Install the Git MCP server:
npm install -g @modelcontextprotocol/server-git
Add to your Zed settings.json (located at ~/.config/zed/settings.json):
{
"context_servers": {
"zed-context-server": {
"settings": {
"repository": "/absolute/path/to/your/git/repository"
}
}
}
}Important: The repository path must:
- Be an absolute path (e.g.,
/Users/username/projects/repo)- Point to an existing Git repository (containing a
.gitdirectory)- Have proper read permissions
For example:
{
"context_servers": {
"zed-context-server": {
"settings": {
"repository": "/Users/d/Projects/opensource/zed-context-server"
}
}
}
}The Git context server provides several capabilities through Zed's AI assistant:
- Get repository status
- View commit history
- Check file changes
- Examine branch information
The assistant will automatically use this context when answering questions about your Git repository.
This extension is built using:
- Rust with zed_extension_api
- Model Context Protocol (MCP)
- mcp-server-git for Git integration
- Ensure the repository path exists and is a valid Git repository
- Check that mcp-server-git is installed globally
- Verify the repository path in settings.json is correct