forgejo-mcp
Manage a Forgejo instance (e.g. Codeberg) through natural language: browse and search users, repositories, issues, pull requests, files, commits, Actions runs, organizations, and notifications, plus create/update/delete where write access allows.
Users & notifications: get a user or the authenticated user, search users, list owned repos, list and mark notifications read.
Repositories: get/list/search/create/fork/delete repos, list/create/delete branches, list/create labels, list/create milestones, list repo topics.
Files & commits: read file content (UTF-8 or base64), create/update/delete files, list commits, get a commit by SHA.
Issues: list/get/create/update issues, list/create/edit/delete issue comments.
Pull requests & reviews: list/get/create/update/merge PRs, list reviews and review comments, submit reviews.
CI/CD Actions: list and get workflow runs, trigger
workflow_dispatchworkflows.Organizations: list a user's orgs, list org repos and members, search org teams.
Supports pagination on list tools, read-only mode, and self-signed TLS handling.
Supports connecting to Codeberg as a Forgejo instance, enabling management of repositories, issues, pull requests, files, commits, Actions workflow runs, organizations, and notifications.
Provides tools for interacting with a Forgejo instance's REST API to manage repositories, issues, pull requests, files, commits, Actions workflow runs, organizations, and notifications.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@forgejo-mcp Show me my unread notifications"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
forgejo-mcp
An MCP server (stdio) for the Forgejo REST API. Connect your AI assistant to any Forgejo instance (e.g. Codeberg) to manage repositories, issues, pull requests, files, commits, Actions workflow runs, organizations, and notifications through natural language.
Single Python package, one HTTP client created at startup, configuration via
environment variables only. Built on the official
mcp SDK (high-level server API) and httpx.
Configuration (environment variables)
Variable | Required | Default | Description |
| yes | — | Forgejo instance base URL, e.g. |
| yes | — | Personal access token |
| no |
| HTTP |
| no |
| HTTP request timeout, seconds |
| no |
|
|
| no |
|
|
Missing FORGEJO_URL/FORGEJO_ACCESS_TOKEN or an invalid boolean abort
startup with a clear error. Booleans accept true/false/1/0/yes/no
(case-insensitive).
Create a token at Settings → Applications → Access Tokens with the scopes
your operations need (e.g. read:repository, write:issue,
write:repository).
Related MCP server: @maxronner/tea-mcp
Tools
All requests are scoped to {FORGEJO_URL}/api/v1. Pageable list tools accept
page/limit and return {items, total_count} (total_count is read from
the x-total-count response header).
User & notifications
Tool | Description | Read-only |
| Get info about a user | yes |
| Search for users | yes |
| List repositories owned by the authenticated user | yes |
| List user notifications | yes |
| Mark all notifications read | no |
Repositories
Tool | Description | Read-only |
| Get a repository | yes |
| List an owner's repositories | yes |
| Search repositories | yes |
| Create a repository | no |
| Fork a repository | no |
| Delete a repository | no |
| List branches | yes |
| Create a branch | no |
| Delete a branch | no |
| List issue labels | yes |
| Create a label | no |
| List milestones | yes |
| Create a milestone | no |
| List a repo's topics | yes |
Files & commits
Tool | Description | Read-only |
| Read a file (UTF-8 text or | yes |
| List commits | yes |
| Get a single commit | yes |
| Create a file | no |
| Update a file | no |
| Delete a file | no |
Issues
Tool | Description | Read-only |
| List issues | yes |
| Get an issue | yes |
| Create an issue ( | no |
| Update an issue | no |
| List issue/PR comments | yes |
| Add a comment | no |
| Edit a comment | no |
| Delete a comment | no |
Pull requests & reviews
Tool | Description | Read-only |
| List pull requests | yes |
| Get a pull request | yes |
| Create a pull request | no |
| Update a pull request | no |
| Merge a pull request | no |
| List PR reviews | yes |
| Get a PR review | yes |
| List comments on a PR review | yes |
| Submit a PR review | no |
CI/CD Actions
Tool | Description | Read-only |
| List workflow runs | yes |
| Get a workflow run | yes |
| Trigger | no |
Organizations
Tool | Description | Read-only |
| List a user's organizations | yes |
| List an org's repositories | yes |
| List an org's members | yes |
| Search teams in an org | yes |
Tool errors are raised as short RuntimeError messages and surfaced by MCP as
error results.
Example configuration
{
"mcpServers": {
"forgejo": {
"command": "uvx",
"args": ["--from", "git+https://github.com/YOURNAME/forgejo-mcp", "forgejo-mcp"],
"env": {
"FORGEJO_URL": "https://codeberg.org",
"FORGEJO_ACCESS_TOKEN": "<your personal access token>"
}
}
}
}With Docker, pass secrets through from your environment so they never appear in the config file:
{
"mcpServers": {
"forgejo": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-e", "FORGEJO_URL",
"-e", "FORGEJO_ACCESS_TOKEN",
"ghcr.io/YOURNAME/forgejo-mcp:latest"]
}
}
}-e VAR without a value passes the variable through from your shell.
Development
uv sync --group dev # install deps into .venv
uv run pytest -q # unit tests (httpx mocked, no network)
docker build -t forgejo-mcp:dev .Entrypoint: python -m forgejo_mcp (stdio transport only).
Releasing
Every push to main runs tests, then publishes
ghcr.io/<owner>/<repo>:<version> + :latest, where <version> is read from
version in pyproject.toml. To release, bump the version and merge to main.
Git tags are not used.
License
Available Tools
50 toolscreate_branchB
Create a branch named new_branch from old_ref.
Inputs: repo (required), owner (required), old_ref (required), new_branch (required). Returns: object
create_fileC
Create a file. Set base64=true when content is base64-encoded.
Inputs: repo (required), owner (required), content (required), message (required), +3 more. Returns: object
create_issueB
Create a new issue. labels is a list of numeric label IDs.
Inputs: repo (required), owner (required), title (required), body, +2 more. Returns: object
create_issue_commentB
Add a comment to an issue or pull request.
Inputs: body (required), repo (required), index (required), owner (required). Returns: object
create_labelB
Create a label. color is a hex string like #ff0000.
Inputs: name (required), repo (required), color (required), owner (required). Returns: object
create_milestoneD
Create a milestone.
Inputs: repo (required), owner (required), title (required), description. Returns: object
create_pull_requestA
Create a pull request. head is the source branch, base the target.
Inputs: base (required), head (required), repo (required), owner (required), +2 more. Returns: object
create_pull_reviewC
Submit a pull request review. event in APPROVED/REQUEST_CHANGES/COMMENT.
Inputs: repo (required), event (required), index (required), owner (required), +2 more. Returns: object
create_repoC
Create a repository owned by the authenticated user.
Inputs: name (required), private, auto_init, description. Returns: object
delete_branchC
Delete a branch.
Inputs: repo (required), owner (required), branch (required). Returns: object
delete_fileC
Delete a file.
Inputs: repo (required), owner (required), message (required), filepath (required), +2 more. Returns: object
delete_issue_commentB
Delete a comment on an issue or pull request.
Inputs: repo (required), index (required), owner (required), comment_id (required). Returns: object
delete_repoC
Delete a repository.
Inputs: repo (required), owner (required). Returns: object
dispatch_workflowC
Trigger a workflow run via the workflow_dispatch event.
Inputs: ref (required), repo (required), owner (required), workflow_id (required), +1 more. Returns: object
edit_issue_commentB
Edit a comment on an issue or pull request.
Inputs: body (required), repo (required), index (required), owner (required), +1 more. Returns: object
fork_repoA
Fork a repository into the authenticated user's account.
Inputs: repo (required), owner (required). Returns: object
get_commitBRead-only
Get a single commit by SHA.
Inputs: sha (required), repo (required), owner (required). Returns: object
get_file_contentARead-only
Read a file. UTF-8 content returns as text; anything else as base64.
Inputs: repo (required), owner (required), filepath (required), ref. Returns: object
get_issueARead-only
Get an issue by its numeric index.
Inputs: repo (required), index (required), owner (required). Returns: object
get_my_userARead-only
Get information about the authenticated user.
Inputs: no named parameters. Returns: object
get_notificationsBRead-only
List notifications for the authenticated user.
Inputs: page, limit. Returns: object
get_pull_requestARead-only
Get a pull request by its numeric index.
Inputs: repo (required), index (required), owner (required). Returns: object
get_pull_reviewARead-only
Get a specific review on a pull request.
Inputs: repo (required), index (required), owner (required), review_id (required). Returns: object
get_repoBRead-only
Get a repository by owner and name.
Inputs: repo (required), owner (required). Returns: object
get_userBRead-only
Get information about a user by username.
Inputs: username (required). Returns: object
get_workflow_runARead-only
Get a single Actions workflow run by ID.
Inputs: repo (required), owner (required), run_id (required). Returns: object
list_branchesCRead-only
List branches in a repository.
Inputs: repo (required), owner (required), page, limit. Returns: object
list_issue_commentsARead-only
List comments on an issue or pull request.
Inputs: repo (required), index (required), owner (required), page, +1 more. Returns: object
list_issuesBRead-only
List issues. state in open/closed/all; labels comma-separated names.
Inputs: repo (required), owner (required), page, limit, +2 more. Returns: object
list_labelsBRead-only
List issue labels in a repository.
Inputs: repo (required), owner (required), page, limit. Returns: object
list_milestonesBRead-only
List milestones in a repository (state: open/closed/all).
Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object
list_my_reposARead-only
List repositories owned by the authenticated user.
Inputs: page, limit. Returns: object
list_org_membersCRead-only
List an organization's members.
Inputs: org (required), page, limit. Returns: object
list_org_reposCRead-only
List an organization's repositories.
Inputs: org (required), page, limit. Returns: object
list_pull_requestsCRead-only
List pull requests. state in open/closed/all.
Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object
list_pull_review_commentsARead-only
List comments on a specific pull request review.
Inputs: repo (required), index (required), owner (required), review_id (required). Returns: object
list_pull_reviewsARead-only
List reviews on a pull request.
Inputs: repo (required), index (required), owner (required). Returns: object
list_repo_commitsCRead-only
List commits in a repository (branch optional).
Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object
list_reposBRead-only
List repositories owned by owner.
Inputs: owner (required), page, limit. Returns: object
list_repo_topicsARead-only
List the topics of a repository.
Inputs: repo (required), owner (required). Returns: object
list_user_orgsBRead-only
List a user's organizations.
Inputs: username (required). Returns: object
list_workflow_runsBRead-only
List Actions workflow runs. Optionally filter by status/event.
Inputs: repo (required), owner (required), page, event, +2 more. Returns: object
mark_notifications_readA
Mark all notification threads as read.
Inputs: no named parameters. Returns: object
merge_pull_requestC
Merge a pull request. method in merge/rebase/rebase-merge/squash/fast-forward-only/manually-merged.
Inputs: repo (required), index (required), owner (required), method. Returns: object
search_org_teamsARead-only
Search teams in an organization by name (q optional).
Inputs: org (required), q, page, limit. Returns: object
search_reposCRead-only
Search for repositories matching q.
Inputs: q (required), page, limit. Returns: object
search_usersCRead-only
Search for users matching q. Returns {items, total_count}.
Inputs: q (required), limit. Returns: object
update_fileC
Update an existing file. sha is the current file blob SHA.
Inputs: repo (required), owner (required), content (required), message (required), +4 more. Returns: object
update_issueB
Update an issue's title, body, and/or state.
Inputs: repo (required), index (required), owner (required), body, +2 more. Returns: object
update_pull_requestB
Update a pull request's title, body, and/or state.
Inputs: repo (required), index (required), owner (required), body, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
Most tools pair a unique resource with a unique action, so issue/PR/review/file/workflow tools are easy to tell apart. The only mild ambiguity is among list_repos, list_org_repos, and list_my_repos, which overlap somewhat depending on the owner scope.
Tool names follow a consistent verb_noun snake_case convention throughout, using predictable verbs like list, get, create, update, delete, merge, and dispatch. Even grouped features like get_my_user/list_my_repos and mark_notifications_read follow the same pattern.
50 tools is well above the 25-tool threshold and makes the server heavy for an agent to reason over, even though Forgejo is a broad platform. Several niche read/list operations could be consolidated or exposed as optional subresources.
Core repository, file, issue, pull request, and review workflows are well covered. However, labels and milestones only support list/create with no update/delete, workflow support lacks listing/canceling/rerunning, and pull-review comments cannot be edited or deleted.
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform GitHub operations such as creating repositories, issues, pull requests, and more through natural language.-
- AlicenseAqualityDmaintenanceEnables AI assistants to manage Gitea repositories, issues, and pull requests via the tea CLI, including full PR review workflows.1516 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with a Forgejo instance as an authenticated user, supporting issues, pull requests, repositories, and notifications.88 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with GitHub directly by fetching repository information, creating issues, and triggering repository_dispatch events through natural language.MIT