Gitea logo

Gitea

by Forgejo / Codeberg

Read Forgejo, Codeberg, and Gitea repositories, issues, pull requests, CI runs, files, releases, and more over MCP.

Install Gitea

Run the project’s own setup commands, in order.

Setup steps from the project

Forgejo / Codeberg / Gitea installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    cargo build --release   # target/release/forgejo-mcp-rs
    
  2. 2. Install
    cargo install --path .  # install to ~/.cargo/bin
    
  3. 3. Add to Claude Code
    claude mcp add --scope user forgejo /path/to/target/release/forgejo-mcp-rs \
      --env FORGEJO_URL=https://codeberg.org \
      --env FORGEJO_TOKEN_READ_ONLY=your_read_token_here
    

Overview

Forgejo / Codeberg / Gitea is a Rust MCP server that connects AI clients to Forgejo- and Gitea-compatible REST APIs. It exposes read tools for repositories, issues, pull requests, branches, commits, files, reviews, CI runs, releases, notifications, and account data over stdio. Read-only access is the default; guarded write operations can be enabled with a separate token and time-limited write mode. Use it when an agent needs authenticated repository inspection or CI and release information from a Forgejo, Codeberg, or Gitea instance.

Use cases

  • Inspect repositories, branches, files, and commits
  • Review issues, pull requests, comments, reviews, and diffs
  • Check CI workflow runs, statuses, jobs, and logs
  • Query releases, assets, notifications, and repository metadata

Key features

  • Forgejo, Codeberg, and Gitea REST API access
  • Automatic pagination and slimmed list responses
  • Normalized Forgejo and Gitea Actions data
  • Line-ranged file reads and bounded log retrieval
  • Combined CI status checks
  • Time-limited opt-in write mode

Tools56

What Gitea lets your agent do. Expand a tool for its parameters.

Self-reported~2.0k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 49d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Tools exposed56Callable tools this server registers over MCP.
Directory activity11 viewsConfig copies, upvotes, and views on AllMCPs.

How Gitea works

What Forgejo / Codeberg / Gitea does

Forgejo / Codeberg / Gitea connects an MCP client to a Forgejo or Gitea instance through its REST API. Codeberg is the default endpoint, but FORGEJO_URL can point to another compatible installation. The server is implemented in Rust and provides tools only: it does not expose MCP resources, prompts, sampling, or roots.

The read surface covers the authenticated account, repositories, organizations, issues, pull requests, comments, reviews, branches, commits, branch protections, repository trees, file contents, search, notifications, releases, and release assets. It also normalizes Actions-related data across Forgejo and Gitea, including workflow runs, jobs, job logs, individual commit statuses, and combined CI results.

Read results are commonly reduced to practical fields rather than returning every API field. Pagination is handled automatically for several list operations. File reads can target a line range, pull request diffs can be narrowed to a file, and commit or workflow queries support filters such as refs, paths, statuses, and events.

How it works

The server communicates directly with the Forgejo/Gitea REST API using an in-house client. It runs over stdio and negotiates MCP protocol versions so older clients can continue to connect. The connected forge is detected lazily from its version response, or can be selected explicitly with FORGEJO_FLAVOR.

Forgejo and Gitea use different names and response formats for some Actions endpoints. The server translates workflow filters, normalizes run and job fields, and adapts differences in dispatch, cancellation, reruns, and job lookup. Other shared endpoints, including issues, pull requests, diffs, branches, files, search, organizations, notifications, migration, and push-mirror operations, use the common API surface.

CI inspection includes a combined-status tool for the direct question of whether checks passed, while the individual-status tool preserves each check's context, state, description, and target URL. Job logs are retrieved in bounded byte windows, with navigation fields for requesting earlier or later portions.

Setup and configuration

Build with Cargo using cargo build --release, or install the executable with cargo install --path .. The project runs on macOS and Linux; Windows is untested.

Set FORGEJO_TOKEN_READ_ONLY to a read token before starting the server. The token must be distinct from the optional FORGEJO_TOKEN_WRITE; a write token alone is rejected. Read scopes such as repository, issue, and user access are sufficient for the read tools. FORGEJO_URL defaults to Codeberg, and FORGEJO_FLAVOR accepts forgejo, gitea, or auto.

Providing FORGEJO_TOKEN_WRITE enables guarded write tools. Write mode uses a time-limited window controlled by FORGEJO_WRITE_MINUTES, which defaults to 10 minutes and is capped at 60. Separate credentials can be supplied for repository migration and push mirrors. Release asset uploads require FORGEJO_UPLOAD_ROOT; the upload size limit is configurable with FORGEJO_UPLOAD_MAX_MB.

Tools and capabilities

  • Verify the authenticated user and connected forge version.
  • List repositories, organizations, notifications, issues, pull requests, comments, reviews, branches, and releases.
  • Inspect repository metadata, branch protections, trees, files, commits, signatures, keys, diffs, and changed files.
  • Query individual and combined commit statuses.
  • List workflow runs and jobs, retrieve run details, and read bounded job-log sections.
  • Search repositories and inspect release assets.
  • Report write-token and write-mode state with write_status.

Limitations and notes

Forgejo and Gitea Actions behavior is normalized, but some differences remain visible when an endpoint returns an error or when one forge omits fields. Forgejo 16 or newer is required for workflow job support. Gitea does not report the same SSH-key verification field as Forgejo, so an absent value should not be interpreted as a failed verification.

Repository trees can be truncated, so callers should inspect the truncated indicator before deciding that a path is absent. Pull request diffs are capped at 64 KiB unless a file-specific request or a larger max_bytes value is used. Job logs default to the last 32 KiB and can be requested in additional windows up to 1 MiB.

The server is read-only by default, and credentials for migration and push mirrors are kept in environment variables rather than passed as tool arguments. Windows support is untested.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gitea

Forgejo / Codeberg / Gitea is an MCP server that connects AI clients to Forgejo, Codeberg, and Gitea REST APIs. Its main tools inspect users, repositories, issues, pull requests, branches, commits, files, reviews, releases, notifications, workflow runs, job logs, and CI statuses, with guarded writes available when configured.

Install it with Cargo using `cargo install --path .`, or build a release binary with `cargo build --release`. The resulting server runs over stdio and can be configured as an MCP server in a compatible client.

It requires `FORGEJO_TOKEN_READ_ONLY` containing a read token. Read scopes for repositories, issues, and users are sufficient for the read tools. An optional, separate `FORGEJO_TOKEN_WRITE` enables guarded write operations; the server rejects using only a write token.

Yes. Codeberg is the default instance URL, and the server connects to it through the Forgejo-compatible REST API. Set `FORGEJO_URL` when using another Forgejo or Gitea installation.

Yes. Claude Desktop is named as an MCP client for this server, which runs over stdio. Claude Code is also named as a supported client.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG Preview Gitea AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/forgejo-codeberg-gitea?style=directory)](https://allmcps.com/mcp/forgejo-codeberg-gitea)
HTML Embed
<a href="https://allmcps.com/mcp/forgejo-codeberg-gitea"><img src="https://allmcps.com/api/badge/forgejo-codeberg-gitea?style=directory" alt=" Gitea on AllMCPs" /></a>