
How to add Git (Reference) to Windsurf
Official MCP server for reading, searching, and manipulating a local Git repository's files and history. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 15, 2026 · 74k★ · stdio · no auth · official
Windsurf config for Git (Reference)
uvx mcp-server-git --repository /absolute/path/to/repo{
"mcpServers": {
"git-reference": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/absolute/path/to/repo"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the Git (Reference) config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5Git (Reference)'s tools become available to Cascade.
Before you start
- Python 3.10+ with `uv`/`uvx` (recommended) so you can run `uvx mcp-server-git` directly, OR `pip` to install `mcp-server-git`
- Git installed and a local Git repository to operate on
- Docker is an optional alternative (image `mcp/git`), bind-mounting the repo into the container
- No credentials or auth — it acts on the local repo only
What Git (Reference) can do in Windsurf
git_statusShow the working tree status.
git_diff_unstagedShow changes in the working directory that aren't yet staged.
git_diff_stagedShow changes staged for the next commit.
git_diffDiff the current state against a branch or commit.
git_commitRecord staged changes with a commit message.
git_addStage file contents for the next commit.
git_resetUnstage all staged changes.
git_logShow commit history, with optional filtering.
Security
The server can modify repository state (stage, commit, create branches) within the repo you point it at, so scope it to a non-critical working copy. It does not push to remotes by itself but can alter local history.
Git (Reference) + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Git (Reference) config there under the "mcpServers" key and restart the client.
Is Git (Reference) safe to use with Windsurf?
The server can modify repository state (stage, commit, create branches) within the repo you point it at, so scope it to a non-critical working copy. It does not push to remotes by itself but can alter local history.
Is this the same as the GitHub MCP server?
No. This server operates on a local Git repository on disk; the GitHub server talks to the GitHub API for issues, PRs, and remote repos. Many setups use both.
Do I need to install anything to run it?
Not with uv — `uvx mcp-server-git` fetches and runs it on demand. Otherwise `pip install mcp-server-git` and run `python -m mcp_server_git`.
How does it know which repository to use?
Pass `--repository /path/to/repo` at startup, or provide a `repo_path` argument to the tools that accept one.