common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 16 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 common is the shell of the three hostile MCP servers of the test stand (evil-validator, shadow-carrier, rugpull-rates). They exist to attack the gateway on purpose and only run on the stand: compose gives them no published port.

Handler wraps an MCP server in an HTTP handler that serves /mcp (stateless Streamable HTTP) and /healthz, and writes one JSON line per request to the log: the names of the headers and whether any header holds a token of a client of the gateway. It never writes a header value (test T-UP-05 reads these lines to see that the token of the agent did not reach the server).

Main runs one server from the environment: ADV_LISTEN (default 127.0.0.1:8090), and optionally ADV_AUTH_HEADER and ADV_AUTH_VALUE, a header the gateway must send (a request without it gets 401; the log says whether it matched). "<binary> healthcheck" calls /healthz on the local port and exits 0 or 1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(name string, srv *mcp.Server, out io.Writer, authHeader, authValue string) http.Handler

Handler serves the MCP server at /mcp and logs the headers of every request to out. authHeader and authValue may be empty: then no header is required.

func Main

func Main(name string, build func() *mcp.Server)

Main runs the server built by build until SIGINT or SIGTERM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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