forgejo-mcp

forgejo-mcp

An MCP server for managing your repositories on Forgejo/Gitea server.

Category
访问服务器

README

Gitea/Forgejo MCP Server

Turn AI into your code repository management assistant

A Model Context Protocol (MCP) server that enables you to manage Gitea/Forgejo repositories through AI assistants like Claude, Gemini, and Copilot.

🚀 Why Use Forgejo MCP Server?

If you want to:

  • Smart progress tracking: Let AI help you track project progress and analyze bottlenecks
  • Automated issue categorization: Automatically tag issue labels and set milestones based on content
  • Priority sorting: Let AI analyze issue content to help prioritize tasks
  • Code review assistance: Get AI suggestions and insights in Pull Requests
  • Project documentation organization: Automatically organize Wiki documents and release notes

Then this tool is made for you!

✨ Supported Features

Issue Management

  • Create, edit, and view issues
  • Add, remove, and replace labels
  • Manage issue comments and attachments
  • Set issue dependencies

Project Organization

  • Manage labels (create, edit, delete)
  • Manage milestones (create, edit, delete)
  • Repository search and listing

Release Management

  • Manage version releases
  • Upload and manage release attachments

Other Features

  • View Pull Requests
  • Manage Wiki pages
  • View Forgejo/Gitea Actions tasks

📦 Installation

Method 1: Use docker (Recommended)

For STDIO mode, you can skip to Usage section.

For SSE/Streamable HTTP mode, you should run forgejo-mcp as server before configuring your MCP client.

docker run -p 8080:8080 -e FORGEJOMCP_TOKEN="my-forgejo-api-token" ronmi/forgejo-mcp http --address :8080 --server https://git.example.com

Method 2: Install from source

go install github.com/raohwork/forgejo-mcp@latest

Method 3: Download Pre-compiled Binaries

Download the appropriate version for your operating system from the Releases page.

🖥️ Usage

This tool provides two primary modes of operation: stdio for local integration and http for remote access.

Before actually setup you MCP client, you have to create an access token on the Forgejo/Gitea server.

  1. Log in to your Forgejo/Gitea instance
  2. Go to SettingsApplicationsAccess Tokens
  3. Click Generate New Token
  4. Select appropriate permission scopes (recommend at least repository and issue write permissions)
  5. Copy the generated token

💡 Tip: For security, consider setting environment variables instead of using tokens directly in config:

export FORGEJOMCP_SERVER="https://your-forgejo-instance.com"
export FORGEJOMCP_TOKEN="your_access_token"

Stdio Mode (for Local Clients)

This is the recommended mode for integrating with local AI assistant clients like Claude Desktop or Gemini CLI. It uses standard input/output for direct communication.

Configure Your AI Client

Using docker:

{
  "mcpServers": {
    "forgejo": {
      "command": "docker",
      "args": [
        "--rm",
        "ronmi/forgejo-mcp",
        "stdio",
        "--server", "https://your-forgejo-instance.com",
        "--token", "your_access_token"
      ]
    }
  }
}

Installed from source or pre-built binary:

{
  "mcpServers": {
    "forgejo": {
      "command": "/path/to/forgejo-mcp",
      "args": [
        "stdio",
        "--server", "https://your-forgejo-instance.com",
        "--token", "your_access_token"
      ]
    }
  }
}

You might want to take a look at Security Recommendations section for best practice.

HTTP Server Mode (for Remote Access)

This mode starts a web server, allowing remote clients to connect via HTTP. It's ideal for web-based services or setting up a central gateway for multiple users.

Run the following command to start the server:

# with local binary
/path/to/forgejo-mcp http --address :8080 --server https://your-forgejo-instance.com

# with docker
docker run -p 8080:8080 -d --rm ronmi/forgejo-mcp http --address :8080 --server https://your-forgejo-instance.com

The server supports two operational modes:

  • Single-user mode: If you provide a --token (or environment variable FORGEJOMCP_TOKEN) at startup, all operations will use that token.
    forgejo-mcp http --address :8080 --server https://git.example.com --token your_token
    
  • Multi-user mode: If no token is provided, the server requires clients to send an Authorization: Bearer <token> header with each request, allowing it to serve multiple users securely.

Client Configuration

For clients that support connecting to a remote MCP server via HTTP, you can add a configuration like this. This example shows how to connect to a server running in multi-user mode:

{
  "mcpServers": {
    "forgejo-remote": {
      "type": "sse",
      "url": "http://localhost:8080/sse",
      "headers": {
        "Authorization": "Bearer your_token"
      }
    }
  }
}

or http type (for Streamable HTTP, use different path in URL)

{
  "mcpServers": {
    "forgejo-remote": {
      "type": "http",
      "url": "http://localhost:8080/",
      "headers": {
        "Authorization": "Bearer your_token"
      }
    }
  }
}

If connecting to a server in single-user mode, you can omit the headers field.

🛡️ Security Recommendations

  1. Use environment variables: Set FORGEJOMCP_SERVER and FORGEJOMCP_TOKEN, then remove --server and --token from your configuration
  2. Limit token permissions: Only grant necessary permission scopes
  3. Rotate tokens regularly: Update access tokens periodically

📋 Usage Examples

After configuration, you can use natural language in your AI assistant to manage your repositories:

"Show me critical bug reports of this repo on my gitea server"

"According to our discussion above, create a detailed issue about this bug, then leave a comment on the issue to describe how we will fix it."

"Give me a report about current milestone. Recent progression in particular."

"Analyze recent pull requests and tell me which ones need priority review"

🤝 Support & Contributing

  • Bug Reports: GitHub Issues
  • Code Contributions: Pull Requests are welcome!

📄 License

This project is licensed under the Mozilla Public License 2.0.


Start making AI your code repository management partner! 🚀

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选