Git Stuff Server

Git Stuff Server

MCP server providing Git-related functionalities, primarily a tool to generate diffs for Git merge commits against their first parent.

Category
Visit Server

Tools

get_ado_pr_changed_files

Fetches the list of changed files from the latest iteration of an Azure DevOps Pull Request using a PowerShell script.

get_git_merge_diff

Generates the text diff for a Git merge commit against its first parent within a specified local repository.

README

Git Stuff Server

This repository contains a Node.js application that acts as an MCP (Model Context Protocol) server to provide Git-related functionalities. Currently, it offers a tool to generate the diff for a Git merge commit against its first parent.

Features

  • MCP Server: Runs as a standard MCP server using stdio for communication.
  • get_git_merge_diff Tool:
    • Accepts a Git merge commit hash.
    • Executes the GenerateMergeDiff.ps1 PowerShell script.
    • Returns the textual diff content generated by git show -m --first-parent <commitHash>.

Prerequisites

  • Node.js (Version supporting ES Modules, check engines in package.json if specified, otherwise check tsconfig.json target - ES2022)
  • npm (usually comes with Node.js)
  • Git installed and accessible in the system's PATH.
  • PowerShell (Windows) or pwsh (Linux/macOS) installed and accessible in the system's PATH.

Installation

  1. Clone the repository:
    git clone <your-repo-url>
    cd GitStuffServer
    
  2. Install dependencies:
    npm install
    

Usage

  1. Build the TypeScript code:

    npm run build
    

    This compiles the TypeScript code from src/ to JavaScript in build/.

  2. Run the server:

    • To run the compiled code:
      npm start
      
    • To build and run in development mode:
      npm run dev
      

The server will start and listen for MCP requests on standard input/output.

Using the get_git_merge_diff Tool

When connected via an MCP client, you can call the get_git_merge_diff tool with the following input:

  • commitHash (string): The Git commit hash (SHA) of the merge commit you want to diff.

The tool will return the diff content as text.

How it Works

  1. The MCP server (src/index.ts) receives a request for the get_git_merge_diff tool.
  2. It validates the commitHash input.
  3. It executes the GenerateMergeDiff.ps1 PowerShell script, passing the commitHash.
  4. The PowerShell script runs git show -m --first-parent <commitHash> and saves the output (including any errors) to a temporary file named merge_changes.diff in the server's current working directory.
  5. The Node.js server reads the content of merge_changes.diff.
  6. The server deletes the temporary merge_changes.diff file.
  7. The server returns the diff content (or an error message) to the MCP client.

Configuration

Key configuration points are defined as constants within src/index.ts:

  • SERVER_NAME: The name registered by the MCP server.
  • SCRIPT_NAME: The filename of the PowerShell script to execute.
  • OUTPUT_DIFF_FILE: The name of the temporary diff file created by the script.

License

This project is licensed under the MIT License - see the package.json file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured