git-mcp-server
If you are the rightful owner of git-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
GIT-MCP-SERVER is a Model Context Protocol (MCP) Stdio server that integrates with LLM Agents to provide Git-related functionalities using Python.
GIT-MCP-SERVER
LLM Agentμ μ°λ κ°λ₯ν Model Context Protocol (MCP) Stdio μλ²μ λλ€.
νλ‘μ νΈ μ€λͺ
μ΄ νλ‘μ νΈλ LLM Agentκ° Git κ΄λ ¨ κΈ°λ₯μ νμ©ν μ μλλ‘ Python κΈ°λ°μ Git κ΄λ ¨ κΈ°λ₯λ€μ μ 곡ν©λλ€.
μ£Όμ κΈ°λ₯
- μ μ₯μ μν μ‘°ν
- μ»€λ° μμ± λ° κ΄λ¦¬
- νΈμ / ν
- λΈλμΉ μμ± / μ΄λ / λ³ν©
- μ»€λ° νμ€ν 리 μ‘°ν
- λ³κ²½μ¬ν ν΅κ³
- νκ·Έ κ΄λ¦¬
- μ격 μ μ₯μ κ΄λ¦¬
- ν 리νμ€νΈ κ΄λ¦¬
μ€μΉ λ°©λ²
- μ μ₯μ ν΄λ‘
git clone https://github.com/yourusername/git-mcp-server.git
cd git-mcp-server
- κ°μνκ²½ μμ± λ° νμ±ν
python -m venv venv
source venv/bin/activate # Linux/Mac
# λλ
.\venv\Scripts\activate # Windows
- μμ‘΄μ± μ€μΉ
pip install -r requirements.txt
- νκ²½ λ³μ μ€μ
.env
νμΌμ μμ±νκ³ λ€μ λ΄μ©μ μΆκ°ν©λλ€:
GIT_REPO_PATH=/path/to/your/git/repository
GITHUB_TOKEN=your_github_personal_access_token # GitHub API μ¬μ© μ νμ
MCP μ€μ
MCP μ€μ νμΌμ λ€μκ³Ό κ°μ΄ μΆκ°ν©λλ€:
{
"git-mcp-server": {
"transport": "stdio",
"command": "/path/to/your/venv/bin/python",
"args": ["/path/to/your/git-mcp-server/main.py"],
"env": {
"GIT_REPO_PATH": "/path/to/your/git/repository",
"GITHUB_TOKEN": "your_github_personal_access_token"
}
}
}
μ¬μ© λ°©λ²
μλ² μ€ν:
python main.py
μ¬μ© κ°λ₯ν λͺ λ Ήμ΄
- μ μ₯μ μν μ‘°ν
{
"command": "get_repo_status"
}
- λ³κ²½μ¬ν 컀λ°
{
"command": "commit_changes",
"params": {
"message": "μ»€λ° λ©μμ§",
"files": ["file1.txt", "file2.txt"] // μ νμ¬ν
}
}
- λ³κ²½μ¬ν νΈμ
{
"command": "push_changes",
"params": {
"remote": "origin", // μ νμ¬ν
"branch": "main" // μ νμ¬ν
}
}
- λ³κ²½μ¬ν ν
{
"command": "pull_changes",
"params": {
"remote": "origin", // μ νμ¬ν
"branch": "main" // μ νμ¬ν
}
}
- λΈλμΉ μμ±
{
"command": "create_branch",
"params": {
"branch_name": "feature/new-branch"
}
}
- λΈλμΉ μ ν
{
"command": "switch_branch",
"params": {
"branch_name": "feature/new-branch"
}
}
- λΈλμΉ λ³ν©
{
"command": "merge_branch",
"params": {
"source_branch": "feature/new-branch"
}
}
- μ»€λ° νμ€ν 리 μ‘°ν
{
"command": "get_commit_history",
"params": {
"limit": 10 // μ νμ¬ν
}
}
- λΈλμΉ μ 보 μ‘°ν
{
"command": "get_branch_info"
}
- λ³κ²½μ¬ν ν΅κ³ μ‘°ν
{
"command": "get_diff_stats"
}
- νκ·Έ μμ±
{
"command": "create_tag",
"params": {
"tag_name": "v1.0.0",
"message": "λ¦΄λ¦¬μ€ λ²μ 1.0.0", // μ νμ¬ν
"commit_hash": "abc123" // μ νμ¬ν
}
}
- νκ·Έ λͺ©λ‘ μ‘°ν
{
"command": "list_tags"
}
- νκ·Έ μμ
{
"command": "delete_tag",
"params": {
"tag_name": "v1.0.0",
"remote": true // μ νμ¬ν, μ격 μ μ₯μμμλ μμ ν μ§ μ¬λΆ
}
}
- μ격 μ μ₯μ λͺ©λ‘ μ‘°ν
{
"command": "list_remotes"
}
- μ격 μ μ₯μ μΆκ°
{
"command": "add_remote",
"params": {
"name": "upstream",
"url": "https://github.com/original/repo.git"
}
}
- μ격 μ μ₯μ μ κ±°
{
"command": "remove_remote",
"params": {
"name": "upstream"
}
}
- μ격 μ μ₯μ URL λ³κ²½
{
"command": "set_remote_url",
"params": {
"name": "origin",
"url": "https://github.com/new/repo.git"
}
}
- ν 리νμ€νΈ μμ±
{
"command": "create_pull_request",
"params": {
"title": "μλ‘μ΄ κΈ°λ₯ μΆκ°",
"body": "μ΄ PRμ μλ‘μ΄ κΈ°λ₯μ μΆκ°ν©λλ€.",
"head": "feature/new-feature",
"base": "main", // μ νμ¬ν
"repo_owner": "username", // μ νμ¬ν
"repo_name": "repo-name" // μ νμ¬ν
}
}
- ν 리νμ€νΈ λͺ©λ‘ μ‘°ν
{
"command": "list_pull_requests",
"params": {
"state": "open", // μ νμ¬ν: open, closed, all
"repo_owner": "username", // μ νμ¬ν
"repo_name": "repo-name" // μ νμ¬ν
}
}
- ν 리νμ€νΈ μμΈ μ‘°ν
{
"command": "get_pull_request",
"params": {
"pull_number": 123,
"repo_owner": "username", // μ νμ¬ν
"repo_name": "repo-name" // μ νμ¬ν
}
}
- ν 리νμ€νΈ μ λ°μ΄νΈ
{
"command": "update_pull_request",
"params": {
"pull_number": 123,
"title": "μμ λ μ λͺ©", // μ νμ¬ν
"body": "μμ λ λ΄μ©", // μ νμ¬ν
"state": "open", // μ νμ¬ν: open, closed
"repo_owner": "username", // μ νμ¬ν
"repo_name": "repo-name" // μ νμ¬ν
}
}
- ν 리νμ€νΈ λ³ν©
{
"command": "merge_pull_request",
"params": {
"pull_number": 123,
"merge_method": "merge", // μ νμ¬ν: merge, squash, rebase
"commit_title": "λ³ν© μ»€λ° μ λͺ©", // μ νμ¬ν
"commit_message": "λ³ν© μ»€λ° λ©μμ§", // μ νμ¬ν
"repo_owner": "username", // μ νμ¬ν
"repo_name": "repo-name" // μ νμ¬ν
}
}
λΌμ΄μ μ€
MIT License