Skip to main content
Glama
liliangshan

MCP Server Git

by liliangshan

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LANGUAGENoLanguage for messages (en, zh, zh-CN, zh-TW) (default: en)en
NO_PROXYNoComma-separated list of hosts that should not use proxy
ALL_PROXYNoUniversal proxy URL for all protocols
REPO_NAMENoRepository identifier for logging and identification
HTTP_PROXYNoHTTP proxy URL (e.g., http://proxy.company.com:8080)
HTTPS_PROXYNoHTTPS proxy URL (e.g., http://proxy.company.com:8080)
MCP_LOG_DIRNoDirectory for log files (default: ./.setting or ./.setting.{REPO_NAME})
REMOTE_NAMENoRemote name (default: origin)origin
SOCKS_PROXYNoSOCKS5 proxy URL (e.g., socks5://proxy.company.com:1080)
TOOL_PREFIXNoPrefix for MCP tool names (default: empty)
LOCAL_BRANCHYesLocal branch name to push from
MCP_LOG_FILENoLog filename (default: mcp-git.log)mcp-git.log
PROJECT_PATHYesAbsolute path to the git repository
REMOTE_BRANCHYesRemote branch name to push to
GIT_PUSH_FLAGSNoAdditional git push flags (default: --progress)--progress
MCP_CHANGES_FILENoPending changes filename (default: pending-changes.json)pending-changes.json
PULL_SOURCE_BRANCHNoSource branch for git_pull (default: same as REMOTE_BRANCH)
MCP_PUSH_HISTORY_FILENoPush history filename (default: push-history.json)push-history.json

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
git_pullA

Execute git pull command from "origin/main" to the current branch.

Pull command: git pull origin main

git_pushA

Execute git push command from "main" to "origin/main" in project path "/app/repo".

Push command: git push origin main:main --progress

⚠️ REQUIREMENT: You MUST call get_pending_changes to review changes before using this tool.

USAGE:

  1. First call get_pending_changes to review pending changes

  2. Then call this tool with the commit message parameter. Example: {message: "Update project files"}

Please provide the commit message in English language.

NOTE: If the push result contains a branch merge URL (such as a pull request URL), please output it to the user. If you can open a browser, you may also automatically open the URL.

The review status is reset after each push attempt (success or failure).

get_push_historyA

Get the last 5 push history records for the git repository. This tool should be called before using git_push to ensure the current changes have not been pushed before.

get_operation_logsB

Get operation logs for debugging and monitoring purposes.

save_changesA

Save pending changes before pushing. This tool records modified files and change content for review before git push.

USAGE: Call this tool to save your changes before pushing. The saved changes must be reviewed using get_pending_changes before git_push can proceed.

Please provide the change description in English language.

Example: {"files": ["src/main.js", "src/utils.js"], "content": "Fixed bug in user authentication"}

get_pending_changesA

Get pending changes that need to be reviewed before pushing. This tool MUST be called before git_push to enable pushing.

USAGE: Call this tool to view and review all pending changes. This will mark changes as reviewed, allowing git_push to proceed. The review status is reset after each push attempt.

By default, this tool returns ALL pending changes (limit=1000). Use smaller limit values for pagination if needed.

Examples: {} - View and review ALL changes (default) {"limit": 10, "offset": 0} - View and review first 10 changes {"limit": 50} - View and review first 50 changes

NOTE: Review status is valid only for the next push attempt. You may need to review again for subsequent pushes.

git_statusB

Show the working directory and staging area status.

USAGE: Call this tool to see which files have been modified, added, or deleted in your working directory and staging area.

Example: {}

git_diffB

Show changes between working directory and HEAD or staging area.

USAGE: Call this tool to see the differences between your working directory and the last commit, or between staging area and HEAD.

Examples: {} - Show all unstaged changes {"staged": true} - Show staged changes {"files": ["src/main.js"]} - Show changes for specific file(s)

git_addA

Add file contents to the staging area.

USAGE: Call this tool to stage files for commit. Use "." to add all changes, or specify specific files.

Examples: {} - Add all changes (equivalent to "git add .") {"files": ["src/main.js", "src/utils.js"]} - Add specific files {"files": ["*.js"]} - Add files matching pattern (use shell expansion)

git_logB

Show commit history.

USAGE: Call this tool to view the commit history of the repository.

Examples: {} - Show last 10 commits with full details {"limit": 5} - Show last 5 commits {"limit": 20, "oneline": true} - Show last 20 commits in oneline format

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/liliangshan/mcp-server-git'

If you have feedback or need assistance with the MCP directory API, please join our Discord server