MCP Git/PR Assist

MCP Git/PR Assist

Enables Git and GitHub pull request operations through Claude AI, including repository management, branch operations, commits, and PR creation/commenting. Streamlines development workflows by providing Git commands and GitHub API integration through natural language interactions.

Category
Visit Server

README

MCP Git/PR Assist

Claude AI用のGitおよびGitHubプルリクエスト操作を支援するMCP(Model Context Protocol)サーバーです。

機能

Git操作ツール

  • git_status - リポジトリの状態確認
  • create_branch - 新しいブランチの作成
  • stage_and_commit - 変更のステージングとコミット
  • push_branch - ブランチのプッシュ

GitHub操作ツール

  • open_pull_request - プルリクエストの作成
  • comment_pr - プルリクエストへのコメント追加

プロンプト

  • pr_description - プルリクエスト説明文テンプレートの生成

セットアップ

1. 依存関係のインストール

npm install

2. 環境変数の設定

.envファイルを作成し、以下の環境変数を設定してください:

# GitHub Personal Access Token (repo権限が必要)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Git作成者情報
GIT_AUTHOR_NAME=Your Name
GIT_AUTHOR_EMAIL=your.email@example.com

3. GitHub Personal Access Tokenの取得

  1. GitHubの Settings > Developer settings > Personal access tokens にアクセス
  2. "Generate new token (classic)" をクリック
  3. 以下の権限を選択:
    • repo - プライベートリポジトリへのフルアクセス
    • public_repo - パブリックリポジトリへのアクセス
  4. 生成されたトークンを.envファイルに設定

Claude Codeでの使用方法

オプション1: MCP Inspector での動作確認

# サーバーを起動
npm run dev

# 別のターミナルでInspectorを起動
npx @modelcontextprotocol/inspector

オプション2: Claude Code設定

Claude Codeのsettings.jsonに以下を追加:

{
  "mcpServers": {
    "git-pr-assist": {
      "command": "node",
      "args": ["C:\\Users\\niwamoto\\Documents\\mcp-git-assist\\dist\\server.js"],
      "env": {
        "GITHUB_TOKEN": "your_token_here",
        "GIT_AUTHOR_NAME": "Your Name",
        "GIT_AUTHOR_EMAIL": "your.email@example.com"
      }
    }
  }
}

使用例

基本的なGitワークフロー

1. git_status() でリポジトリの状態確認
2. create_branch(ref: "feature/new-feature") で新しいブランチ作成
3. [ファイル編集]
4. stage_and_commit(message: "Add new feature") でコミット
5. push_branch(ref: "feature/new-feature") でプッシュ
6. open_pull_request(...) でプルリクエスト作成

プルリクエスト作成例

// プルリクエストを作成
open_pull_request({
  owner: "username",
  repo: "repository-name", 
  base: "main",
  head: "feature/new-feature",
  title: "新機能の追加",
  body: "この変更は..."
})

// コメントを追加
comment_pr({
  owner: "username",
  repo: "repository-name",
  prNumber: 123,
  body: "レビューをお願いします!"
})

トラブルシューティング

よくある問題

  1. 環境変数が設定されていません

    • .envファイルが正しく作成されているか確認
    • 必要な環境変数がすべて設定されているか確認
  2. GitHub認証エラー

    • Personal Access Tokenが有効か確認
    • トークンに必要な権限(repo)が付与されているか確認
  3. Git操作エラー

    • 対象ディレクトリがGitリポジトリか確認
    • リモートリポジトリが正しく設定されているか確認
  4. SSL証明書エラー

    • 企業ネットワーク環境の場合、IT部門に相談してください

ログの確認

サーバーのログを確認するには:

npm run dev 2>&1 | tee server.log

開発

ビルド

npm run build

型チェック

npx tsc --noEmit

ライセンス

ISC License

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