git-commands-mcp
MCP Git Repo Browser
Documentation
MCP Git Repo Browser (Node.js)
A Node.js implementation of a Git repository browser using the Model Context Protocol (MCP).
Installation
NPM (Recommended)
npm install -g git-commands-mcpManual Installation
git clone https://github.com/bsreeram08/git-commands-mcp.git
cd git-commands-mcp
npm installConfiguration
Add this to your MCP settings configuration file:
{
"mcpServers": {
"git-commands-mcp": {
"command": "git-commands-mcp"
}
}
}For manual installation, use:
{
"mcpServers": {
"git-commands-mcp": {
"command": "node",
"args": ["/path/to/git-commands-mcp/src/index.js"]
}
}
}Features
The server provides the following tools:
Basic Repository Operations
1. `git_directory_structure`: Returns a tree-like representation of a repository's directory structure
2. `git_read_files`: Reads and returns the contents of specified files in a repository
3. `git_search_code`: Searches for patterns in repository code
Branch Operations
4. `git_branch_diff`: Compare two branches and show files changed between them
Commit Operations
5. `git_commit_history`: Get commit history for a branch with optional filtering
6. `git_commits_details`: Get detailed information about commits including full messages and diffs
7. `git_local_changes`: Get uncommitted changes in the working directory
Project Structure
git-commands-mcp/
├── src/
│ ├── index.js # Entry point
│ ├── server.js # Main server implementation
│ ├── handlers/ # Tool handlers
│ │ └── index.js # Tool implementation functions
│ └── utils/ # Utility functions
│ └── git.js # Git-related helper functions
├── package.json
└── readme.mdImplementation Details
- Uses Node.js native modules (crypto, path, os) for core functionality
- Leverages fs-extra for enhanced file operations
- Uses simple-git for Git repository operations
- Implements clean error handling and resource cleanup
- Creates deterministic temporary directories based on repository URL hashes
- Reuses cloned repositories when possible for efficiency
- Modular code structure for better maintainability
Requirements
- Node.js 14.x or higher
- Git installed on the system
Usage
If installed globally via npm:
git-commands-mcpIf installed manually:
node src/index.jsThe server runs on stdio, making it compatible with MCP clients.
CI/CD
This project uses GitHub Actions for continuous integration and deployment:
Automatic NPM Publishing
The repository is configured with a GitHub Actions workflow that automatically publishes the package to npm when changes are pushed to the master branch.
Setting up NPM_AUTOMATION_TOKEN
To enable automatic publishing, you need to add an npm Automation token as a GitHub secret (this works even with accounts that have 2FA enabled):
1. Generate an npm Automation token:
2. Add the token to your GitHub repository:
Once configured, any push to the master branch will trigger the workflow to publish the package to npm.
License
MIT License - see the LICENSE file for details.
Links
Frequently asked questions
What is git-commands-mcp?
git-commands-mcp is MCP Git Repo Browser
How do I install git-commands-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is git-commands-mcp open source?
Yes — it is hosted on GitHub at https://github.com/bsreeram08/git-commands-mcp and has 2 stars.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.
A powerful Zotero AI and MCP plugin with ChatGPT, Gemini 3.7, Claude Fable 5, Claude Opus 5, DeepSeek V4, Grok, OpenRouter, Kimi k3, GLM 5.3, SiliconFlow, GPT-oss, Gemma 4, Qwen 3.8
Connect your browser to AI models. Just use Dia on Chrome, Arc or Firefox.
文颜 MCP Server 可以让 AI 自动将 Markdown 文章排版后发布至微信公众号。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP