Documentation
¶
Overview ¶
Package mcptest implements helper functions for testing MCP servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server encapsulates an MCP server and manages resources like pipes and context.
func NewServer ¶
NewServer starts a new MCP server with the provided tools and returns the server instance.
func NewUnstartedServer ¶
NewUnstartedServer creates a new MCP server instance with the given name, but does not start the server. Useful for tests where you need to add tools before starting the server.
func (*Server) AddTool ¶
func (s *Server) AddTool(tool mcp.Tool, handler server.ToolHandlerFunc)
AddTool adds a tool to an unstarted server.
func (*Server) AddTools ¶
func (s *Server) AddTools(tools ...server.ServerTool)
AddTools adds multiple tools to an unstarted server.
func (*Server) Client ¶
Client returns an MCP client connected to the server. The client is already initialized, i.e. you do _not_ need to call Client.Initialize().