Skip to content

feat(git): agregar git_push, git_fetch y git_pull al MCP server#3787

Closed
gedarufi wants to merge 1 commit intomodelcontextprotocol:mainfrom
gedarufi:feature/git-push-fetch-pull
Closed

feat(git): agregar git_push, git_fetch y git_pull al MCP server#3787
gedarufi wants to merge 1 commit intomodelcontextprotocol:mainfrom
gedarufi:feature/git-push-fetch-pull

Conversation

@gedarufi
Copy link
Copy Markdown

@gedarufi gedarufi commented Apr 2, 2026

Descripción

Extiende el MCP server de Git con tres nuevas herramientas para
operaciones con remotos que faltaban: git_push, git_fetch y git_pull.

Tipo de cambio

  • feature — nueva funcionalidad

Cambios

  • git_push — push a un remote con soporte de branch específico y force
  • git_fetch — fetch de un remote con opción de prune
  • git_pull — pull con opción de rebase en lugar de merge

Seguridad

Los tres métodos rechazan argumentos que empiezan con '-' para prevenir
flag injection, siguiendo el mismo patrón de defensa en profundidad del
código existente.

Notas

  • Cuando no se especifica branch, git_push y git_pull usan el branch activo
  • git_fetch tiene readOnlyHint=False ya que modifica refs remotas locales
  • git_push y git_pull tienen openWorldHint=True ya que interactúan con remotos

- Agrega GitPush, GitFetch, GitPull como modelos Pydantic
- Implementa git_push() con soporte de remote, branch y force
- Implementa git_fetch() con soporte de remote y prune
- Implementa git_pull() con soporte de remote, branch y rebase
- Registra las tres herramientas en list_tools() con annotations correctas
- Agrega los tres casos en call_tool() siguiendo el patrón existente
- Aplica defensa en profundidad: rechaza argumentos que empiezan con '-'
- git_push y git_pull usan el branch activo cuando no se especifica uno
@gedarufi gedarufi closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant