Skip to main content
Glama

Git MCP

MCP server for managing Git operations on local repositories.

Installation

Installing via Smithery

To install Git MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kjozsa/git-mcp --client claude

Installing Manually

uvx install git-mcp

Related MCP server: Git MCP Server

Configuration

Add the MCP server using the following JSON configuration snippet:

{
  "mcpServers": {
    "git-mcp": {
      "command": "uvx",
      "args": ["git-mcp"],
      "env": {
        "GIT_REPOS_PATH": "/path/to/your/git/repositories"
      }
    }
  }
}

Features and Usage

Environment Variables

  • GIT_REPOS_PATH: Path to the directory containing your Git repositories (required)

You can set this in your environment or create a .env file in the directory where you run the server.

Available Methods

list_repositories

Lists all Git repositories in the configured path.

  • Parameters: None

  • Returns: List of repository names

get_last_git_tag

Finds the last Git tag in the specified repository.

  • Parameters: repo_name (Name of the Git repository)

  • Returns: Dictionary with version (tag name) and date (tag creation date)

list_commits_since_last_tag

Lists commit messages between the last Git tag and HEAD.

  • Parameters:

    • repo_name: Name of the Git repository

    • max_count (optional): Maximum number of commits to return

  • Returns: List of dictionaries with hash, author, date, and message

create_git_tag

Creates a new git tag in the specified repository.

  • Parameters:

    • repo_name: Name of the git repository

    • tag_name: Name of the tag to create

    • message (optional): Message for annotated tag (if not provided, creates a lightweight tag)

  • Returns: Dictionary with status, version (tag name), date (tag creation date), and type (annotated or lightweight)

push_git_tag

Pushes an existing git tag to the default remote repository.

  • Parameters:

    • repo_name: Name of the git repository

    • tag_name: Name of the tag to push

  • Returns: Dictionary with status, remote (name of the remote), tag (name of the tag), and message (success message)

refresh_repository

Refreshes a repository by checking out the main branch (or master as fallback) and pulling from all remotes.

  • Parameters:

    • repo_name: Name of the git repository

  • Returns: Dictionary with status, repository, branch, and pull_results (results for each remote)

Troubleshooting

  • Repository Not Found: Ensure GIT_REPOS_PATH is set correctly and the repository exists

  • No Tags Found: The repository doesn't have any tags yet

Development

# Install dependencies
uv pip install -r requirements.txt

# Run in dev mode with Inspector
mcp dev git_mcp/server.py

Testing

The project includes two test scripts:

  1. test_git_mcp.py - Tests the underlying Git command functionality directly, without using the MCP server.

  2. test_mcp_server.py - Tests the MCP server functionality by starting a server instance and making calls to it.

To run the tests:

# Test the Git command functionality
python test_git_mcp.py

# Test the MCP server (requires the git-mcp package to be installed)
python test_mcp_server.py

Available Tools

6 tools
create_git_tagB

Create a new git tag in the repository

Args:
    repo_name: Name of the git repository
    tag_name: Name of the tag to create
    message: Optional message for annotated tag

Returns:
    Dictionary containing status and tag information
ParametersJSON Schema
NameRequiredDescriptionDefault
messageNo
repo_nameYes
tag_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions creating a tag and that the message is optional for annotated tags, but fails to cover critical aspects like whether this requires write permissions, if it's a local or remote operation, error conditions (e.g., duplicate tags), or side effects. This leaves significant gaps for safe and effective tool invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for Args and Returns, and each sentence adds value without redundancy. It could be slightly more front-loaded by moving the return statement earlier, but overall it's efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is minimally adequate. The output schema likely covers return values, reducing the need for detailed return explanations. However, it lacks sufficient behavioral and usage context, making it incomplete for safe operation without additional inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context beyond the input schema, which has 0% description coverage. It clarifies that 'message' is optional and for annotated tags, and implies 'repo_name' and 'tag_name' are required. However, it doesn't detail constraints (e.g., tag naming rules) or provide examples, leaving some ambiguity for the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new git tag') and resource ('in the repository'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'push_git_tag' or 'get_last_git_tag', which would require more specific context about when each is appropriate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'push_git_tag' or 'get_last_git_tag'. It lacks context about prerequisites (e.g., whether the repository must exist locally) or typical use cases (e.g., tagging releases vs. lightweight tags), leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_last_git_tagA

Find the last git tag in the repository

Args:
    repo_name: Name of the git repository

Returns:
    Dictionary containing tag version and date
ParametersJSON Schema
NameRequiredDescriptionDefault
repo_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns a dictionary with tag version and date, which is useful, but does not cover potential errors (e.g., if the repository has no tags), performance aspects, or authentication needs. This leaves gaps for a tool that interacts with a repository.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by structured sections for Args and Returns. Each sentence earns its place by providing essential information without redundancy, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is largely complete. It covers purpose, parameter meaning, and return structure. However, it could improve by addressing error cases or dependencies, slightly reducing completeness for real-world use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter 'repo_name' by specifying it as the 'Name of the git repository', which clarifies its purpose beyond the schema's basic title 'Repo Name'. With 0% schema description coverage and only one parameter, this compensation is effective, though it could detail format expectations (e.g., path vs. name).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Find the last git tag') and resource ('in the repository'), distinguishing it from siblings like 'list_commits_since_last_tag' (which focuses on commits) and 'create_git_tag' (which creates rather than retrieves). The verb 'Find' precisely indicates a retrieval operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing the most recent tag, but does not explicitly state when to use this tool versus alternatives like 'list_repositories' or 'refresh_repository'. It provides basic context but lacks explicit exclusions or comparisons with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_commits_since_last_tagB

List commit messages since main HEAD and the last git tag

Args:
    repo_name: Name of the git repository
    max_count: Maximum number of commits to return

Returns:
    List of dictionaries containing commit hash, author, date, and message
ParametersJSON Schema
NameRequiredDescriptionDefault
max_countNo
repo_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the return format ('List of dictionaries containing commit hash, author, date, and message'), which is helpful, but lacks details on error handling, rate limits, authentication needs, or whether it's read-only/destructive. For a tool with zero annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place: the first sentence states the purpose, and the bullet points efficiently document parameters and output. There's zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is fairly complete. It covers the purpose, parameters, and return values. The output schema exists, so the description doesn't need to explain return values in detail. However, it lacks behavioral context like error cases or usage guidelines, which holds it back from a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains both parameters: 'repo_name: Name of the git repository' and 'max_count: Maximum number of commits to return', including the optional nature of max_count (implied by 'Maximum'). This compensates well for the schema's lack of descriptions, though it doesn't cover all possible nuances like format constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List commit messages since main HEAD and the last git tag'. It specifies the verb ('List'), resource ('commit messages'), and scope ('since main HEAD and the last git tag'). However, it doesn't explicitly differentiate from siblings like 'get_last_git_tag' or 'list_repositories', which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_last_git_tag' (which might provide tag info) or 'list_repositories' (which lists repos), nor does it specify prerequisites or exclusions. Usage is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_repositoriesB

List all git repositories in the configured path

Returns:
    List of repository names
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states it 'list all git repositories' and returns 'list of repository names'. It doesn't disclose behavioral traits like whether it's read-only, if it requires authentication, potential rate limits, or how it handles errors, leaving significant gaps for a tool with siblings that involve mutations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence and adds return value details concisely. It avoids redundancy, but could be slightly more structured by separating usage notes from return details for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, an output schema exists, and siblings include mutation tools, the description is minimally adequate. It covers purpose and return values but lacks context on when to use it versus siblings and behavioral details, making it incomplete for optimal agent guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately omits parameter details, earning a high baseline score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'git repositories' with scope 'in the configured path', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'refresh_repository' or 'list_commits_since_last_tag', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'refresh_repository' or 'list_commits_since_last_tag'. It lacks context about prerequisites, such as whether the path must be pre-configured or if this is a read-only operation compared to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

push_git_tagB

Push a git tag to the default remote

Args:
    repo_name: Name of the git repository
    tag_name: Name of the tag to push

Returns:
    Dictionary containing status and information about the operation
ParametersJSON Schema
NameRequiredDescriptionDefault
repo_nameYes
tag_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the operation pushes to the 'default remote', which adds some context, but fails to disclose critical behavioral traits such as required permissions, whether it overwrites existing tags, error handling, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by structured sections for Args and Returns. Every sentence earns its place with no redundancy, making it efficiently sized and well-organized for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters with 0% schema coverage and no annotations, the description partially compensates by listing parameters and mentioning a return dictionary. However, as a mutation tool, it lacks details on permissions, side effects, or error cases. The output schema exists, so return values needn't be explained, but overall completeness is adequate with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explicitly lists both parameters ('repo_name' and 'tag_name') with brief explanations, adding meaning beyond the bare schema. However, it doesn't detail format constraints (e.g., valid tag names) or examples, preventing a score of 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('push') and resource ('git tag'), specifying it pushes to the 'default remote'. It distinguishes from siblings like 'create_git_tag' (creation vs. pushing) and 'list_repositories' (listing vs. pushing). However, it doesn't explicitly differentiate from all siblings (e.g., 'refresh_repository' might involve pushing), keeping it at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a tag needs to be pushed to a remote, but lacks explicit guidance on when to use this vs. alternatives. For example, it doesn't clarify if this should follow 'create_git_tag' or when to use 'refresh_repository' instead. The context is clear but no exclusions or named alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

refresh_repositoryB

Refresh repository by checking out main branch and pulling all remotes

Args:
    repo_name: Name of the git repository

Returns:
    Dictionary containing status and information about the operation
ParametersJSON Schema
NameRequiredDescriptionDefault
repo_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the core behavior (checkout main, pull remotes) and return format (dictionary with status/info), which is helpful. However, it lacks details on error handling (e.g., if repo doesn't exist), side effects (e.g., overwrites local changes), or operational constraints (e.g., network dependencies). The description adds basic context but misses key behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core action, followed by structured Args/Returns sections. Every sentence earns its place, though the Args section is redundant with the schema. It's efficient but could be more streamlined by integrating param details into the prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 1 parameter with 0% schema coverage, no annotations, and an output schema (implied by Returns statement), the description is moderately complete. It covers the basic operation and return format, but lacks context on errors, prerequisites, or sibling tool relationships. For a mutation tool with no annotation support, it should provide more safety and usage guidance to be fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no param details. The description adds minimal semantics by naming 'repo_name' and stating it's the 'Name of the git repository', but doesn't clarify format (e.g., path, URL, alias) or constraints. It compensates slightly over the bare schema but doesn't fully address the coverage gap for this single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('checking out main branch and pulling all remotes') and identifies the resource ('git repository'). It distinguishes from siblings like 'list_repositories' (listing) and 'create_git_tag' (tagging), though it doesn't explicitly contrast with them. The purpose is unambiguous but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., repository must exist locally), exclusions (e.g., not for repositories with uncommitted changes), or compare to siblings like 'list_repositories' for discovery. Usage is implied by the action described but not explicitly framed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv1.0.0
    • First observedcreate_git_tag
    • First observedget_last_git_tag
    • First observedlist_commits_since_last_tag
    • First observedlist_repositories
    • First observedpush_git_tag
    • First observedrefresh_repository

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: creating tags, getting the last tag, listing commits since the last tag, listing repositories, pushing tags, and refreshing repositories. The descriptions reinforce these distinct functions, making misselection unlikely.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern (e.g., create_git_tag, list_commits_since_last_tag) with clear, descriptive names. The only minor deviation is 'refresh_repository' which uses 'refresh' instead of a more common verb like 'update', but it still fits the pattern and is understandable.

Tool Count5/5

With 6 tools, this server is well-scoped for managing git repositories, focusing on tag operations and repository maintenance. Each tool serves a specific, useful function without bloat, making the count appropriate for the domain.

Completeness3/5

The toolset covers tag management and basic repository operations well, but there are notable gaps in the git domain, such as creating commits, branching, merging, or handling remotes beyond pushing tags. This limits agents from performing full git workflows, though the provided tools are coherent for their specific scope.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that provides Git version control operations for Claude, enabling comprehensive repository management. It allows users to perform tasks such as staging files, committing changes, managing branches, and handling remote operations like pushing and pulling.
    162
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides tools for interacting with Git repositories, enabling AI assistants to manage repositories, branches, commits, and files through a standardized interface.
    7,389
    1
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    A secure, git-aware MCP server for working with local repositories, enabling file management, shell commands, and full git operations within allowed directories.
    607
    1
    GPL 3.0
  • A
    license
    A
    quality
    B
    maintenance
    A local MCP server that provides a safe, explicit set of Git operations for version control tasks like status, diff, branching, staging, committing, fetching, merging, and pushing.
    13
    26
    MIT

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

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