Zapzap
mcp
Package mcp provides a bridge between MCP (Model Context Protocol) servers and ZAP for high-performance tool calling.
import "github.com/luxfi/zap/mcp"Package mcp provides a bridge between MCP (Model Context Protocol) servers and ZAP for high-performance tool calling.
This bridge auto-discovers MCP servers and exposes their capabilities via ZAP, providing 10-30x performance improvement over native MCP JSON-RPC.
Types
Bridge
Bridge manages multiple MCP servers and exposes them via ZAP
func NewBridge(node *zap.Node) *Bridgefunc (b *Bridge) AddServer(name, command string, args ...string) errorfunc (b *Bridge) AddServerConfig(cfg ServerConfig) errorfunc (b *Bridge) CallTool(ctx context.Context, toolID uint32, args map[string]interface{}) (interface{}, error)func (b *Bridge) CallToolByName(ctx context.Context, name string, args map[string]interface{}) (interface{}, error)func (b *Bridge) GetTools() []Toolfunc (b *Bridge) Stop()MCPServer
MCPServer represents a connection to an MCP server
func (s *MCPServer) CallTool(name string, args map[string]interface{}) (interface{}, error)func (s *MCPServer) ListTools() ([]Tool, error)func (s *MCPServer) Start() errorfunc (s *MCPServer) Stop()ServerConfig
ServerConfig configures an MCP server
Tool
Tool represents an MCP tool capability