From 306c9218ba01a4d8fd084dcc24067ea8b16f06dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:20:25 +0000 Subject: [PATCH 1/2] Initial plan From 9af78b61f1e99164f605a1c6e0eb4156a8558f8d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:22:25 +0000 Subject: [PATCH 2/2] Co-locate WithSchemaCache with other With functions Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com> --- pkg/http/handler.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/http/handler.go b/pkg/http/handler.go index 4e1fbb143..c45929a20 100644 --- a/pkg/http/handler.go +++ b/pkg/http/handler.go @@ -17,14 +17,6 @@ import ( "github.com/modelcontextprotocol/go-sdk/mcp" ) -// WithSchemaCache sets a shared SchemaCache for the handler. -// This avoids repeated schema reflection when a new MCP Server is created per request. -func WithSchemaCache(cache *mcp.SchemaCache) HandlerOption { - return func(o *HandlerOptions) { - o.SchemaCache = cache - } -} - type InventoryFactoryFunc func(r *http.Request) (*inventory.Inventory, error) type GitHubMCPServerFactoryFunc func(r *http.Request, deps github.ToolDependencies, inventory *inventory.Inventory, cfg *github.MCPServerConfig) (*mcp.Server, error) @@ -83,6 +75,14 @@ func WithFeatureChecker(checker inventory.FeatureFlagChecker) HandlerOption { } } +// WithSchemaCache sets a shared SchemaCache for the handler. +// This avoids repeated schema reflection when a new MCP Server is created per request. +func WithSchemaCache(cache *mcp.SchemaCache) HandlerOption { + return func(o *HandlerOptions) { + o.SchemaCache = cache + } +} + func NewHTTPMcpHandler( ctx context.Context, cfg *ServerConfig,