Documentation
¶
Index ¶
- type HTTPServer
- func (s *HTTPServer) Call(ctx context.Context, method string, params interface{}) (json.RawMessage, error)
- func (s *HTTPServer) CallTool(ctx context.Context, name string, args map[string]interface{}) (string, error)
- func (s *HTTPServer) Close() error
- func (s *HTTPServer) ListTools(ctx context.Context) ([]Tool, error)
- type Resource
- type Server
- type Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
Name string
URL string
Headers map[string]string
Type string // "http" or "sse"
// contains filtered or unexported fields
}
HTTPServer represents an MCP server connected via HTTP or SSE transport.
func ConnectHTTP ¶
func ConnectHTTP(ctx context.Context, name, url string, headers map[string]string) (*HTTPServer, error)
ConnectHTTP connects to an MCP server via HTTP streamable transport.
func ConnectSSE ¶
func ConnectSSE(ctx context.Context, name, url string, headers map[string]string) (*HTTPServer, error)
ConnectSSE connects to an MCP server via Server-Sent Events transport.
func (*HTTPServer) Call ¶
func (s *HTTPServer) Call(ctx context.Context, method string, params interface{}) (json.RawMessage, error)
Call sends a JSON-RPC request and returns the result.
func (*HTTPServer) CallTool ¶
func (s *HTTPServer) CallTool(ctx context.Context, name string, args map[string]interface{}) (string, error)
CallTool invokes a tool on the HTTP/SSE MCP server.
func (*HTTPServer) Close ¶
func (s *HTTPServer) Close() error
Close is a no-op for HTTP/SSE servers (no persistent connection).
type Resource ¶
type Resource struct {
URI string `json:"uri"`
Name string `json:"name"`
MimeType string `json:"mimeType,omitempty"`
Description string `json:"description,omitempty"`
}
Resource is a resource exposed by an MCP server.
type Server ¶
type Server struct {
Name string
Command string
Args []string
// contains filtered or unexported fields
}
Server represents a connected MCP server.
func (*Server) ListResources ¶
ListResources returns resources available on this MCP server.
Click to show internal directories.
Click to hide internal directories.