Documentation
¶
Index ¶
- type HTTPError
- type SSETransport
- func (t *SSETransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
- func (t *SSETransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
- func (t *SSETransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
- func (t *SSETransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
- func (t *SSETransport) IsRunning() bool
- func (t *SSETransport) Start(ctx context.Context, tmplCtx *template.Context) error
- func (t *SSETransport) Stop(_ context.Context) error
- type StdioTransport
- func (t *StdioTransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
- func (t *StdioTransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
- func (t *StdioTransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
- func (t *StdioTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
- func (t *StdioTransport) IsRunning() bool
- func (t *StdioTransport) Start(ctx context.Context, tmplCtx *template.Context) error
- func (t *StdioTransport) Stop(_ context.Context) error
- type StreamableTransport
- func (t *StreamableTransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
- func (t *StreamableTransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
- func (t *StreamableTransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
- func (t *StreamableTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
- func (t *StreamableTransport) IsRunning() bool
- func (t *StreamableTransport) Start(ctx context.Context, tmplCtx *template.Context) error
- func (t *StreamableTransport) Stop(_ context.Context) error
- type Transport
- type TransportType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSETransport ¶
type SSETransport struct {
// contains filtered or unexported fields
}
SSETransport implements Transport using Server-Sent Events
func (*SSETransport) CallTool ¶
func (t *SSETransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
func (*SSETransport) FetchPrompt ¶ added in v0.8.0
func (t *SSETransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
FetchPrompt returns a specific prompt by name
func (*SSETransport) FetchPrompts ¶ added in v0.8.0
func (t *SSETransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
FetchPrompts returns all prompts
func (*SSETransport) FetchTools ¶
func (t *SSETransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
func (*SSETransport) IsRunning ¶
func (t *SSETransport) IsRunning() bool
type StdioTransport ¶
type StdioTransport struct {
// contains filtered or unexported fields
}
StdioTransport implements Transport using standard input/output
func (*StdioTransport) CallTool ¶
func (t *StdioTransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
func (*StdioTransport) FetchPrompt ¶ added in v0.8.0
func (t *StdioTransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
FetchPrompt returns a specific prompt by name
func (*StdioTransport) FetchPrompts ¶ added in v0.8.0
func (t *StdioTransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
FetchPrompts returns all prompts
func (*StdioTransport) FetchTools ¶
func (t *StdioTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
func (*StdioTransport) IsRunning ¶
func (t *StdioTransport) IsRunning() bool
type StreamableTransport ¶
type StreamableTransport struct {
// contains filtered or unexported fields
}
StreamableTransport implements Transport using Streamable HTTP
func (*StreamableTransport) CallTool ¶
func (t *StreamableTransport) CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
func (*StreamableTransport) FetchPrompt ¶ added in v0.8.0
func (t *StreamableTransport) FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
FetchPrompt returns a specific prompt by name
func (*StreamableTransport) FetchPrompts ¶ added in v0.8.0
func (t *StreamableTransport) FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
FetchPrompts returns all prompts
func (*StreamableTransport) FetchTools ¶
func (t *StreamableTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
func (*StreamableTransport) IsRunning ¶
func (t *StreamableTransport) IsRunning() bool
type Transport ¶
type Transport interface {
// FetchTools fetches the list of available tools
FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)
// CallTool invokes a tool
CallTool(ctx context.Context, params mcp.CallToolParams, req *template.RequestWrapper) (*mcp.CallToolResult, error)
// Start starts the transport
Start(ctx context.Context, tmplCtx *template.Context) error
// Stop stops the transport
Stop(ctx context.Context) error
// IsRunning returns true if the transport is running
IsRunning() bool
// FetchPrompts fetches the list of available prompts
FetchPrompts(ctx context.Context) ([]mcp.PromptSchema, error)
// FetchPrompt fetches a specific prompt by name
FetchPrompt(ctx context.Context, name string) (*mcp.PromptSchema, error)
}
Transport defines the interface for MCP transport implementations
func NewTransport ¶
func NewTransport(cfg config.MCPServerConfig) (Transport, error)
NewTransport creates transport based on the configuration
type TransportType ¶
type TransportType string
TransportType represents the type of transport
const ( // TypeSSE represents SSE-based transport TypeSSE TransportType = "sse" // TypeStdio represents stdio-based transport TypeStdio TransportType = "stdio" // TypeStreamable represents streamable HTTP-based transport TypeStreamable TransportType = "streamable-http" )
Click to show internal directories.
Click to hide internal directories.