Documentation
¶
Overview ¶
mcptool package provides MCP adapter, allowing to add MCP tools to LLMAgent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns MCP ToolSet. MCP ToolSet connects to a MCP Server, retrieves MCP Tools into ADK Tools and passes them to the LLM. It uses https://github.com/modelcontextprotocol/go-sdk for MCP communication. MCP session is created lazily on the first request to LLM.
Usage: create MCP ToolSet with mcptoolset.New() and provide it to the LLMAgent in the llmagent.Config.
Example:
llmagent.New(llmagent.Config{
Name: "agent_name",
Model: model,
Description: "...",
Instruction: "...",
Toolsets: []tool.Set{
mcptoolset.New(mcptoolset.Config{
Transport: &mcp.CommandTransport{Command: exec.Command("myserver")}
}),
},
})
Types ¶
type Config ¶
type Config struct {
// Transport that will be used to connect to MCP server.
Transport mcp.Transport
// ToolFilter selects tools for which tool.Predicate returns true.
// If ToolFilter is nil, then all tools are returned.
// tool.StringPredicate can be convenient if there's a known fixed list of tool names.
ToolFilter tool.Predicate
}
Config provides initial configuration for the MCP ToolSet.
Click to show internal directories.
Click to hide internal directories.