modelcontextprotocol/server-git logo

modelcontextprotocol/server-git

Free

官方参考实现,直接操作本地 Git 仓库,进行读取、搜索和分析。

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About modelcontextprotocol/server-git

mcp-server-git is a Model Context Protocol (MCP) server that enables Large Language Models to interact with Git repositories. It provides a set of tools for reading, searching, and manipulating local Git repositories programmatically. The server is currently in early development and includes tools for checking status, viewing diffs, committing changes, managing branches, and viewing commit logs with optional date filtering. It is designed to integrate seamlessly with MCP-compatible AI assistants, allowing them to perform Git operations directly through natural language commands.

Key Features

View working tree status (git_status)
Show unstaged changes (git_diff_unstaged)
Show staged changes (git_diff_staged)
Compare branches or commits (git_diff)
Commit staged changes (git_commit)
Stage files (git_add)
Unstage changes (git_reset)
View commit logs with optional date filtering (git_log)
Create new branches (git_create_branch)
Checkout branches (git_checkout)

Pros & Cons

Pros
  • Open source and free to use
  • Provides a comprehensive set of common Git operations
  • Integrates with MCP-compatible AI assistants for natural language Git control
  • Offers both simple and advanced options (e.g., context lines, date filtering)
Cons
  • Currently in early development, tools and functionality may change
  • Only supports local Git repositories (no remote operations like push/pull)
  • Requires MCP-compatible client to leverage the tools

Best For

Allow AI assistants to read Git repository history and current stateAutomate Git commits and staging operations via LLM-driven workflowsQuery diffs between branches for code review assistanceManage branches programmatically through natural language commandsIntegrate Git operations into MCP-based developer tools

FAQ

What is mcp-server-git?
mcp-server-git is a Model Context Protocol (MCP) server that provides tools for Git repository interaction and automation, enabling LLMs to read, search, and manipulate Git repositories.
What Git tools are available?
Available tools include git_status, git_diff_unstaged, git_diff_staged, git_diff, git_commit, git_add, git_reset, git_log, git_create_branch, and git_checkout.
Is mcp-server-git production-ready?
No, mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion.