This Model Context Protocol (MCP) server and Command Line Interface (CLI) tool provides tools and resources for interacting with the Forgejo (specifically Codeberg.org) REST API.
  • Go 82.8%
  • HTML 6%
  • Python 5.7%
  • Shell 3.8%
  • Dockerfile 1.4%
  • Other 0.3%
Find a file
b4mad-release-bot fc70d9ab5c chore(release): 2.2.0 [skip ci]
## [2.2.0](https://codeberg.org/goern/forgejo-mcp/compare/v2.1.0...v2.2.0) (2025-10-07)

### ✨ Features

* deprecate GITEA_* environment variables in favor of FORGEJO_* ([8a02cf4](8a02cf44d3))
* implement comprehensive MCP server logging improvements ([6adf8ed](6adf8ed408))

### 📝 Documentation

* update README.md to use forgejo.example.org instead of forgejo.org ([9a8a2a6](9a8a2a69ba))

### ⚡ Refactor

* replace host/port flags with url and separate sse-port ([805fb5d](805fb5da6d))

### 🔁 Chore

* **deps:** update golang docker tag to v1.25 ([0ca5f29](0ca5f29a58))
* **deps:** update golang:1.24-alpine docker digest to c8c5f95 ([633a9f8](633a9f894e))
* **deps:** update golang:1.24-alpine docker digest to daae04e ([062a2a7](062a2a71c8))
* **deps:** update golang:1.24-alpine docker digest to ddf5200 ([f89551b](f89551b263))
* **deps:** update golang:1.25-alpine docker digest to 2ad042d ([f34f911](f34f911e27))
* **deps:** update golang:1.25-alpine docker digest to b6ed3fd ([82808f4](82808f425a))
* **deps:** update golang:1.25-alpine docker digest to f18a072 ([b973fe8](b973fe8ca2))
* remove air part from Makefile ([b328bd0](b328bd0c7a))
2025-10-07 06:53:18 +00:00
.devcontainer add devcontainer 2025-03-18 07:03:59 +00:00
.forgejo/workflows build: ... 2025-09-19 17:53:29 +02:00
.social-media feat: add a project logo 2025-04-24 08:18:33 +02:00
cmd feat: implement comprehensive MCP server logging improvements 2025-09-18 15:25:50 +00:00
operation feat: implement comprehensive MCP server logging improvements 2025-09-18 15:25:50 +00:00
pkg feat: implement comprehensive MCP server logging improvements 2025-09-18 15:25:50 +00:00
.containerignore feat: add smithery.ai integration 2025-04-24 08:19:37 +02:00
.env.sample feat: add stdio and sse MCP server 2025-04-24 08:12:16 +02:00
.gitignore build: update renovate and semantic-release config 2025-04-24 08:50:58 +02:00
.releaserc build: update renovate and semantic-release config 2025-04-24 08:50:58 +02:00
.renovaterc build: update renovate and semantic-release config 2025-04-24 08:50:58 +02:00
.roomodes refactor: move TYPES to dedicated file to resolve circular dependency 2025-04-24 08:13:32 +02:00
.roorules refactor: move TYPES to dedicated file to resolve circular dependency 2025-04-24 08:13:32 +02:00
CHANGELOG.md chore(release): 2.2.0 [skip ci] 2025-10-07 06:53:18 +00:00
codemcp.toml first commit 2025-04-02 00:27:24 -04:00
config.json feat: implement comprehensive MCP server logging improvements 2025-09-18 15:25:50 +00:00
Containerfile chore(deps): update golang:1.25-alpine docker digest to b6ed3fd 2025-09-05 18:07:40 +00:00
go.mod changed forgejo domain .com to .org 2025-04-02 02:35:59 -04:00
go.sum first commit 2025-04-02 00:27:24 -04:00
LICENSE feat: add stdio and sse MCP server 2025-04-24 08:12:16 +02:00
main.go changed forgejo domain .com to .org 2025-04-02 02:35:59 -04:00
Makefile chore: remove air part from Makefile 2025-10-07 08:48:15 +02:00
mcp-settings-sample.json feat: add stdio and sse MCP server 2025-04-24 08:12:16 +02:00
README.md docs: update README.md to use forgejo.example.org instead of forgejo.org 2025-09-18 15:41:38 +00:00
smithery.yaml feat: add smithery.ai integration 2025-04-24 08:19:37 +02:00

Forgejo MCP Server

Forgejo MCP Server is an integration plugin designed to connect Forgejo with Model Context Protocol (MCP) systems. This allows for seamless command execution and repository management through an MCP-compatible chat interface.

🚧Installation

🔧Build from Source

You can download the source code by cloning the repository using Git:

git clone https://codeberg.org/goern/forgejo-mcp.git

Before building, make sure you have the following installed:

  • make
  • Golang (Go 1.24 or later recommended)

Then run:

make build

📁Add to PATH

After building, copy the binary forgejo-mcp to a directory included in your system's PATH. For example:

cp forgejo-mcp /usr/local/bin/

🚀Usage

This example is for Cursor, you can also use plugins in VSCode. To configure the MCP server for Forgejo, add the following to your MCP configuration file:

  • stdio mode
{
  "mcpServers": {
    "forgejo": {
      "command": "forgejo-mcp",
      "args": [
        "--transport", "stdio",
        "--url", "https://forgejo.example.org"
        // "--token", "<your personal access token>"
      ],
      "env": {
        // "FORGEJO_URL": "https://forgejo.example.org",
        "FORGEJO_ACCESS_TOKEN": "<your personal access token>"
      }
    }
  }
}
  • sse mode
{
  "mcpServers": {
    "forgejo": {
      "url": "http://localhost:8080/sse"
    }
  }
}

Note

You can provide your Forgejo URL and access token either as command-line arguments or environment variables. Command-line arguments have the highest priority. Environment variables have been updated:

  • Use FORGEJO_URL instead of the deprecated GITEA_HOST
  • Use FORGEJO_ACCESS_TOKEN instead of the deprecated GITEA_ACCESS_TOKEN
  • Use FORGEJO_DEBUG instead of the deprecated GITEA_DEBUG

The old GITEA_* variables are still supported for backward compatibility but will show deprecation warnings.

Once everything is set up, try typing the following in your MCP-compatible chatbox:

list all my repositories

✅Available Tools

The Forgejo MCP Server supports the following tools:

Tool Scope Description
get_my_user_info User Get the information of the authenticated user
create_repo Repository Create a new repository
fork_repo Repository Fork a repository
list_my_repos Repository List all repositories owned by the authenticated user
create_branch Branch Create a new branch
delete_branch Branch Delete a branch
list_branches Branch List all branches in a repository
list_repo_commits Commit List all commits in a repository
get_file_content File Get the content and metadata of a file
create_file File Create a new file
update_file File Update an existing file
delete_file File Delete a file
get_issue_by_index Issue Get an issue by its index
list_repo_issues Issue List all issues in a repository
create_issue Issue Create a new issue
create_issue_comment Issue Create a comment on an issue
get_pull_request_by_index Pull Request Get a pull request by its index
list_repo_pull_requests Pull Request List all pull requests in a repository
create_pull_request Pull Request Create a new pull request
search_users User Search for users
search_org_teams Organization Search for teams in an organization
search_repos Repository Search for repositories
get_forgejo_mcp_server_version Server Get the version of the Forgejo MCP Server

🐛Debugging

To enable debug mode, add the -d flag when running the Forgejo MCP Server with sse mode:

./forgejo-mcp --transport sse --url <forgejo-url> [--sse-port 8080] --token <your personal access token> --debug

Enjoy exploring and managing your Forgejo repositories via chat!