Documentation
¶
Index ¶
- func FromMCPServer(cfg ServerConfig, opts ...Option) (extensionspkg.Extension, error)
- type Adapter
- func (a *Adapter) Health(ctx context.Context) (extensionspkg.HealthSnapshot, error)
- func (a *Adapter) Info() extensionspkg.ExtensionInfo
- func (a *Adapter) Invalidate()
- func (a *Adapter) Reload(ctx context.Context) error
- func (a *Adapter) ResolveTools(ctx context.Context) ([]extensionspkg.ExtensionTool, error)
- type Client
- type ClientError
- type ClientErrorCode
- type Option
- type ServerConfig
- type ServerSnapshot
- type StdioClient
- type ToolDescriptor
- type ToolOverride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromMCPServer ¶
func FromMCPServer(cfg ServerConfig, opts ...Option) (extensionspkg.Extension, error)
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func (*Adapter) Health ¶
func (a *Adapter) Health(ctx context.Context) (extensionspkg.HealthSnapshot, error)
func (*Adapter) Info ¶
func (a *Adapter) Info() extensionspkg.ExtensionInfo
func (*Adapter) Invalidate ¶
func (a *Adapter) Invalidate()
func (*Adapter) ResolveTools ¶
func (a *Adapter) ResolveTools(ctx context.Context) ([]extensionspkg.ExtensionTool, error)
type Client ¶
type Client interface {
Discover(ctx context.Context, cfg ServerConfig) (ServerSnapshot, error)
CallTool(ctx context.Context, cfg ServerConfig, toolName string, raw json.RawMessage) (string, error)
}
type ClientError ¶
type ClientError struct {
Code ClientErrorCode
Message string
Err error
}
func (*ClientError) Error ¶
func (e *ClientError) Error() string
func (*ClientError) Unwrap ¶
func (e *ClientError) Unwrap() error
type ClientErrorCode ¶
type ClientErrorCode string
const ( ClientErrorInvalidConfig ClientErrorCode = "invalid_config" ClientErrorTransport ClientErrorCode = "transport_error" ClientErrorProtocol ClientErrorCode = "protocol_error" ClientErrorTimeout ClientErrorCode = "timeout" ClientErrorHandshakeFailed ClientErrorCode = "handshake_failed" ClientErrorListToolsFailed ClientErrorCode = "tools_list_failed" ClientErrorCallFailed ClientErrorCode = "call_failed" ClientErrorPermission ClientErrorCode = "permission_denied" ClientErrorInvalidArgs ClientErrorCode = "invalid_args" )
type Option ¶
type Option func(*adapterOptions)
func WithClient ¶
func WithEagerDiscover ¶
func WithRefreshTTL ¶
type ServerConfig ¶
type ServerSnapshot ¶
type ServerSnapshot struct {
ID string
Name string
Version string
Tools []ToolDescriptor
}
type StdioClient ¶
type StdioClient struct{}
func NewStdioClient ¶
func NewStdioClient() *StdioClient
func (*StdioClient) CallTool ¶
func (c *StdioClient) CallTool(ctx context.Context, cfg ServerConfig, toolName string, raw json.RawMessage) (string, error)
func (*StdioClient) Discover ¶
func (c *StdioClient) Discover(ctx context.Context, cfg ServerConfig) (ServerSnapshot, error)
type ToolDescriptor ¶
Click to show internal directories.
Click to hide internal directories.