Set up Gitea in Metorial for Claude, ChatGPT and Cursor
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'll 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 with at least one access group
- An account with Gitea for each person who connects
- For the CLI steps: the Metorial 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.
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.
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.
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
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
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.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Gitea.
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:
Employee: connect Gitea
In the portal
Open Gitea in the catalog
Sign in to your portal and open Gitea. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. A Gitea sign-in tab opens. Sign in and approve the permissions listed.
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
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.
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.
Check it worked
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). Needsownerandrepo.list_pull_requests: List pull requests in a repository with optional filtering by state, sort order, and pagination. Needsownerandrepo.get_organization: Retrieve detailed information about an organization including its display name, description, and visibility. NeedsorgName.list_pull_request_reviews: List all reviews on a pull request including their approval status and review comments. Needsowner,repoandprNumber.get_pull_request: Retrieve detailed information about a specific pull request including merge status and branch info; use list_pull_request_reviews for reviews. Needsowner,repoandprNumber.get_repo: Retrieve detailed information about a specific repository including its configuration, statistics, and metadata. Needsownerandrepo.list_labels: List all labels available in a repository. Needsownerandrepo.search_repos: Search and list repositories on the Gitea instance.list_wiki_pages: List all wiki pages in a repository. Needsownerandrepo.list_branches: List all branches of a repository with their latest commit info and protection status. Needsownerandrepo.get_issue: Retrieve detailed information about a specific issue including its labels, assignees, milestone, and comments count. Needsowner,repoandissueNumber.get_wiki_page: Retrieve a specific wiki page's content and metadata. Needsowner,repoandpageName.list_releases: List releases in a repository including draft and pre-release versions, their assets, and metadata. Needsownerandrepo.get_file_content: DEPRECATED — use `download_file` instead. Needsowner,repoandpath.list_issues: List issues in a repository with filtering by state and labels. Needsownerandrepo.list_teams: List all teams in an organization with their permissions and accessible units. NeedsorgName.list_collaborators: List all collaborators of a repository with their access information. Needsownerandrepo.list_issue_comments: List all comments on an issue or pull request. Needsowner,repoandissueNumber.list_organizations: List organizations that the authenticated user belongs to.list_commits: List commits in a repository. Needsownerandrepo.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. NeedsorgNameandname.create_pull_request: Create a new pull request to merge changes from a head branch into a base branch. Needsowner,repo,title,headBranchandbaseBranch.create_pull_request_review: Submit a review on a pull request. Needsowner,repo,prNumberandevent.create_release: Create a new release for a repository. Needsowner,repoandtagName.update_release: Update an existing release's title, notes, tag, or draft/pre-release status. Needsowner,repoandreleaseId.create_repo: Create a new Git repository under the authenticated user's account or under a specified organization. Needsname.create_comment: Add a comment to an issue or pull request. Needsowner,repo,issueNumberandbody.create_wiki_page: Create a new wiki page in a repository. Needsowner,repo,titleandcontentBase64.create_milestone: Create a new milestone in a repository for tracking progress on a group of issues and pull requests. Needsowner,repoandtitle.update_comment: Edit an existing comment on an issue or pull request. Needsowner,repo,commentIdandbody.update_pull_request: Update an existing pull request's title, description, state, assignees, or base branch. Needsowner,repoandprNumber.fork_repo: Fork a repository to the authenticated user's account or to a specified organization. Needsownerandrepo.create_branch: Create a new branch in a repository from an existing branch or the default branch. Needsowner,repoandbranchName.create_label: Create a new label in a repository. Needsowner,repo,nameandcolor.update_organization: Update an organization's display name, description, website, location, or visibility. NeedsorgName.update_wiki_page: Update an existing wiki page's content or title. Needsowner,repoandpageName.create_issue: Create a new issue in a repository with optional labels, assignees, milestone, and due date. Needsowner,repoandtitle.update_repo: Update a repository's settings including name, description, visibility, archive status, feature toggles, topics, and default branch. Needsownerandrepo.create_organization: Create a new organization on the Gitea instance. Needsusername.create_or_update_file: Create a new file or update an existing file in a repository. Needsowner,repo,path,contentandmessage.update_issue: Update an existing issue's title, body, state, assignees, labels, milestone, or due date. Needsowner,repoandissueNumber.
Destructive tools (11)
merge_pull_request: Merge a pull request using the specified merge strategy. Needsowner,repoandprNumber.delete_wiki_page: Delete a wiki page from a repository. Needsowner,repoandpageName.delete_release: Delete a release from a repository. Needsowner,repoandreleaseId.delete_repo: Permanently delete a repository. Needsownerandrepo.delete_comment: Delete a comment from an issue or pull request. Needsowner,repoandcommentId.delete_file: Delete a file from a repository. Needsowner,repo,path,fileShaandmessage.manage_collaborator: Add or remove a collaborator from a repository. Needsowner,repo,usernameandaction.manage_team_member: List a team's members, or add or remove a user from an organization team. NeedsteamId,usernameandaction.delete_branch: Delete a branch from a repository. Needsowner,repoandbranchName.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, Cursor, Codex and ChatGPT: connect each client to your portal and use Gitea there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Gitea on metorial.com: the integration overview