Skip to main content
Glama
archish9

GitHub MCP Server

by archish9

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
REPO_PATHNoSet the default absolute path to your git repository to avoid passing repo_path in every tool call.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
initialize_repo

Initialize a new git repository at the specified path.

This tool creates a .git directory at repo_path if it doesn't already exist. It is safe to call on an existing repository (it will return a success message without modifying the repo).

Args: repo_path: The absolute path to the directory where the git repository should be initialized. If the directory does not exist, it will be created. initial_commit: If True, and the repository is empty or fresh, an initial commit will be created. This includes creating a README.md if one doesn't exist. Default is True.

Returns: A status message indicating whether the repository was initialized, already existed, or if an initial commit was created.

get_repo_status

Get the current status of the git repository.

This tool provides a snapshot of the repository's state, including:

  • Initialization status (is it a git repo?)

  • Current branch name

  • Whether there are uncommitted changes

  • Lists of staged, modified, and untracked files

Use this tool before committing to verify what changes will be included, or to simply check the current context (branch, pending changes).

Args: repo_path: The absolute path to the repository.

Returns: A JSON-formatted string containing the repository status details.

Example JSON structure:
{
  "is_initialized": true,
  "current_branch": "main",
  "has_changes": true,
  "staged_files": ["file1.py"],
  "modified_files": ["file2.py"],
  "untracked_files": ["new_file.py"]
}
commit_all_changes

Stage ALL changes (including untracked files) and create a commit.

This tool acts as a "save point" for the project. It performs the equivalent of:

  1. git add -A (Stages all modified, deleted, and new files)

  2. git commit -m "message"

It will automatically initialize the repository if it hasn't been initialized yet.

Args: repo_path: The absolute path to the repository. message: A descriptive commit message. Common prefixes: 'feat:', 'fix:', 'docs:', 'refactor:', 'test:'.

Returns: The SHA (full hash) of the new commit, or a message indicating "No changes to commit" if the working directory was clean.

list_commits

List the commit history for a specific branch or reference.

Retrieves a list of commits starting from the specified branch (or HEAD), going back in history up to limit. Each commit includes:

  • SHA (full and short)

  • Message

  • Author details

  • Timestamp

Args: repo_path: The absolute path to the repository. branch: The branch name, tag, or commit SHA to start listing from. Defaults to "HEAD" (current checkout). limit: The maximum number of commits to return. Defaults to 50.

Returns: A JSON-formatted string containing a list of commit objects.

rollback_to_commit

Roll back the repository state to a previous commit.

This tool resets the current branch head to commit_sha. The mode determines what happens to the working directory and index:

  • "soft" (Default): Undoes the commit(s) but leaves changes staged in the index. Useful if you want to squash commits or fix the last commit message.

  • "mixed": Undoes the commit(s) and unstages changes, but keeps the files in the working directory. Useful if you want to keep the work but start fresh with staging.

  • "hard": WARNING - Destructive! Resets everything to the state of commit_sha. Any uncommitted changes (staged or unstaged) will be PERMANENTLY LOST. Use this only if you want to discard all work since commit_sha.

Args: repo_path: The absolute path to the repository. commit_sha: The full or short SHA of the commit to revert to. mode: The reset mode: "soft", "mixed", or "hard".

Returns: A message confirming the rollback and the new HEAD SHA.

compare_commits

Compare two commits and return the diff.

This tool generates a detailed comparison between two points in the history (from_commit -> to_commit). It's useful for:

  • Reviewing changes between versions.

  • Debugging when a bug was introduced.

  • Generating a changelog.

The output includes a summary of file changes (added, modified, deleted, renamed) and the actual diff content for each file.

Args: repo_path: The absolute path to the repository. from_commit: The source (older) commit SHA. to_commit: The target (newer) commit SHA.

Returns: A JSON-formatted string containing the list of changed files, additions/deletions counts, and diff patches.

create_branch

Create a new git branch.

This tool creates a new branch pointer but DOES NOT switch to it. To start working on the new branch, you must call switch_branch afterwards.

Args: repo_path: The absolute path to the repository. branch_name: The name of the new branch (e.g., "feature/new-login"). from_ref: The commit SHA or branch name to start the new branch from. If not provided, defaults to the current HEAD.

Returns: A confirmation message containing the new branch name.

switch_branch

Switch the repository to a different branch.

This command updates the working directory to match the state of the specified branch. It performs a git checkout.

Args: repo_path: The absolute path to the repository. branch_name: The name of the branch to switch to. The branch must already exist.

Returns: A confirmation message indicating the successful switch and current branch name.

list_branches

List all branches in the repository.

Shows all local branches with current branch marked.

Args: repo_path: Path to the repository directory

Returns: JSON list of branches with current branch indicator

generate_commit_message

Generate a suggested commit message based on staged changes.

This tool analyzes the staged and modified files to suggest a commit message. Note: This uses a simple heuristic (template-based), not a full LLM analysis of the diff content. It is useful as a starting point or for quick commits.

Styles:

  • "conventional": Uses Conventional Commits format (feat: ..., fix: ..., chore: ...) based on file types.

  • "simple": Returns a plain predictive sentence like "Update 3 files".

Args: repo_path: The absolute path to the repository. style: The message style format to use. Defaults to "conventional".

Returns: A string containing the suggested commit message and a brief summary of detected changes.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/archish9/github-mcp-small'

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