Documentation
¶
Overview ¶
Package mcputils provides utilities for integrating MCP (Model Context Protocol) tools with trpc-agent-go. It handles the conversion of MCP tool schemas and provides wrapper types to make MCP tools compatible with the trpc-agent-go tool interface.
The main components are:
- ConvertMCPSchema: Converts MCP ToolInputSchema to trpc-agent-go tool.Schema
- MCPTool: Wraps MCP ServerTool to implement tool.Tool interface
Example usage:
import (
"github.com/stackgenhq/genie/pkg/mcputils"
"github.com/hashicorp/terraform-mcp-server/pkg/tools/registry"
"github.com/sirupsen/logrus"
)
logger := logrus.New()
mcpServerTool := registry.SearchModules(logger)
trpcTool := mcputils.NewMCPTool(mcpServerTool, logger)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMCPSchema ¶
func ConvertMCPSchema(mcpSchema mcp.ToolInputSchema) *tool.Schema
ConvertMCPSchema converts MCP input schema to trpc-agent-go schema This function handles the conversion of MCP ToolInputSchema to the tool.Schema format required by trpc-agent-go, including all nested properties and JSON Schema features.
Types ¶
type MCPTool ¶
type MCPTool struct {
// contains filtered or unexported fields
}
MCPTool wraps an MCP ServerTool to implement the trpc-agent-go tool.Tool interface
func NewMCPTool ¶
func NewMCPTool(mcpTool server.ServerTool) *MCPTool
NewMCPTool creates a new MCPTool wrapper around an MCP ServerTool
func (*MCPTool) Declaration ¶
func (t *MCPTool) Declaration() *tool.Declaration
Declaration returns the tool declaration with converted schema