mcpproxy

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError added in v0.8.0

type HTTPError struct {
	StatusCode int
	Message    string
}

HTTPError represents an HTTP error with status code

func (*HTTPError) Error added in v0.8.0

func (e *HTTPError) Error() string

type SSETransport

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

SSETransport implements Transport using Server-Sent Events

func (*SSETransport) CallTool

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

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

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

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

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

Jump to

Keyboard shortcuts

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