feat: add --tools flag to filter exposed MCP tools (#167)

Adds `-O`/`-tools` CLI flag and `GITEA_TOOLS` environment variable
accepting a comma-separated list of tool names. When set, only the
listed tools are exposed to MCP clients, which lets AI agents trim
their tool context. Composes with `--read-only`. Unknown names are
logged at startup so typos surface instead of failing silently.

Co-Authored-By: silverwind <me@silverwind.io>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
Martin Mikula
2026-05-10 12:07:16 +02:00
committed by silverwind
parent cd82f6f207
commit bcefbaa9c1
5 changed files with 181 additions and 50 deletions
+4 -3
View File
@@ -7,7 +7,8 @@ var (
Version string
Mode string
Insecure bool
ReadOnly bool
Debug bool
Insecure bool
ReadOnly bool
Debug bool
AllowedTools map[string]struct{}
)