mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-08-29 11:37:44 +00:00
feat(gitea): support extra outbound HTTP headers via GITEA_EXTRA_HEADERS
Add a GITEA_EXTRA_HEADERS environment variable that accepts a JSON object of header name/value pairs (e.g. Cloudflare Access credentials) and applies them to every outbound request to Gitea, both the raw pkg/gitea.DoJSON/DoBytes path and the SDK-backed pkg/gitea.NewClient path, without overriding Authorization, Content-Type, or Accept. Co-Authored-By: Codet <codet@commitgo.dev> (GPT-5-Codex)
This commit is contained in:
@@ -20,6 +20,14 @@ make install
|
||||
|
||||
Pass the Gitea host and access token as command-line flags or environment variables, flags take precedence. Run `gitea-mcp --help` for the full list of flags and environment variables. Logs are written to `$HOME/.gitea-mcp/gitea-mcp.log`, add `-d` for debug logging.
|
||||
|
||||
Set `GITEA_EXTRA_HEADERS` to a JSON object of header name/value pairs to send with every outbound request to Gitea, for example when Gitea sits behind Cloudflare Access:
|
||||
|
||||
```bash
|
||||
export GITEA_EXTRA_HEADERS='{"CF-Access-Client-Id":"id","CF-Access-Client-Secret":"secret"}'
|
||||
```
|
||||
|
||||
These headers never override `Authorization`, `Content-Type`, or `Accept` set by `gitea-mcp` itself.
|
||||
|
||||
### MCP protocol and HTTP transport
|
||||
|
||||
The server supports MCP up to `2026-07-28` and negotiates down to the client's version, advertising only the `tools` capability. Tool and Gitea failures return a `tools/call` result with `result.isError: true`, while malformed requests and server faults stay JSON-RPC errors.
|
||||
|
||||
Reference in New Issue
Block a user