server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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