streamable

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package streamable provides a streamable HTTP proxy for MCP servers.

Index

Constants

View Source
const (
	// StreamableHTTPEndpoint is the endpoint for streamable HTTP.
	StreamableHTTPEndpoint = "/mcp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPProxy

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

HTTPProxy implements a proxy for streamable HTTP transport.

func NewHTTPProxy

func NewHTTPProxy(
	host string,
	port int,
	containerName string,
	prometheusHandler http.Handler,
	middlewares ...types.MiddlewareFunction,
) *HTTPProxy

NewHTTPProxy creates a new HTTPProxy for streamable HTTP transport.

func (*HTTPProxy) ForwardResponseToClients

func (p *HTTPProxy) ForwardResponseToClients(_ context.Context, msg jsonrpc2.Message) error

ForwardResponseToClients forwards a response from the container to the client.

func (*HTTPProxy) GetMessageChannel

func (p *HTTPProxy) GetMessageChannel() chan jsonrpc2.Message

GetMessageChannel returns the message channel for sending JSON-RPC to the container.

func (*HTTPProxy) GetResponseChannel

func (p *HTTPProxy) GetResponseChannel() <-chan jsonrpc2.Message

GetResponseChannel returns the response channel for receiving JSON-RPC from the container.

func (*HTTPProxy) SendMessageToDestination

func (p *HTTPProxy) SendMessageToDestination(msg jsonrpc2.Message) error

SendMessageToDestination sends a message to the container.

func (*HTTPProxy) SendResponseMessage

func (p *HTTPProxy) SendResponseMessage(msg jsonrpc2.Message) error

SendResponseMessage is for compatibility with the Proxy interface.

func (*HTTPProxy) Start

func (p *HTTPProxy) Start(_ context.Context) error

Start starts the HTTPProxy server.

func (*HTTPProxy) Stop

func (p *HTTPProxy) Stop(ctx context.Context) error

Stop gracefully shuts down the HTTPProxy server.

Jump to

Keyboard shortcuts

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