cachehints

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cachehints applies SEP-2549 cache hints (ttlMs/cacheScope) to MCP results. Almost every catalog in this server is token- and tier-dependent (PAT scope filtering, licensing-tier gating), so almost every cacheable result is marked "private": shared intermediaries must never serve one user's catalog to another. The prompt catalog is the exception and is "public"; see [scopePublic]. TTLs distinguish stable catalogs from live GitLab data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(opts Options) mcp.Middleware

Middleware returns a receiving middleware that stamps cache hints on every CacheableResult according to the package policy.

Types

type Options

type Options struct {
	// TierPinned reports that the licensing tier was configured rather than
	// detected from the instance license, so it cannot change while the
	// server runs. It lifts the tool catalog to the same one-hour window as
	// the catalogs compiled into the binary.
	//
	// A token's scopes are still detected per pool entry and also filter the
	// catalog, but that variation is bounded by the client's own token and
	// every hint is stamped "private", so no other client can observe it.
	TierPinned bool
}

Options configures the freshness windows the middleware stamps.

Jump to

Keyboard shortcuts

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