MCP Branch Render Document
自動PRブランチコンテキストレンダラー(Branch Render Context MCP)
Branch Render Context は、ベースブランチまたはチェックアウトブランチを基準とした完全なGitプルリクエスト/ターゲットブランチのコンテキストを自動的に解析・レンダリングするために設計された、専門的なModel Context Protocol(MCP)サーバー兼CLIツールです。ブランチ切り替えゼロ、作業ツリーの分離、自動 .gitignore 管理、柔軟なストレージクリーンアップオプションを備え、キャッシュされた増分MarkdownおよびJSONドキュメントをAIエージェントに直接配信します。
🎯 主な特長とアーキテクチャ
ブランチ切り替えなしのターゲットブランチ解決:
現在の作業ツリーが
mainやdevelopにあり、feature/user-authのようなターゲットブランチを指定すると、ツールは自動的に以下を決定します:baseBranch:main(現在のチェックアウトまたは設定済みデフォルトから)targetBranch:feature/user-auth比較:
main..feature/user-auth
作業ツリーへの影響ゼロ:
開発者の作業ツリーは完全にそのまま維持されます。
git checkoutやgit switchなどのコマンドは決して実行されません。
独立したコミット&参照解決:
ターゲットブランチのコミットは、現在のHEADに依存せず、ローカル参照またはリモート追跡参照(
origin/<branch>)から直接解決されます。
クリーンな作業ツリー分離:
現在のチェックアウトブランチにおける未コミットのダーティな変更が、ターゲットブランチのレンダリング済みPRコンテキストを汚染することはありません。
Gitライクな階層ストレージと自動
.gitignore:ドキュメントを構造化パスに永続化:
.branch-render-context/repositories/<repo-id>/branches/<branch-path>/document.json。他のユーザールールを変更することなく、
.branch-render-context/を.gitignoreに自動的かつ冪等に追加します。
組み込みのシークレット編集とトークン最適化:
認証情報、
.envファイル、.pem証明書、APIトークンを検出してマスクします。LLMコンテキストウィンドウ向けに最適化された、コンパクトでトークン効率の高いMarkdownサマリーを生成します。
きめ細かなクリーンアップと並行処理ロック:
安全なマルチプロセスロック(
.storage.lockと.branch.lock)。3つの異なるクリーンアップスコープをサポート: 単一ブランチ、リポジトリ全体、ストレージ完全消去。
Related MCP server: organisation.md
🛠️ CLIガイド
1. ターゲットブランチコンテキストのレンダリング/更新
# Analyze target branch relative to the currently checked-out base branch
npm run branch-render:refresh -- --branch feature/user-auth
# Specify explicit base branch and force a full rebuild
npm run branch-render:refresh -- --branch feature/user-auth --base develop --force出力例:
=================================================================
Target branch: feature/user-auth
Checkout branch: main
Base branch: main
Comparison: main..feature/user-auth
Target commit: 8f3b2a1c
Base commit: 1e4d9c7b
Strategy: full
─────────────────────────────────────────────────────────────────
Metrics:
- Commits: 3
- Changed files: 4
- Insertions: +142
- Deletions: -18
- Worktree dirty: ignored (clean isolation)
─────────────────────────────────────────────────────────────────
Document path:
.branch-render-context/repositories/r_9a2b4c1d/branches/feature/user-auth/document.json
=================================================================2. 対話型ターミナルウィザード
npm run branch-render:startウィザードは現在のチェックアウトブランチを検出し、既存のレンダリング済みコンテキストを表示し、レンダリングまたはクリアのオプションを案内します。
3. 鮮度ステータスの確認
npm run branch-render:status -- --branch feature/user-auth4. 登録済みコンテキストの一覧表示
npm run branch-render:list5. コンテキスト&ストレージのクリーンアップ
# Scope 1: Clear context for a specific branch
npm run branch-render:clear -- --branch feature/user-auth
# Scope 2: Clear all branch contexts in the current repository
npm run branch-render:clear -- --all
# Scope 3: Completely clear ENTIRE storage (all repositories, catalog, config, indexes)
npm run branch-render:clear -- --all-storage --yes🤖 MCPサーバー統合
AIエディタまたはクライアント(Claude Desktop、Cursor、Cline、Roo Code)でMCPサーバーを設定します:
{
"mcpServers": {
"branch-render-context": {
"command": "node",
"args": ["<path-to-mcp-branch-render-document>/dist/index.js"]
}
}
}利用可能なMCPツール
ツール名 | パラメータ | 説明 |
|
| セッションを初期化し、リポジトリを検出し、ブランチ状態を検査します。 |
|
| 登録済みの全リポジトリとキャッシュされたブランチドキュメントを一覧表示します。 |
|
| レンダリングせずにターゲット参照とベース参照間のGit鮮度を評価します。 |
|
| 指定された鮮度ポリシー( |
|
| 決定的な増分更新または完全再構築をトリガーします。 |
|
| リポジトリ内の単一ブランチまたは全ブランチのレンダリング済みコンテキストをクリアします。 |
|
| 全リポジトリにわたるストレージ全体を消去します( |
📄 レンダリング済みドキュメント構造
各レンダリング済みブランチドキュメントには、構造化JSONオブジェクト(document.json)とAIフレンドリーなMarkdown表現(document.md)の両方が含まれます:
リポジトリ&ブランチメタデータ: 一意のID、リモートURL、比較参照、コミットハッシュ。
コミット履歴: 作成者、日付、件名、コミット本文(シークレットフィルタリング付き)を含む全コミットのリスト。
ファイル変更&差分統計: 変更ステータス(
added、modified、deleted、renamed)、パッチチャンク、挿入行数、削除行数を含む詳細なファイルリスト。鮮度&チェックポイント状態: 超高速な増分再評価に使用される保存済みコミットSHAとタイムスタンプ。
🧪 開発とテスト
# Run Vitest test suite
npm test
# Build TypeScript output
npm run build📜 ライセンス
MITライセンス。AIエージェントワークフローと自動コーディングアシスタント向けに設計されています。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides AI coding agents with structured Git repository context including project state, code structure, activity, and risk analysis without modifying or uploading code.53
- AlicenseAqualityBmaintenanceTurns any GitHub repository into your organisation's persistent context layer, enabling AI agents to read, search, and propose updates via pull requests.125MIT
- AlicenseNot gradedqualityBmaintenanceProvides AI agents with persistent, branch-aware context memory by storing summaries per Git branch and automatically enriching them with recent commits and divergence from main. Enables agents to maintain coherent state across sessions without mixing contexts from different branches.12MIT
- AlicenseNot gradedqualityBmaintenanceAutomatically captures project state on git commits, detects context drift, and delivers structured token-budgeted briefings to AI agents, ensuring project continuity without manual effort.1452MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Git-backed platform for skills, tools, and context for AI agents
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Ninh-Duong/mcp-branch-render-document'
If you have feedback or need assistance with the MCP directory API, please join our Discord server