From 0e76c64c5829dc8b721ad2e4339b235f136b3b18 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Tue, 8 Jul 2025 14:20:22 +0200 Subject: [PATCH] chore:chore: add mcp disabled state --- internal/config/config.go | 11 ++++++----- internal/llm/agent/mcp-tools.go | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 2b81094ed394e669b4d293200f911a875c2deacb..a32d04f9b62cf6e734f98e35df01c6148e06573a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -86,11 +86,12 @@ const ( ) type MCPConfig struct { - Command string `json:"command,omitempty" ` - Env []string `json:"env,omitempty"` - Args []string `json:"args,omitempty"` - Type MCPType `json:"type"` - URL string `json:"url,omitempty"` + Command string `json:"command,omitempty" ` + Env []string `json:"env,omitempty"` + Args []string `json:"args,omitempty"` + Type MCPType `json:"type"` + URL string `json:"url,omitempty"` + Disabled bool `json:"disabled,omitempty"` // TODO: maybe make it possible to get the value from the env Headers map[string]string `json:"headers,omitempty"` diff --git a/internal/llm/agent/mcp-tools.go b/internal/llm/agent/mcp-tools.go index bb9b497722151c137dba1575390744230a3d6e99..d8610b557896272d94c76c608b9bc00347655be4 100644 --- a/internal/llm/agent/mcp-tools.go +++ b/internal/llm/agent/mcp-tools.go @@ -188,6 +188,10 @@ func GetMcpTools(ctx context.Context, permissions permission.Service, cfg *confi return mcpTools } for name, m := range cfg.MCP { + if m.Disabled { + slog.Debug("skipping disabled mcp", "name", name) + continue + } switch m.Type { case config.MCPStdio: c, err := client.NewStdioMCPClient(