Skip to main content
Glama
MementoRC

MCP Git Server

by MementoRC

git_status

Check the status of a Git repository's working tree by providing the repository path. Track changes, untracked files, and branch information in a clear summary.

Instructions

Shows the working tree status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • Core handler function that executes the git status command using GitPython's Repo.git.status(), with optional porcelain format.
    def git_status(repo: Repo, porcelain: bool = False) -> str:
        """Get repository status in either human-readable or machine-readable format.
    
        Args:
            repo: Git repository object
            porcelain: If True, return porcelain (machine-readable) format
    
        Returns:
            Status output string
        """
        if porcelain:
            return repo.git.status("--porcelain")
        else:
            return repo.git.status()
  • Pydantic input schema/model for the git_status tool, defining repo_path (required) and optional porcelain flag.
    class GitStatus(BaseModel):
        repo_path: str
        porcelain: bool = False
  • ToolDefinition registration in the central ToolRegistry, associating name 'git_status', schema GitStatus, category GIT, and placeholder handler (later overridden). Also defines GitTools.STATUS = "git_status" enum at line 19.
    ToolDefinition(
        name=GitTools.STATUS,
        category=ToolCategory.GIT,
        description="Show the working tree status",
        schema=GitStatus,
        handler=placeholder_handler,
        requires_repo=True,
    ),
  • Handler wiring in CallToolHandler._get_git_handlers(): maps "git_status" to a wrapped git_status function from git.operations, imported at lines 40-61, and registers via router.set_handlers.
    "git_status": self._create_git_handler(git_status, requires_repo=True),
    "git_diff_unstaged": self._create_git_handler(

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/MementoRC/mcp-git'

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