git-mcp-server

elegroag/git-mcp-server

3.1

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.

The MCP Server for Git is designed to facilitate interaction with local Git repositories using SSE and stdio protocols.

Tools
22
Resources
0
Prompts
0

mcp-server-git

Servidor MCP (Model Context Protocol) para interactuar con repositorios Git locales vía SSE y stdio (MCP Studio).

Requisitos

  • Node.js >= 18
  • Git instalado y en PATH

Instalación

# Recomendado
pnpm install
pnpm run build
pnpm start

# Desarrollo (SSE)
pnpm dev

# Desarrollo (stdio para MCP Studio)
pnpm dev:stdio

Ejecución y transporte

SSE (HTTP)

  • Desarrollo: pnpm dev
  • Producción: pnpm run build && pnpm start
  • Health: GET http://localhost:5544/health
  • SSE endpoint: http://localhost:5544/sse

stdio (MCP Studio)

  • Desarrollo: pnpm dev:stdio
  • Producción: pnpm run build && pnpm start:stdio
  • En MCP Studio, configura el comando del servidor para ejecutarse por stdio (por ejemplo, pnpm dev:stdio).

Variables de entorno

  • PORT (por defecto: 5544)
  • SSE_PATH (por defecto: /sse)
  • MCP_TRANSPORT puede ser stdio o sse. Si es stdio, se usa transporte stdio.
  • USE_STDIO si es true o 1, fuerza modo stdio.

Conexión desde un cliente MCP (SSE)

Ejemplos dependen del cliente. En general, configura un endpoint SSE:

Transport: SSE

URL: http://localhost:5544/sse

Nombre: mcp-server-git

Herramientas

  • git_status(repo_path)
  • git_diff_unstaged(repo_path, context_lines=3)
  • git_diff_staged(repo_path, context_lines=3)
  • git_diff(repo_path, target, context_lines=3)
  • git_add(repo_path, files[])
  • git_reset(repo_path)
  • git_commit(repo_path, message)
  • git_log(repo_path, max_count=10) → JSON con {hash, author, date, message}[]
  • git_create_branch(repo_path, branch_name, start_point?)
  • git_checkout(repo_path, branch_name)
  • git_show(repo_path, revision)
  • git_init(repo_path)
  • git_branch(repo_path, branch_type: "local"|"remote"|"all", contains?, not_contains?)

Nuevo lote de herramientas

  • git_fetch(repo_path, remote?, refspec?)
  • git_pull(repo_path, remote?, branch?, rebase?)
  • git_push(repo_path, remote?, branch?, set_upstream?, force?)
  • git_stash(repo_path, action: "save"|"list"|"apply"|"pop"|"drop", message?, stash_ref?)
  • git_merge(repo_path, target, no_ff?, commit_msg?)
  • git_rebase(repo_path, onto?, interactive?, action?: "start"|"continue"|"abort")
  • git_restore(repo_path, paths[], staged?, source?)
  • git_rm(repo_path, paths[], cached?, force?)
  • git_mv(repo_path, from, to)

Notas

  • repo_path debe existir (para git_init, debe ser directorio).
  • Salidas largas (diff/log) están limitadas por maxBuffer (10MB por defecto).