server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package server provides shared MCP server utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunHTTP

func RunHTTP(ctx context.Context, srv *mcp.Server, addr string, headerPassthrough []string) error

RunHTTP starts a StreamableHTTP MCP server and blocks until ctx is canceled. When headerPassthrough is non-empty, listed headers from inbound HTTP requests are captured into the request context so downstream calls can forward them. A GET /healthz endpoint returns 200 {"status":"ok"} and is always available.

func ShouldOptimize

func ShouldOptimize(opt *optimizer.Optimizer, globalDefault bool, perRequest string) bool

ShouldOptimize determines whether to run LLM optimization for a request. It considers the optimizer availability, the global default, and an optional per-request override ("true"/"false"/"yes"/"no"/"1"/"0").

func WrapHandler

func WrapHandler(handler http.Handler, headerPassthrough []string) http.Handler

WrapHandler optionally wraps an http.Handler with header-capture middleware. When headerPassthrough is non-empty, the returned handler captures the listed headers from inbound requests into the request context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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