Gitea/Forgejo MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> 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
- 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.
Method 2: Install from source
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 **Settings** → **Applications** → **Access 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:
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:
Installed from source or pre-built binary:
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:
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.