Forgejo MCP server

Integrates with Gitea and Forgejo servers to manage repositories, issues, pull requests, releases, wikis, labels, milestones, and repository actions through conversational commands.
Back to servers
Setup instructions
Provider
raohwork
Release date
Aug 06, 2025
Language
Go
Stats
14 stars

The Gitea/Forgejo MCP Server is a powerful tool that turns AI assistants like Claude, Gemini, and Copilot into capable repository management assistants. It enables you to leverage AI for issue tracking, project organization, code reviews, and documentation management through the Model Context Protocol (MCP).

Installation Options

Using Docker (Recommended)

For SSE/Streamable HTTP mode, run the forgejo-mcp as a server:

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

Installing from Source

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

Using Pre-compiled Binaries

You can download the appropriate version for your operating system from the Releases page.

Setting Up Your Forgejo Token

Before configuring your MCP client, you need to create an access token:

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

For better security, set environment variables instead of using tokens directly:

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

Usage Modes

Stdio Mode (for Local Clients)

This mode is recommended for integrating with local AI assistant clients like Claude Desktop or Gemini CLI.

Configuring 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"
      ]
    }
  }
}

Using installed binary:

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

HTTP Server Mode (for Remote Access)

This mode starts a web server for remote clients to connect via HTTP.

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

Server Modes

Single-user mode:

forgejo-mcp http --address :8080 --server https://git.example.com --token your_token

Multi-user mode: No token provided at startup; clients must send an Authorization header with each request.

Client Configuration

For SSE clients:

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

For HTTP clients:

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

Security Recommendations

  • Use environment variables instead of command-line parameters
  • Limit token permissions to only what's necessary
  • Rotate tokens regularly for better security

Example AI Commands

After configuration, you can use natural language with your AI assistant:

  • "Show me critical bug reports of this repo on my gitea server"
  • "Create a detailed issue about this bug, then leave a comment describing how we'll fix it"
  • "Give me a report about the current milestone, focusing on recent progression"
  • "Analyze recent pull requests and tell me which ones need priority review"

The server supports features including issue management, project organization, release management, pull request viewing, and wiki page management.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

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

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later