Phil's fork of goern/forgejo-mcp — adds workflow-run-log + job-log tools
  • Go 93.1%
  • Python 3.8%
  • Shell 2.5%
  • Makefile 0.5%
  • Dockerfile 0.1%
Find a file
2026-05-21 13:33:28 +00:00
.beads chore: 🔧 bd: file C5 spike + C4 cleanup issues, link to forgejo-mcp-673 2026-05-13 08:35:00 +02:00
.claude chore: 🔧 slim opsx to core 4 commands (apply/archive/explore/propose) 2026-05-12 08:29:44 +02:00
.devcontainer add devcontainer 2025-03-18 07:03:59 +00:00
.forgejo/workflows ci: 🚀 migrate CI from Forgejo Actions to op1st Tekton 2026-05-12 08:39:45 +02:00
.husky/_ chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026-01-30 08:25:11 +01:00
.social-media feat: add a project logo 2025-04-24 08:18:33 +02:00
.tekton ci: 🚀 drop redundant PaC annotations on openspec-validate 2026-05-12 13:14:19 +02:00
cmd Merge pull request 'refactor(tools): drop 29 unused tool registrations (102→73)' (#2) from slim/tool-surface-2026-05-21 into main 2026-05-21 13:33:28 +00:00
demos feat: add 14 MCP tools for Forgejo releases and release attachments 2026-05-12 16:45:53 +02:00
docs docs(actions): document why download_workflow_artifact is not shipped 2026-05-21 11:21:37 +02:00
extension docs(extension): address review feedback on #118 2026-05-07 20:02:24 -07:00
openspec docs: 📝 battle-test forgejo-action-code-review, resolve C4 spike 2026-05-13 08:34:17 +02:00
operation Merge pull request 'refactor(tools): drop 29 unused tool registrations (102→73)' (#2) from slim/tool-surface-2026-05-21 into main 2026-05-21 13:33:28 +00:00
pkg feat(attachment): auto-spill large downloads to disk 2026-05-18 21:11:33 +02:00
test feat: add issue & comment attachment tools (#109) 2026-05-02 12:06:54 +02:00
.containerignore feat: add smithery.ai integration 2025-04-24 08:19:37 +02:00
.env.sample feat: add stdio and sse MCP server 2025-04-24 08:12:16 +02:00
.gitattributes chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026-01-30 08:25:11 +01:00
.gitignore ci: 🚀 drop redundant PaC annotations on openspec-validate 2026-05-12 13:14:19 +02:00
.gitleaks.toml ci: 🚀 add gitleaks scanning (Tekton + pre-commit) 2026-05-12 13:08:14 +02:00
.goreleaser.yml feat: add macOS (darwin) release assets 2026-02-10 21:18:54 +01:00
.mcp.json docs: 📝 add issue-attachment spec and beads issue tracking 2026-04-21 22:31:46 +02:00
.pre-commit-config.yaml ci: 🚀 add gitleaks scanning (Tekton + pre-commit) 2026-05-12 13:08:14 +02:00
.releaserc fix: 🐛 release workflow checkout URL and skip-ci suppression 2026-02-06 09:46:58 +01:00
.renovaterc build: update renovate and semantic-release config 2025-04-24 08:50:58 +02:00
AGENTS.md docs: 📝 codify output-bounding rule for MCP tools 2026-05-10 16:11:52 +02:00
CHANGELOG.md chore(release): 2.22.0 2026-05-12 08:47:39 +00:00
CLAUDE.md bd init: initialize beads issue tracking 2026-04-21 22:31:46 +02:00
codemcp.toml first commit 2025-04-02 00:27:24 -04:00
Containerfile chore(deps): update golang:1.26-alpine docker digest to 91eda97 2026-05-07 20:11:19 +00:00
DEVELOPER.md feat: add 14 MCP tools for Forgejo releases and release attachments 2026-05-12 16:45:53 +02:00
go.mod deps: ⬆️ migrate forgejo-sdk from v2 to v3 2026-03-27 23:53:31 +01:00
go.sum deps: ⬆️ migrate forgejo-sdk from v2 to v3 2026-03-27 23:53:31 +01:00
LICENSE feat: add stdio and sse MCP server 2025-04-24 08:12:16 +02:00
main.go fix: 🐛 show module version when installed via go install 2026-01-30 09:42:33 +01:00
Makefile chore: 🔧 add mcpb and help make targets 2026-05-07 22:57:12 +02:00
README.md feat: add 14 MCP tools for Forgejo releases and release attachments 2026-05-12 16:45:53 +02:00

Forgejo MCP Server

Connect your AI assistant to Forgejo repositories. Manage issues, pull requests, files, and more through natural language.

What It Does

Forgejo MCP Server is an integration plugin that connects Forgejo with Model Context Protocol (MCP) systems. Once configured, you can interact with your Forgejo repositories through any MCP-compatible AI assistant like Claude, Cursor, or VS Code extensions.

Example commands you can use:

  • "List all my repositories"
  • "Create an issue titled 'Bug in login page'"
  • "Show me open pull requests in my-org/my-repo"
  • "Get the contents of README.md from the main branch"
  • "Show me the latest Actions workflow runs in goern/forgejo-mcp"

Quick Start

1. Install

Option A: Using Go (Recommended)

git clone https://codeberg.org/goern/forgejo-mcp.git
cd forgejo-mcp
go install .

Ensure $GOPATH/bin (typically ~/go/bin) is in your PATH.

Note: go install codeberg.org/goern/forgejo-mcp/v2@latest does not work currently. See Known Issues.

Option B: Download Binary

Download the latest release from the releases page.

For Arch Linux, use your favorite AUR helper:

yay -S forgejo-mcp      # builds from source
yay -S forgejo-mcp-bin  # uses pre-built binary

2. Get Your Access Token

  1. Log into your Forgejo instance
  2. Go to SettingsApplicationsAccess Tokens
  3. Create a new token with the permissions you need (repo, issue, etc.)

3. Configure Your AI Assistant

Add this to your MCP configuration file:

For stdio mode (most common):

{
  "mcpServers": {
    "forgejo": {
      "command": "forgejo-mcp",
      "args": [
        "--transport", "stdio",
        "--url", "https://your-forgejo-instance.org"
      ],
      "env": {
        "FORGEJO_ACCESS_TOKEN": "<your personal access token>",
        "FORGEJO_USER_AGENT": "forgejo-mcp/1.0.0"
      }
    }
  }
}

For streamable HTTP mode (recommended for remote/Claude.ai):

{
  "mcpServers": {
    "forgejo": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

When using streamable HTTP mode, start the server first:

forgejo-mcp --transport http --url https://your-forgejo-instance.org --token <your-token>

For SSE mode (legacy HTTP-based):

{
  "mcpServers": {
    "forgejo": {
      "url": "http://localhost:8080/sse"
    }
  }
}

When using SSE mode, start the server first:

forgejo-mcp --transport sse --url https://your-forgejo-instance.org --token <your-token>

4. Start Using It

Open your MCP-compatible AI assistant and try:

List all my repositories

Available Tools

Tool Description
User
get_my_user_info Get information about the authenticated user
check_notifications Check and list user notifications
get_notification_thread Get detailed info on a single notification thread
mark_notification_read Mark a single notification thread as read
mark_all_notifications_read Acknowledge all notifications
list_repo_notifications Filter notifications scoped to a single repository
mark_repo_notifications_read Mark all notifications in a specific repo as read
search_users Search for users
Repositories
list_my_repos List all repositories you own
create_repo Create a new repository
fork_repo Fork a repository
search_repos Search for repositories
Branches
list_branches List all branches in a repository
create_branch Create a new branch
delete_branch Delete a branch
Files
get_file_content Get the content of a file. Optional start_line/end_line request a 1-indexed inclusive line range (clamps to file extent; ignored when with_metadata=true).
create_file Create a new file
update_file Update an existing file
delete_file Delete a file
Commits
list_repo_commits List commits in a repository
Issues
list_repo_issues List issues in a repository
get_issue_by_index Get a specific issue
create_issue Create a new issue
add_issue_labels Add labels to an issue (requires numeric label IDs)
remove_issue_labels Remove labels from an issue (requires numeric label IDs)
update_issue Update an existing issue (requires numeric milestone ID)
issue_state_change Open or close an issue
list_repo_milestones List milestones with their IDs (use with update_issue)
list_repo_labels List labels with their IDs. Merges org-level labels for org-owned repos (set include_org_labels=false to opt out). Each entry carries a scope field ("repo" or "org").
list_org_labels List organization-level labels with their IDs (use with add_issue_labels, remove_issue_labels).
Comments
list_issue_comments List comments on an issue or PR
get_issue_comment Get a specific comment
create_issue_comment Add a comment to an issue or PR
edit_issue_comment Edit a comment
delete_issue_comment Delete a comment
Pull Requests
list_repo_pull_requests List pull requests in a repository
get_pull_request_by_index Get a specific pull request
create_pull_request Create a new pull request
update_pull_request Update an existing pull request
list_pull_reviews List reviews for a pull request
get_pull_review Get a specific pull request review
list_pull_review_comments List comments on a pull request review
list_pull_request_files List changed files in a pull request (paginated). Use the returned filenames as the file_path argument to get_pull_request_diff.
get_pull_request_diff Get the unified diff of a pull request. Optional file_path returns only that file's hunks (matches on either pre- or post-rename path).
merge_pull_request Merge a pull request (style: merge/rebase/rebase-merge/squash; optional title/message/delete-branch/force-merge/wait-for-checks).
create_pull_review Create a review on a pull request (state: APPROVED/REQUEST_CHANGES/COMMENT) with optional inline comments.
Actions
dispatch_workflow Trigger a workflow run via workflow_dispatch event
list_workflow_runs List workflow runs with optional filtering by status, event, or SHA
get_workflow_run Get details of a specific workflow run by ID
Organizations
search_org_teams Search for teams in an organization
Time Tracking
list_issue_tracked_times List tracked time entries on an issue or PR
list_repo_tracked_times List tracked time entries across a repository
list_my_tracked_times List your own tracked time entries
add_issue_time Log time against an issue or PR (accepts seconds or duration like 15m)
reset_issue_time Delete ALL tracked time entries on an issue or PR (destructive)
delete_issue_time_entry Delete a single tracked time entry by ID
start_issue_stopwatch Start a stopwatch on an issue or PR
stop_issue_stopwatch Stop a running stopwatch and record the elapsed time
cancel_issue_stopwatch Cancel a running stopwatch without recording
list_my_stopwatches List currently running stopwatches
Attachments
list_issue_attachments List attachments on an issue or PR
get_issue_attachment Get metadata for a single issue/PR attachment
download_issue_attachment Download an issue/PR attachment (inline if < 1 MiB; metadata + URL otherwise)
create_issue_attachment Upload a new attachment to an issue or PR (base64 content)
edit_issue_attachment Rename an issue/PR attachment
delete_issue_attachment Delete an issue/PR attachment
list_comment_attachments List attachments on an issue/PR comment
get_comment_attachment Get metadata for a single comment attachment
download_comment_attachment Download a comment attachment (inline if < 1 MiB; metadata + URL otherwise)
create_comment_attachment Upload a new attachment to an issue/PR comment (base64 content)
edit_comment_attachment Rename a comment attachment
delete_comment_attachment Delete a comment attachment
Releases
list_releases List releases for a repository (page/limit + client-side state filter: all/draft/prerelease/published)
get_release_by_id Get a release by numeric ID
get_release_by_tag Get a release by tag name
get_latest_release Get the latest non-draft, non-prerelease release
create_release Create a new release (pass target_commitish to also create the tag)
edit_release Update fields of an existing release (only supplied fields are sent)
delete_release Delete a release by numeric ID — destructive
delete_release_by_tag Delete a release by tag name — destructive, verify tag
list_release_attachments List attachments on a release (response fetched in full, sliced client-side)
get_release_attachment Get metadata for a single release attachment
download_release_attachment Download a release attachment (inline if < 1 MiB; metadata + URL otherwise)
create_release_attachment Upload a new attachment to a release (base64 content)
edit_release_attachment Rename a release attachment
delete_release_attachment Delete a release attachment — destructive
Server
get_forgejo_mcp_server_version Get the MCP server version

Demos

End-to-end, copy-pasteable walkthroughs of the tools above — grouped by topic (labels, attachments, time tracking, notifications, orgs, bounded I/O code review, transport) — live in demos/. Each demo pairs real ./forgejo-mcp --cli invocations with the output they produced against codeberg.org.

CLI Mode

You can invoke any tool directly from the command line without running an MCP server. This is useful for shell scripts, CI/CD pipelines, and Claude Code skills.

# List all available tools (grouped by domain)
forgejo-mcp --cli list

# Invoke a tool with JSON arguments
forgejo-mcp --cli get_issue_by_index --args '{"owner":"goern","repo":"forgejo-mcp","index":1}'

# Pipe JSON arguments via stdin
echo '{"owner":"goern","repo":"forgejo-mcp"}' | forgejo-mcp --cli list_repo_issues

# List recent workflow runs (text output)
forgejo-mcp --cli list_workflow_runs \
  --args '{"owner":"goern","repo":"forgejo-mcp"}' \
  --output=text

# List only failed runs
forgejo-mcp --cli list_workflow_runs \
  --args '{"owner":"goern","repo":"forgejo-mcp","status":"failure"}' \
  --output=text

# Show a tool's parameters
forgejo-mcp --cli create_issue --help

# Control output format (json or text)
forgejo-mcp --cli list --output=json
forgejo-mcp --cli get_my_user_info --args '{}' --output=text

CLI mode requires the same FORGEJO_URL and FORGEJO_ACCESS_TOKEN configuration as MCP server mode. Tool results are written as JSON to stdout by default; errors go to stderr with a non-zero exit code.

Configuration Options

You can configure the server using command-line arguments or environment variables:

CLI Argument Environment Variable Description
--url FORGEJO_URL Your Forgejo instance URL
--token FORGEJO_ACCESS_TOKEN Your personal access token
--debug FORGEJO_DEBUG Enable debug mode
--transport - Transport mode: stdio, sse, or http
--sse-port - Port for SSE mode (default: 8080)
--http-port - Port for streamable HTTP mode (default: 8080)
--cli - Enter CLI mode for direct tool invocation
--user-agent FORGEJO_USER_AGENT HTTP User-Agent header (default: forgejo-mcp/<version>)

Command-line arguments take priority over environment variables.

Troubleshooting

Enable debug mode to see detailed logs:

forgejo-mcp --transport sse --url <url> --token <token> --debug

Or set the environment variable:

export FORGEJO_DEBUG=true

Custom User-Agent: If your Forgejo instance or proxy blocks the default go-http-client user agent, set a custom one:

# Via environment variable
export FORGEJO_USER_AGENT="forgejo-mcp/1.0.0"

# Or via CLI flag
forgejo-mcp --user-agent "forgejo-mcp/1.0.0" --transport sse --url <url> --token <token>

Getting Help

This repository is also mirrored on Radicle — a peer-to-peer code collaboration network. Clone via:

rad clone rad:z4PdPpsH9iJQcWfqTbxpFcWaZ9zPL

For Developers

See DEVELOPER.md for build instructions, architecture overview, and contribution guidelines.

Known Issues

  • go install ...@latest fails — The go.mod contains a replace directive (for a forked Forgejo SDK), which prevents remote go install. Use the clone-and-build workflow shown in Quick Start instead. Tracked in #67.

Contributors

forgejo-mcp is shaped by everyone who files issues, writes code, reviews PRs, and pushes the project forward. Thank you all. 🙏

Code contributors

Contributor Highlights
goern (Christoph Görn) Project creator and maintainer
Ronmi Ren Co-creator; SSE/HTTP transport, issue blocking, CI/CD improvements, logo, Glama spec
twstagg (Tristin Stagg) User agent configuration support (PR #89)
mattdm (Matthew Miller) Logging improvements, FORGEJO_* migration, README, URL refactor
byteflavour check_notifications + full notification management API (PR #84, #86); feature requests #80, #85
jesterret Pull request reviews and comments support (PR #51)
appleboy Custom SSE port support, bug fixes
ignasgil remove_issue_labels tool (PR #96)
dmikushin (Dmitry Mikushin) Fix string-encoded number parameter parsing from MCP clients (PR #93)
jiriks74 mcp-go v0.44.0 dependency update (PR #90)
th (Tomi Haapaniemi) update_pull_request tool
hiifong Early bug fixes and updates
Lunny Xiao Early contributions
techknowlogick Early contributions
yp05327 Early contributions
mw75 Owner/org support for repo creation (PR #18)
Dax Kelson Issue comment management (PR #34)
Guruprasad Kulkarni Arch Linux AUR installation docs (PR #69)
Mario Wolff Contributions
Massimo Fraschetti Contributions
synath (David Paul Turley) Repository-scoped token support via ServerVersion probe (PR #112); merge status-code check (PR #113); Claude Desktop Extension (.mcpb) packaging (PR #118)
BrilliantKahn get_file_content plain-text default (PR #116); list_repo_contents and get_repo_tree tools (PR #117). First-ever open source contribution — welcome aboard! 🎉

Community contributors

Issue reporters and discussion participants who shaped the direction of the project:

Contributor Contributions
byteflavour Filed #80 (milestone/label discovery), #85 (notification API proposal); active reviewer in discussions
choucavalier Filed #82 (fix skill), #70 (macOS arm64 releases), #62 (binary releases & mise support)
MalcolmMielle Filed #59 (PR review tools — since implemented)
redbeard Filed #60 (Actions support — since implemented)
c6sepl6p Filed #72 (base64 encoding), #54 (merge pull request — since implemented)
malik Filed #73 (version flag), #47 (Nix build fix)
a2800276 Filed #74 (OpenAI compatibility)
simenandre Filed #49 (go install support)
BasdP Filed #42 (Projects support)
BoBeR182 Filed #32 (wiki support)
ignasgil Filed #95 (remove_issue_labels feature request)
Vokuar Filed #99 (streamable HTTP transport support)
janbaer Filed #98 (reply to review comment)
fraschm98 Early issue reports
heathen711 Filed #106 (issue/comment attachments — since implemented); shaped the 1 MiB inline cap + browser_download_url fall-through design

Cyborg contributors

This project also received contributions from AI coding agents — submitted as regular PRs, reviewed by humans:

Agent Role Contributions
brenner-axiom (b4-dev, B4arena) AI dev agent Organization management tools (PR #94); showboat demos (PR #97); list_repo_milestones, list_repo_labels tools (PR #83); race condition fix (PR #78); contributors docs (PR #87, #88); filed #76; code reviews
opencode AI dev agent Pull request reviews and comments support (PR #51)
claude-code AI dev agent get_file_content plain-text default and list_repo_contents/get_repo_tree tools, paired with BrilliantKahn (PR #116, #117)
b4mad-release-bot Release automation Automated changelog and release tagging
the #B4mad Renovate bot Dependency updates Automated dependency upgrades

Want to contribute? Open an issue or pull request — all are welcome.

License

This project is open source. See the repository for license details.