forgejo-readonly-mcp
Provides read-only access to Forgejo repositories and Forgejo Actions, including repository metadata, branches, tags, commits, commit statuses, directory trees, file contents, Actions runs, jobs, and job logs.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
forgejo-readonly-mcp
A read-only MCP server for Forgejo. It lets an MCP client read the state of repositories and of Forgejo Actions: runs, jobs, statuses and logs. It cannot write anything, by design.
The read-only contract
Three independent locks, each enough on its own:
The client only speaks GET.
ReadOnlyClienthas a single network method, and it builds GET requests only. No tool can send another verb.The tool list is closed. There is no "call any endpoint" tool. Each tool assembles its own path from validated segments under
/api/v1. An owner, repo or path component with/,..or any character outside[A-Za-z0-9_.-]is refused by name.The token only carries read scopes. Even a bug in this code would be refused by Forgejo.
Two further guards:
A redirect to another origin is refused, because urllib would forward the token with it.
A plain
http://URL is refused unlessFORGEJO_ALLOW_HTTP=1is set.
Left out on purpose: runners and their registration tokens, secrets, variables, artifacts, and the run-wide log zip.
Related MCP server: GitHub MCP
Tools
Tool | Reads |
| default branch, visibility, counters |
| refs with their head commit |
| commits on a ref, optionally touching a path |
| full message, parents, stats, changed files |
| combined CI status of a commit and each check |
| the tree and files at a ref |
| Actions runs, filtered by status, event, ref, sha, workflow |
| one run and its jobs |
| a job log: tail (200 by default), head, or grep with context |
Token
In Forgejo, go to Settings, then Applications, then Generate new token. Give
it read:repository only (add read:organization if you read
organization repositories you are not a member of).
Install
python3 -m venv .venv
.venv/bin/pip install -e .Register in Claude Code
Keep the token in a file only its owner reads, and point the server at it.
Passing it with -e FORGEJO_TOKEN=... would copy it in clear into
~/.claude.json.
install -m 600 /dev/null ~/.config/forgejo-readonly-mcp/token # then paste the token in it
claude mcp add forgejo \
-e FORGEJO_URL=https://forge.example.com \
-e FORGEJO_TOKEN_FILE=$HOME/.config/forgejo-readonly-mcp/token \
-- /path/to/forgejo-readonly-mcp/.venv/bin/forgejo-readonly-mcpFORGEJO_TOKEN still works for hosts without a file; setting both is
refused.
Optional: FORGEJO_ALLOWED_REPOS=owner/repo,owner/other restricts the
server to those repositories. Any other repository is refused by name.
Tests
The tests run against a local fake server and never reach a real forge:
.venv/bin/python -m unittest discover -s testsLicense
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP server for repository context: context packs, graph impact analysis, and validation.
Read-only access to your CodeMouse accounts, repositories, and AI pull-request reviews.
Read-only MCP security data: check catalogue, public scan status and your own scan reports.
Unofficial GitHub MCP — wraps the GitHub public REST API (no auth required for public endpoints)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables read-only access to GitLab projects, files, directories, and merge requests through MCP tools.-
- AlicenseNot gradedqualityDmaintenanceEnables self-hosted, read-only remote interaction with GitHub repositories, allowing listing repositories, searching code, and inspecting commits, pull requests, issues, and diffs via authenticated MCP clients.MIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only browsing and querying of GitHub repositories, including listing repos, reading files, fetching READMEs, searching code, and viewing commit history via MCP.-
- AlicenseAqualityBmaintenanceEnables MCP clients to read a Forgejo, Codeberg, or Gitea instance—including users, repositories, issues, pull requests, search, notifications, comments, reviews, and Actions runs—with opt-in, time-boxed guarded writes for repository, branch, issue, pull request, comment, migration, push-mirror, and workflow operations.592MIT