Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Git/PR Assistcreate a pull request for my feature branch to main"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 install2. 環境変数の設定
.envファイルを作成し、以下の環境変数を設定してください:
# GitHub Personal Access Token (repo権限が必要)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Git作成者情報
GIT_AUTHOR_NAME=Your Name
GIT_AUTHOR_EMAIL=your.email@example.com3. GitHub Personal Access Tokenの取得
GitHubの Settings > Developer settings > Personal access tokens にアクセス
"Generate new token (classic)" をクリック
以下の権限を選択:
repo- プライベートリポジトリへのフルアクセスpublic_repo- パブリックリポジトリへのアクセス
生成されたトークンを
.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: "レビューをお願いします!"
})トラブルシューティング
よくある問題
環境変数が設定されていません
.envファイルが正しく作成されているか確認必要な環境変数がすべて設定されているか確認
GitHub認証エラー
Personal Access Tokenが有効か確認
トークンに必要な権限(repo)が付与されているか確認
Git操作エラー
対象ディレクトリがGitリポジトリか確認
リモートリポジトリが正しく設定されているか確認
SSL証明書エラー
企業ネットワーク環境の場合、IT部門に相談してください
ログの確認
サーバーのログを確認するには:
npm run dev 2>&1 | tee server.log開発
ビルド
npm run build型チェック
npx tsc --noEmitライセンス
ISC License
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.