feat: add multi-server support via GITEA_SERVERS env var
Allows connecting to multiple Gitea instances from a single MCP server.
Set GITEA_SERVERS as a JSON object mapping names to {host, token, insecure}
configs. Every tool gets an optional "server" parameter, and a new
"list_servers" tool is added to discover available connections.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
package flag
|
||||
|
||||
// ServerConfig holds connection details for a named Gitea server.
|
||||
type ServerConfig struct {
|
||||
Host string `json:"host"`
|
||||
Token string `json:"token"`
|
||||
Insecure bool `json:"insecure,omitempty"`
|
||||
}
|
||||
|
||||
var (
|
||||
Host string
|
||||
Port int
|
||||
@@ -10,4 +17,8 @@ var (
|
||||
Insecure bool
|
||||
ReadOnly bool
|
||||
Debug bool
|
||||
|
||||
// Servers maps a friendly name to its connection config.
|
||||
// Populated from the GITEA_SERVERS env var (JSON object).
|
||||
Servers map[string]ServerConfig
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user