feat(tools): file_read with default-branch resolution
Adds GetFileContents to the gitea client and a file_read MCP tool. When ref is omitted, the tool resolves the repo default_branch via GetRepo before fetching contents. Decoded content capped at 1 MiB. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ func main() {
|
||||
reg := registry.New()
|
||||
reg.Register(tools.NewRepoList(giteaClient, ownerAllow))
|
||||
reg.Register(tools.NewRepoGet(giteaClient, ownerAllow))
|
||||
reg.Register(tools.NewFileRead(giteaClient, ownerAllow))
|
||||
|
||||
mcpSrv := mcp.NewServer(mcp.ServerOptions{
|
||||
Registry: reg,
|
||||
|
||||
Reference in New Issue
Block a user