feat(agent): add MCP integration (#50)

* feat(agent): add MCP integration

Signed-off-by: mudler <mudler@localai.io>

* Update core/agent/mcp.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Hook MCP Server configuration to creation and setting mask

* Allow to specify a bearer token

* Small fixups

---------

Signed-off-by: mudler <mudler@localai.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ettore Di Giacinto
2025-03-15 23:25:03 +01:00
committed by GitHub
parent dc2570c90b
commit 33b5b8c8f4
10 changed files with 422 additions and 14 deletions

View File

@@ -44,6 +44,8 @@ type options struct {
resultCallback func(ActionState)
conversationsPath string
mcpServers []MCPServer
}
func (o *options) SeparatedMultimodalModel() bool {
@@ -161,6 +163,13 @@ func WithSystemPrompt(prompt string) Option {
}
}
func WithMCPServers(servers ...MCPServer) Option {
return func(o *options) error {
o.mcpServers = servers
return nil
}
}
func WithLLMAPIURL(url string) Option {
return func(o *options) error {
o.LLMAPI.APIURL = url