Help us shape the future of Go! Take the 2026 Go Developer Survey

gateway

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package gateway connects to Upstreams and serves their tools to an Agent as Namespaced tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

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

Gateway is a started set of Upstreams and the MCP server exposing their tools.

func Start

func Start(ctx context.Context, configured []config.Upstream, env []string, startupTimeout time.Duration, version string, log *slog.Logger) *Gateway

Start launches every Upstream concurrently, collects their tools and returns a Gateway ready to serve them. env is the environment Upstream processes inherit. Each Upstream gets startupTimeout to connect and list its tools; one that fails or runs out of time is logged and left out.

func (*Gateway) Close

func (g *Gateway) Close()

Close shuts every Upstream down at once, and waits for those still being stopped after failing to start.

func (*Gateway) Failed

func (g *Gateway) Failed() int

Failed reports how many Upstreams failed or timed out at startup.

func (*Gateway) Serve

func (g *Gateway) Serve(ctx context.Context, stdin io.Reader, stdout io.Writer) error

Serve serves MCP to one Agent over stdin/stdout until the Agent disconnects or ctx is done.

Jump to

Keyboard shortcuts

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