Add repository file/content read tools #12
Labels
No labels
status/paused
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jbr870/forgejo-mcp-server#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The MCP server currently exposes write/manage operations for issues and wiki pages, plus
list_my_repos, but has no tools for reading repository file contents. This forces clients to fall back toweb_fetchor manual paste when they need to inspect repo files (skills, configs, source, READMEs, etc.).Hit this concretely while working on the AI SDLC workflow design — needed to read skill files from
devwork-skillsto ground a discussion and had no way to do it through the MCP.Proposed tools
Minimum useful set, mapping to existing Forgejo API endpoints:
get_file_contents— fetch a file atowner/repo/path, optionalref(branch/tag/commit). Returns content + metadata (size, sha, encoding).GET /repos/{owner}/{repo}/contents/{filepath}list_directory— list entries at a path. Returns name, type (file/dir/symlink), size, sha for each.get_repo_tree— recursive tree listing for a ref. Useful for "what's in this repo" without N round-trips.GET /repos/{owner}/{repo}/git/trees/{sha}?recursive=trueNice-to-have (separate tickets if preferred)
search_repo_contents— code search within a repoget_pull_request+get_pull_request_diff— PR review workflowslist_repo_branches— branch enumerationConsiderations
binary: trueflag, or refuse with a hint to use a different toolWhy now
Read tools unblock a lot of agent workflows where the MCP is the only forge interface (e.g. Claude.ai sessions without local repo access). Currently those sessions can manage issues/wiki but can't see the code those issues/wiki pages are about.