@maxronner/tea-mcp
Enables AI assistants to manage Gitea repositories, issues, and pull requests via the tea CLI, including full PR review workflows.
README
@maxronner/tea-mcp
MCP (Model Context Protocol) server for tea CLI - interact with Gitea repositories, issues, and pull requests from AI assistants.
Features
- List, view, create, close, and reopen issues
- List, view, and checkout pull requests
- Create pull requests with preview mode - review changes before creating
- Approve and reject pull requests - complete PR review workflow
- Merge pull requests - with multiple merge strategies (merge, squash, rebase)
- List and view repository details
- Full integration with MCP-compatible AI tools
Prerequisites
- Node.js 18+
- tea CLI installed and configured with your Gitea instance
Installation
Option 1: NPX (Recommended)
npx @maxronner/tea-mcp
Option 2: Global Install
# Using npm
npm install -g @maxronner/tea-mcp
# Using bun
bun install -g @maxronner/tea-mcp
Option 3: Use with MCP Client
Add to your MCP client configuration (e.g., Claude Desktop, Cline):
{
"mcpServers": {
"tea": {
"command": "npx",
"args": ["@maxronner/tea-mcp"]
}
}
}
Available Tools
Issue Tools
tea_issues_list
List issues in the current repository.
Parameters:
state(optional): "open" | "closed" | "all" (default: "open")limit(optional): 1-100 (default: 30)labels(optional): Filter by labels (comma-separated)author(optional): Filter by author
tea_issue_view
View details of a specific issue.
Parameters:
index(required): Issue number
tea_issue_close
Close an issue.
Parameters:
index(required): Issue number
tea_issue_reopen
Reopen a closed issue.
Parameters:
index(required): Issue number
Pull Request Tools
tea_prs_list
List pull requests in the current repository.
Parameters:
state(optional): "open" | "closed" | "all" (default: "open")limit(optional): 1-100 (default: 30)
tea_pr_view
View details of a specific pull request.
Parameters:
index(required): Pull request number
tea_pr_checkout
Checkout a pull request locally.
Parameters:
index(required): Pull request number to checkout
tea_pr_create
Create a new pull request with optional preview mode.
Parameters:
title(required): Pull request titledescription(optional): PR body/descriptionhead(optional): Source branch name (defaults to current branch)base(optional): Target branch name (defaults to the repository default branch)preview(optional): Show diff without creating PR (default: false)assignees(optional): Comma-separated usernames to assignlabels(optional): Comma-separated labels to assignmilestone(optional): Milestone to assign
Usage:
// Preview what the PR will include
{ "title": "My Feature", "preview": true }
// Create the actual PR
{ "title": "My Feature", "description": "Adds cool feature", "base": "main" }
tea_pr_approve
Approve a pull request.
Parameters:
index(required): Pull request number to approvecomment(optional): Approval comment
Example:
{ "index": 42, "comment": "LGTM! Great work." }
tea_pr_reject
Request changes on a pull request.
Parameters:
index(required): Pull request number to rejectreason(required): Reason for requesting changes
Example:
{ "index": 42, "reason": "Please fix the variable naming convention" }
tea_pr_merge
Merge a pull request.
Parameters:
index(required): Pull request number to mergestyle(optional): Merge strategy - "merge" | "rebase" | "squash" | "rebase-merge" (default: "merge")title(optional): Custom merge commit titlemessage(optional): Custom merge commit message
Example:
// Standard merge
{ "index": 42 }
// Squash merge with custom message
{ "index": 42, "style": "squash", "message": "Squashed feature commits" }
Repository Tools
tea_repos_list
List repositories you have access to.
Parameters:
limit(optional): 1-100 (default: 30)type(optional): "fork" | "mirror" | "source"
tea_repo_view
View details of a repository.
Parameters:
repo(optional): Repository in "owner/name" format (defaults to current repo)
Development
Setup
git clone https://github.com/maxronner/tea-mcp.git
cd tea-mcp
bun install
Commands
bun run build # Build TypeScript
bun test # Run tests
bun run test:run # Run tests once
bun run test:coverage # Run tests with coverage
bun run lint # Run ESLint
bun run lint:fix # Fix lint issues
bun run format # Format with Prettier
bun run typecheck # Type check without emit
Testing
This project uses bun:test with mocked child process execution to test without requiring the tea CLI.
Coverage threshold: 80%
Important Notes
Self-Approval in Gitea
Gitea allows PR authors to approve their own pull requests by default. This is different from GitHub's default behavior. Here's what you need to know:
- Default behavior: PR authors can approve their own PRs, and these approvals count toward any required approval count
- Branch protection: To enforce proper review workflows, use branch protection rules:
- Set "Required approving reviews" to a higher number (e.g., 2+) to ensure external review
- Enable "Require review from Code Owners" and define a
CODEOWNERSfile - Consider enabling
BlockAdminMergeOverrideto prevent even admins from bypassing rules
Recommended Branch Protection Setup
- Navigate to Repository Settings → Branches → Branch Protection Rules
- Enable "Require pull request reviews before merging"
- Set "Required approving reviews" to at least 2
- Create a
.gitea/CODEOWNERSfile:
# Default reviewers for all changes
* @team-lead @senior-devs
# Specific paths require specific reviewers
/src/**/*.ts @typescript-maintainers
/docs/** @documentation-team
- Enable "Require review from Code Owners" in branch protection
This ensures proper code review even when working solo or in small teams.
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes and ensure tests pass:
bun run test:run - Commit with conventional commits
- Push and create a pull request
License
MIT (c) Max Ronner
Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。