> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Gitea in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/gitea
Last updated: 2026-11-24

Share Gitea with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or personal access token sign-in, 54 tools (22 read-only).

---

To give your team Gitea in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Gitea integration in a Metorial portal, and each person signs in to Gitea with their own account. Agents can manage repositories, branches, files, and commit history on your Gitea instance. The integration has 54 tools, 22 read-only, 21 write and 11 destructive, plus 6 triggers.

**What you will learn**

- How an admin shares Gitea in a portal and how each person connects
- The 18 OAuth scopes Gitea can request, and what each one allows
- How to keep the 22 read-only tools and reject the other 32

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with Gitea for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Personal Access Token** | API token | `token` and `baseUrl` |
| **OAuth2** (default) | OAuth | Signs in to Gitea after entering `baseUrl` |

The portal and `metorial setup` use **OAuth2** unless someone picks another method.

### Personal Access Token

To connect, a person enters these values:

- `token`: Gitea personal access token (generated from Settings → Applications)
- `baseUrl`: Base URL of the Gitea instance, e.g. https://gitea.example.com

### OAuth2

Before the sign-in, setup asks for:

- `baseUrl`: Base URL of the Gitea instance, e.g. https://gitea.example.com

People sign in to Gitea and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `read:repository` | Read Repository | Read repository data including files, branches, tags, and commits |
| `write:repository` | Write Repository | Create, update, and delete repositories and their contents |
| `read:issue` | Read Issue | Read issues, labels, and milestones |
| `write:issue` | Write Issue | Create and manage issues, labels, and milestones |
| `read:organization` | Read Organization | Read organization and team information |
| `write:organization` | Write Organization | Manage organizations and teams |
| `read:user` | Read User | Read user profile information |
| `write:user` | Write User | Manage user settings and keys |
| `read:notification` | Read Notification | Read user notifications |
| `write:notification` | Write Notification | Manage user notifications |
| `read:package` | Read Package | Read package information |
| `write:package` | Write Package | Publish and manage packages |
| `read:admin` | Read Admin | Read site-wide admin information |
| `write:admin` | Write Admin | Perform site-wide admin operations |
| `read:activitypub` | Read ActivityPub | Read ActivityPub data |
| `write:activitypub` | Write ActivityPub | Manage ActivityPub operations |
| `read:misc` | Read Misc | Read miscellaneous data |
| `write:misc` | Write Misc | Manage miscellaneous operations |

### Setup settings

Whichever method you pick, setup also asks for:

- `baseUrl`: Base URL of the Gitea instance, e.g. https://gitea.example.com

## Use your own Gitea OAuth app

With your own OAuth app, people see your company's name on the Gitea consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose Gitea and copy the **Redirect URI**.

2. **Register the app with Gitea**

   Create an OAuth app or client in Gitea and add the redirect URI from Metorial as its redirect or callback URL.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the Gitea integration.

## Admin: share Gitea in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Gitea. Under **Auth Method**, keep **OAuth2** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to Gitea as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Gitea.

4. **Choose who gets it**

   Add the access groups that should see Gitea. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Gitea integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search gitea
```

## Employee: connect Gitea

### In the portal

1. **Open Gitea in the catalog**

   Sign in to your portal and open Gitea. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. A Gitea sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search gitea
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **OAuth2**. To connect with **Personal Access Token** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your Gitea connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list gitea
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 22 read-only tools, such as `get_repo` and `get_issue`, and lose the 21 write tools, such as `fork_repo` or `create_repo`, and the 11 destructive tools, such as `delete_file` or `delete_repo`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list gitea
metorial tools <integration-id>
metorial call <integration-id> list_organizations -d '{}'
```

`metorial tools` lists the 54 tools, minus any you rejected. `list_organizations` takes no input. It lists organizations that the authenticated user belongs to.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (22)

- `list_milestones`: List milestones in a repository with their progress (open/closed issue counts). Needs `owner` and `repo`.
- `list_pull_requests`: List pull requests in a repository with optional filtering by state, sort order, and pagination. Needs `owner` and `repo`.
- `get_organization`: Retrieve detailed information about an organization including its display name, description, and visibility. Needs `orgName`.
- `list_pull_request_reviews`: List all reviews on a pull request including their approval status and review comments. Needs `owner`, `repo` and `prNumber`.
- `get_pull_request`: Retrieve detailed information about a specific pull request including merge status and branch info; use list_pull_request_reviews for reviews. Needs `owner`, `repo` and `prNumber`.
- `get_repo`: Retrieve detailed information about a specific repository including its configuration, statistics, and metadata. Needs `owner` and `repo`.
- `list_labels`: List all labels available in a repository. Needs `owner` and `repo`.
- `search_repos`: Search and list repositories on the Gitea instance.
- `list_wiki_pages`: List all wiki pages in a repository. Needs `owner` and `repo`.
- `list_branches`: List all branches of a repository with their latest commit info and protection status. Needs `owner` and `repo`.
- `get_issue`: Retrieve detailed information about a specific issue including its labels, assignees, milestone, and comments count. Needs `owner`, `repo` and `issueNumber`.
- `get_wiki_page`: Retrieve a specific wiki page's content and metadata. Needs `owner`, `repo` and `pageName`.
- `list_releases`: List releases in a repository including draft and pre-release versions, their assets, and metadata. Needs `owner` and `repo`.
- `get_file_content`: DEPRECATED — use `download_file` instead. Needs `owner`, `repo` and `path`.
- `list_issues`: List issues in a repository with filtering by state and labels. Needs `owner` and `repo`.
- `list_teams`: List all teams in an organization with their permissions and accessible units. Needs `orgName`.
- `list_collaborators`: List all collaborators of a repository with their access information. Needs `owner` and `repo`.
- `list_issue_comments`: List all comments on an issue or pull request. Needs `owner`, `repo` and `issueNumber`.
- `list_organizations`: List organizations that the authenticated user belongs to.
- `list_commits`: List commits in a repository. Needs `owner` and `repo`.
- `download_file`: Download a repository file and return metadata including its blob SHA for subsequent edits.
- `get_current_user`: Identify the authenticated Gitea user and discover the username used to own repositories.

### Write tools (21)

- `create_team`: Create a new team within an organization with specified permissions and unit access. Needs `orgName` and `name`.
- `create_pull_request`: Create a new pull request to merge changes from a head branch into a base branch. Needs `owner`, `repo`, `title`, `headBranch` and `baseBranch`.
- `create_pull_request_review`: Submit a review on a pull request. Needs `owner`, `repo`, `prNumber` and `event`.
- `create_release`: Create a new release for a repository. Needs `owner`, `repo` and `tagName`.
- `update_release`: Update an existing release's title, notes, tag, or draft/pre-release status. Needs `owner`, `repo` and `releaseId`.
- `create_repo`: Create a new Git repository under the authenticated user's account or under a specified organization. Needs `name`.
- `create_comment`: Add a comment to an issue or pull request. Needs `owner`, `repo`, `issueNumber` and `body`.
- `create_wiki_page`: Create a new wiki page in a repository. Needs `owner`, `repo`, `title` and `contentBase64`.
- `create_milestone`: Create a new milestone in a repository for tracking progress on a group of issues and pull requests. Needs `owner`, `repo` and `title`.
- `update_comment`: Edit an existing comment on an issue or pull request. Needs `owner`, `repo`, `commentId` and `body`.
- `update_pull_request`: Update an existing pull request's title, description, state, assignees, or base branch. Needs `owner`, `repo` and `prNumber`.
- `fork_repo`: Fork a repository to the authenticated user's account or to a specified organization. Needs `owner` and `repo`.
- `create_branch`: Create a new branch in a repository from an existing branch or the default branch. Needs `owner`, `repo` and `branchName`.
- `create_label`: Create a new label in a repository. Needs `owner`, `repo`, `name` and `color`.
- `update_organization`: Update an organization's display name, description, website, location, or visibility. Needs `orgName`.
- `update_wiki_page`: Update an existing wiki page's content or title. Needs `owner`, `repo` and `pageName`.
- `create_issue`: Create a new issue in a repository with optional labels, assignees, milestone, and due date. Needs `owner`, `repo` and `title`.
- `update_repo`: Update a repository's settings including name, description, visibility, archive status, feature toggles, topics, and default branch. Needs `owner` and `repo`.
- `create_organization`: Create a new organization on the Gitea instance. Needs `username`.
- `create_or_update_file`: Create a new file or update an existing file in a repository. Needs `owner`, `repo`, `path`, `content` and `message`.
- `update_issue`: Update an existing issue's title, body, state, assignees, labels, milestone, or due date. Needs `owner`, `repo` and `issueNumber`.

### Destructive tools (11)

- `merge_pull_request`: Merge a pull request using the specified merge strategy. Needs `owner`, `repo` and `prNumber`.
- `delete_wiki_page`: Delete a wiki page from a repository. Needs `owner`, `repo` and `pageName`.
- `delete_release`: Delete a release from a repository. Needs `owner`, `repo` and `releaseId`.
- `delete_repo`: Permanently delete a repository. Needs `owner` and `repo`.
- `delete_comment`: Delete a comment from an issue or pull request. Needs `owner`, `repo` and `commentId`.
- `delete_file`: Delete a file from a repository. Needs `owner`, `repo`, `path`, `fileSha` and `message`.
- `manage_collaborator`: Add or remove a collaborator from a repository. Needs `owner`, `repo`, `username` and `action`.
- `manage_team_member`: List a team's members, or add or remove a user from an organization team. Needs `teamId`, `username` and `action`.
- `delete_branch`: Delete a branch from a repository. Needs `owner`, `repo` and `branchName`.
- `delete_organization`: Permanently delete an empty Gitea organization.
- `delete_team`: Delete an organization team and its access grants.

## Triggers

Gitea has 6 triggers, which fire on events in Gitea:

- `repository_events`: Triggers on repository lifecycle events including creation, deletion, forking, and branch/tag creation or deletion.
- `push_events`: Triggers when commits are pushed to a repository, including information about the branch, commits, and pusher.
- `pull_request_events`: Triggers on pull request events including creation, updates, merges, assignment changes, label changes, comments, reviews, and sync events.
- `issue_events`: Triggers on issue-related events including creation, updates, assignment changes, label changes, milestone changes, and comments.
- `wiki_events`: Triggers when wiki pages are created, edited, renamed, or deleted in a repository.
- `release_events`: Triggers when releases are created, updated, or deleted in a repository.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Gitea there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Gitea on metorial.com](https://metorial.com/integrations/gitea): the integration overview