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
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- src/mcp_server_git/server.py:129-134 (handler)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)}"
- src/mcp_server_git/server.py:60-62 (schema)Pydantic model defining the input schema for the git_init tool (requires repo_path: str).class GitInit(BaseModel): repo_path: str
- src/mcp_server_git/server.py:226-230 (registration)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(), )