MCP Branch Render Document
Creates and maintains branch context documents for Git repositories, enabling AI agents to understand the current branch state, track commits, and detect stale documents without reading the entire repository.
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 Branch Render DocumentShow me the current branch context."
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.
Automatic PR Branch Context Renderer (Branch Render Context MCP)
Branch Render Context is a specialized Model Context Protocol (MCP) server and CLI tool designed to automatically analyze and render complete Git Pull Request / Target Branch contexts relative to a base or checkout branch. It delivers cached, incremental Markdown and JSON documents directly to AI agents with zero branch switching, working tree isolation, automatic .gitignore management, and flexible storage cleanup options.
π― Key Highlights & Architecture
Target Branch Resolution Without Branch Switching:
When your working tree is currently on
mainordevelopand you specify a target branch likefeature/user-auth, the tool automatically determines:baseBranch:main(from current checkout or configured default)targetBranch:feature/user-authComparison:
main..feature/user-auth
Zero Working Tree Disruption:
Developer working trees remain completely untouched. Commands like
git checkoutorgit switchare never executed.
Independent Commit & Ref Resolution:
Target branch commits are resolved directly from local refs or remote tracking refs (
origin/<branch>) without relying on the current HEAD.
Clean Working Tree Isolation:
Uncommitted dirty changes on your current checkout branch will never contaminate the rendered PR context of the target branch.
Git-Like Hierarchical Storage & Automatic
.gitignore:Persists documents in structured paths:
.branch-render-context/repositories/<repo-id>/branches/<branch-path>/document.json.Automatically and idempotently adds
.branch-render-context/to.gitignorewithout altering other user rules.
Built-in Secret Redaction & Token Optimization:
Detects and masks credentials,
.envfiles,.pemcertificates, and API tokens.Generates compact, token-efficient Markdown summaries optimized for LLM context windows.
Granular Cleanup & Concurrency Locking:
Safe multi-process locking (
.storage.lockand.branch.lock).Supports 3 distinct cleanup scopes: single branch, repository-wide, and complete storage wipe.
Related MCP server: organisation.md
π οΈ CLI Guide
1. Render / Refresh Target Branch Context
# 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 --forceExample Output:
=================================================================
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. Interactive Terminal Wizard
npm run branch-render:startThe wizard detects your current checkout branch, displays existing rendered contexts, and guides you through rendering or clearing options.
3. Check Freshness Status
npm run branch-render:status -- --branch feature/user-auth4. List Registered Contexts
npm run branch-render:list5. Context & Storage Cleanup
# 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 Server Integration
Configure the MCP server in your AI editor or client (Claude Desktop, Cursor, Cline, Roo Code):
{
"mcpServers": {
"branch-render-context": {
"command": "node",
"args": ["<path-to-mcp-branch-render-document>/dist/index.js"]
}
}
}Available MCP Tools
Tool Name | Parameters | Description |
|
| Initializes session, discovers repository, and inspects branch state. |
|
| Lists all registered repositories and cached branch documents. |
|
| Evaluates Git freshness between target and base ref without rendering. |
|
| Retrieves |
|
| Triggers deterministic incremental update or full rebuild. |
|
| Clears rendered context for a single branch or all branches in a repository. |
|
| Wipes the entire storage across all repositories (requires |
π Rendered Document Structure
Each rendered branch document contains both a structured JSON object (document.json) and an AI-friendly Markdown representation (document.md):
Repository & Branch Metadata: Unique IDs, remote URLs, comparison refs, and commit hashes.
Commit History: Full list of commits with authors, dates, subjects, and commit bodies (with secret filtering).
File Changes & Diff Statistics: Detailed file list with change status (
added,modified,deleted,renamed), patch chunks, insertions, and deletions.Freshness & Checkpoint State: Saved commit SHAs and timestamps used for ultra-fast incremental re-evaluation.
π§ͺ Development & Testing
# Run Vitest test suite
npm test
# Build TypeScript output
npm run buildπ License
MIT License. Designed for AI agentic workflows and automated coding assistants.
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