gitrama-mcp

gitrama-mcp

AI-powered Git workflow intelligence — 10 tools for commit messages, branch naming, PR descriptions, changelogs, and stream-based context management. Works with Cursor, Claude Desktop, Windsurf, VS Code, and all MCP clients.

Category
访问服务器

README

🌿 Gitrama MCP Server

AI-powered Git intelligence for your IDE — smart commits, branch names, PR descriptions, changelogs, and workflow management.

PyPI Python License: MIT

What is this?

Gitrama MCP Server exposes Gitrama's CLI as 10 MCP tools that any AI assistant can use. Instead of typing gtr commit in your terminal, your AI assistant calls the tool directly — analyzing your code changes, generating commit messages, suggesting branch names, and more.

Works with: Cursor · Claude Desktop · Claude Code · Windsurf · VS Code (Copilot) · Zed · any MCP-compatible client

Install (< 60 seconds)

Step 1: Install the package

pip install gitrama-mcp

Or with uv:

uv pip install gitrama-mcp

This installs both the MCP server and the gitrama CLI.

Step 2: Connect to your IDE

<details> <summary><b>Cursor</b></summary>

Add to .cursor/mcp.json in your project (or global settings):

{
  "mcpServers": {
    "gitrama": {
      "command": "gitrama-mcp"
    }
  }
}

</details>

<details> <summary><b>Claude Desktop</b></summary>

Add to claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "gitrama": {
      "command": "gitrama-mcp"
    }
  }
}

</details>

<details> <summary><b>Claude Code</b></summary>

claude mcp add gitrama gitrama-mcp

</details>

<details> <summary><b>VS Code (Copilot)</b></summary>

Add to .vscode/settings.json:

{
  "mcp": {
    "servers": {
      "gitrama": {
        "command": "gitrama-mcp"
      }
    }
  }
}

</details>

<details> <summary><b>Windsurf</b></summary>

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "gitrama": {
      "command": "gitrama-mcp"
    }
  }
}

</details>

<details> <summary><b>Zed</b></summary>

Add to Zed settings (⌘,):

{
  "context_servers": {
    "gitrama": {
      "command": {
        "path": "gitrama-mcp"
      }
    }
  }
}

</details>

Step 3: Done.

Ask your AI: "Commit my staged changes" — and watch it call gitrama_commit.


Tools (11)

Repository Intelligence

Tool Description
gitrama_ask Ask any question about your repo — ownership, history, risk, changes

Commit Intelligence

Tool Description
gitrama_commit Generate an AI commit message for staged changes
gitrama_stage_and_commit Stage files + commit in one step
gitrama_commit_quality Analyze quality of recent commit messages

Branch Management

Tool Description
gitrama_branch Create a new branch
gitrama_branch_suggest Get AI-suggested branch names from a description

PR & Changelog

Tool Description
gitrama_pr Generate a PR description from branch diff
gitrama_changelog Generate a changelog between refs

Stream (Workflow) Management

Tool Description
gitrama_stream_status Show current workflow stream
gitrama_stream_switch Switch to a different stream
gitrama_stream_list List all streams in the repo

Tool Details

gitrama_ask

Ask a natural language question about your repository. Gitrama analyzes commit history, file structure, blame data, and diffs to answer.

Parameters:

Parameter Type Default Description
question string required Any question about your repo
scope string "auto" Context: "auto", "branch", "full", or "staged"
model string "" AI model override

Example prompts:

  • "Who owns the auth module?"
  • "When did we last change the payment logic?"
  • "What's the riskiest file in this repo?"
  • "Summarize what happened on this branch"
  • "What changed in the last 3 days?"
  • "Explain the purpose of src/utils/retry.py"

gitrama_commit

Generate an AI-powered commit message for staged changes.

Parameters:

Parameter Type Default Description
message_type string "conventional" Style: "conventional", "detailed", or "simple"
context string "" Optional context (e.g., "fixing auth bug")
model string "" AI model override (e.g., "gpt-4o", "claude-sonnet-4-20250514")

Example prompt: "Commit my changes with a conventional message, context: refactoring the payment module"


gitrama_stage_and_commit

Stage files and commit in one step.

Parameters:

Parameter Type Default Description
files string "." Files to stage (. for all, or space-separated paths)
message_type string "conventional" Commit style
context string "" Optional context
model string "" AI model override

Example prompt: "Stage and commit all my changes"


gitrama_commit_quality

Analyze recent commit message quality.

Parameters:

Parameter Type Default Description
count int 10 Number of commits to analyze (1-50)

Example prompt: "How good are our last 20 commit messages?"


gitrama_branch_suggest

Get AI-suggested branch names.

Parameters:

Parameter Type Default Description
description string required Task description
model string "" AI model override

Example prompt: "Suggest a branch name for adding OAuth2 support"


gitrama_pr

Generate a PR description.

Parameters:

Parameter Type Default Description
base string "" Target branch (default: main/master)
model string "" AI model override

Example prompt: "Write a PR description for this branch"


gitrama_changelog

Generate a changelog.

Parameters:

Parameter Type Default Description
since string "" Start ref (tag, branch, hash)
until string "" End ref (default: HEAD)
format string "markdown" "markdown" or "json"
model string "" AI model override

Example prompt: "Generate a changelog since v1.1.4"


Configuration

Environment Variables

Variable Default Description
GTR_CWD os.getcwd() Working directory for git operations
GTR_MCP_TRANSPORT "stdio" Transport: "stdio" or "streamable-http"
GTR_MCP_HOST "0.0.0.0" HTTP host (when using streamable-http)
GTR_MCP_PORT "8765" HTTP port (when using streamable-http)

HTTP Transport (for CI/CD)

GTR_MCP_TRANSPORT=streamable-http GTR_MCP_PORT=8765 gitrama-mcp

Then connect your client to http://localhost:8765/mcp.


Requirements

  • Python 3.10+
  • Git installed and in PATH
  • A Gitrama API key or local Ollama instance

Set your API key:

gtr config --key YOUR_API_KEY

Or use a local model:

gtr config --provider ollama --model llama3

Development

git clone https://github.com/ahmaxdev/gitrama-mcp.git
cd gitrama-mcp
pip install -e ".[dev]"

# Test with MCP Inspector
mcp dev src/gitrama_mcp/server.py

License

MIT — see LICENSE.


Built by Alfonso Harding · gitrama.ai

🌿

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选