mcpproxy

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 (*SSETransport) FetchTools

func (t *SSETransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)

func (*SSETransport) IsRunning

func (t *SSETransport) IsRunning() bool

func (*SSETransport) Start

func (t *SSETransport) Start(ctx context.Context, tmplCtx *template.Context) error

func (*SSETransport) Stop

func (t *SSETransport) Stop(_ context.Context) error

type StdioTransport

type StdioTransport struct {
	// contains filtered or unexported fields
}

StdioTransport implements Transport using standard input/output

func (*StdioTransport) CallTool

func (*StdioTransport) FetchTools

func (t *StdioTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)

func (*StdioTransport) IsRunning

func (t *StdioTransport) IsRunning() bool

func (*StdioTransport) Start

func (t *StdioTransport) Start(ctx context.Context, tmplCtx *template.Context) error

func (*StdioTransport) Stop

func (t *StdioTransport) Stop(_ context.Context) error

type StreamableTransport

type StreamableTransport struct {
	// contains filtered or unexported fields
}

StreamableTransport implements Transport using Streamable HTTP

func (*StreamableTransport) CallTool

func (*StreamableTransport) FetchTools

func (t *StreamableTransport) FetchTools(ctx context.Context) ([]mcp.ToolSchema, error)

func (*StreamableTransport) IsRunning

func (t *StreamableTransport) IsRunning() bool

func (*StreamableTransport) Start

func (t *StreamableTransport) Start(ctx context.Context, tmplCtx *template.Context) error

func (*StreamableTransport) Stop

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
}

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL