Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

git_init

Initialize a new Git repository by setting up the necessary structure and configuration files to start version control for your project.

Instructions

Initialize a new Git repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • The handler function that executes the git_init tool logic: initializes a new Git repository at the given repo_path using git.Repo.init.
    def git_init(repo_path: str) -> str:
        try:
            repo = git.Repo.init(path=repo_path, mkdir=True)
            return f"Initialized empty Git repository in {repo.git_dir}"
        except Exception as e:
            return f"Error initializing repository: {str(e)}"
  • Pydantic model defining the input schema for the git_init tool (requires repo_path: str).
    class GitInit(BaseModel):
        repo_path: str
  • Registration of the git_init tool in the server's list_tools() handler, specifying name, description, and input schema.
    Tool(
        name=GitTools.INIT,
        description="Initialize a new Git repository",
        inputSchema=GitInit.schema(),
    )

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

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