Skip to main content
Glama

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

FORGEJO_URL

yes

—

Forgejo instance base URL, e.g. https://codeberg.org

FORGEJO_ACCESS_TOKEN

yes

—

Personal access token

FORGEJO_USER_AGENT

no

forgejo-mcp/<version>

HTTP User-Agent header

FORGEJO_TIMEOUT

no

30

HTTP request timeout, seconds

FORGEJO_TLS_INSECURE

no

false

true disables TLS certificate verification (self-signed)

FORGEJO_READ_ONLY

no

false

true disables all write tools (create/update/delete)

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_user(username)

Get info about a user

yes

search_users(q, limit=10)

Search for users

yes

list_my_repos(page, limit)

List repositories owned by the authenticated user

yes

get_notifications(page, limit)

List user notifications

yes

mark_notifications_read()

Mark all notifications read

no

Repositories

Tool

Description

Read-only

get_repo(owner, repo)

Get a repository

yes

list_repos(owner, page, limit)

List an owner's repositories

yes

search_repos(q, page, limit)

Search repositories

yes

create_repo(name, private, description)

Create a repository

no

fork_repo(owner, repo)

Fork a repository

no

delete_repo(owner, repo)

Delete a repository

no

list_branches(owner, repo, page, limit)

List branches

yes

create_branch(owner, repo, new_branch, old_ref)

Create a branch

no

delete_branch(owner, repo, branch)

Delete a branch

no

list_labels(owner, repo, page, limit)

List issue labels

yes

create_label(owner, repo, name, color)

Create a label

no

list_milestones(owner, repo, state, page, limit)

List milestones

yes

create_milestone(owner, repo, title, description)

Create a milestone

no

list_repo_topics(owner, repo)

List a repo's topics

yes

Files & commits

Tool

Description

Read-only

get_file_content(owner, repo, filepath, ref)

Read a file (UTF-8 text or {encoding:base64,...})

yes

list_repo_commits(owner, repo, branch, page, limit)

List commits

yes

get_commit(owner, repo, sha)

Get a single commit

yes

create_file(owner, repo, filepath, content, message, branch, base64)

Create a file

no

update_file(owner, repo, filepath, content, message, branch, sha, base64)

Update a file

no

delete_file(owner, repo, filepath, message, branch, sha)

Delete a file

no

Issues

Tool

Description

Read-only

list_issues(owner, repo, state, labels, page, limit)

List issues

yes

get_issue(owner, repo, index)

Get an issue

yes

create_issue(owner, repo, title, body, labels)

Create an issue (labels = numeric label IDs)

no

update_issue(owner, repo, index, title, body, state)

Update an issue

no

list_issue_comments(owner, repo, index, page, limit)

List issue/PR comments

yes

create_issue_comment(owner, repo, index, body)

Add a comment

no

edit_issue_comment(owner, repo, index, comment_id, body)

Edit a comment

no

delete_issue_comment(owner, repo, index, comment_id)

Delete a comment

no

Pull requests & reviews

Tool

Description

Read-only

list_pull_requests(owner, repo, state, page, limit)

List pull requests

yes

get_pull_request(owner, repo, index)

Get a pull request

yes

create_pull_request(owner, repo, title, head, base, body)

Create a pull request

no

update_pull_request(owner, repo, index, title, body, state)

Update a pull request

no

merge_pull_request(owner, repo, index, method)

Merge a pull request

no

list_pull_reviews(owner, repo, index)

List PR reviews

yes

get_pull_review(owner, repo, index, review_id)

Get a PR review

yes

list_pull_review_comments(owner, repo, index, review_id)

List comments on a PR review

yes

create_pull_review(owner, repo, index, event, body)

Submit a PR review

no

CI/CD Actions

Tool

Description

Read-only

list_workflow_runs(owner, repo, status, event, page, limit)

List workflow runs

yes

get_workflow_run(owner, repo, run_id)

Get a workflow run

yes

dispatch_workflow(owner, repo, workflow_id, ref)

Trigger workflow_dispatch

no

Organizations

Tool

Description

Read-only

list_user_orgs(username)

List a user's organizations

yes

list_org_repos(org, page, limit)

List an org's repositories

yes

list_org_members(org, page, limit)

List an org's members

yes

search_org_teams(org, q, page, limit)

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

MIT

Available Tools

50 tools
create_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_commitB
Read-only

Get a single commit by SHA.

Inputs: sha (required), repo (required), owner (required). Returns: object

get_file_contentA
Read-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_issueA
Read-only

Get an issue by its numeric index.

Inputs: repo (required), index (required), owner (required). Returns: object

get_my_userA
Read-only

Get information about the authenticated user.

Inputs: no named parameters. Returns: object

get_notificationsB
Read-only

List notifications for the authenticated user.

Inputs: page, limit. Returns: object

get_pull_requestA
Read-only

Get a pull request by its numeric index.

Inputs: repo (required), index (required), owner (required). Returns: object

get_pull_reviewA
Read-only

Get a specific review on a pull request.

Inputs: repo (required), index (required), owner (required), review_id (required). Returns: object

get_repoB
Read-only

Get a repository by owner and name.

Inputs: repo (required), owner (required). Returns: object

get_userB
Read-only

Get information about a user by username.

Inputs: username (required). Returns: object

get_workflow_runA
Read-only

Get a single Actions workflow run by ID.

Inputs: repo (required), owner (required), run_id (required). Returns: object

list_branchesC
Read-only

List branches in a repository.

Inputs: repo (required), owner (required), page, limit. Returns: object

list_issue_commentsA
Read-only

List comments on an issue or pull request.

Inputs: repo (required), index (required), owner (required), page, +1 more. Returns: object

list_issuesB
Read-only

List issues. state in open/closed/all; labels comma-separated names.

Inputs: repo (required), owner (required), page, limit, +2 more. Returns: object

list_labelsB
Read-only

List issue labels in a repository.

Inputs: repo (required), owner (required), page, limit. Returns: object

list_milestonesB
Read-only

List milestones in a repository (state: open/closed/all).

Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object

list_my_reposA
Read-only

List repositories owned by the authenticated user.

Inputs: page, limit. Returns: object

list_org_membersC
Read-only

List an organization's members.

Inputs: org (required), page, limit. Returns: object

list_org_reposC
Read-only

List an organization's repositories.

Inputs: org (required), page, limit. Returns: object

list_pull_requestsC
Read-only

List pull requests. state in open/closed/all.

Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object

list_pull_review_commentsA
Read-only

List comments on a specific pull request review.

Inputs: repo (required), index (required), owner (required), review_id (required). Returns: object

list_pull_reviewsA
Read-only

List reviews on a pull request.

Inputs: repo (required), index (required), owner (required). Returns: object

list_repo_commitsC
Read-only

List commits in a repository (branch optional).

Inputs: repo (required), owner (required), page, limit, +1 more. Returns: object

list_reposB
Read-only

List repositories owned by owner.

Inputs: owner (required), page, limit. Returns: object

list_repo_topicsA
Read-only

List the topics of a repository.

Inputs: repo (required), owner (required). Returns: object

list_user_orgsB
Read-only

List a user's organizations.

Inputs: username (required). Returns: object

list_workflow_runsB
Read-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_teamsA
Read-only

Search teams in an organization by name (q optional).

Inputs: org (required), q, page, limit. Returns: object

search_reposC
Read-only

Search for repositories matching q.

Inputs: q (required), page, limit. Returns: object

search_usersC
Read-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

    C2.8/5.0

    Scored across 50 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count2/5

    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.

    Completeness3/5

    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

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to interact with a Forgejo instance as an authenticated user, supporting issues, pull requests, repositories, and notifications.
      88 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to interact with GitHub directly by fetching repository information, creating issues, and triggering repository_dispatch events through natural language.
      MIT