Skip to content

Commit ed30a1d

Browse files
Co-locate WithSchemaCache with other With functions
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
1 parent cd1b5a2 commit ed30a1d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/http/handler.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ import (
1717
"github.com/modelcontextprotocol/go-sdk/mcp"
1818
)
1919

20-
// WithSchemaCache sets a shared SchemaCache for the handler.
21-
// This avoids repeated schema reflection when a new MCP Server is created per request.
22-
func WithSchemaCache(cache *mcp.SchemaCache) HandlerOption {
23-
return func(o *HandlerOptions) {
24-
o.SchemaCache = cache
25-
}
26-
}
27-
2820
type InventoryFactoryFunc func(r *http.Request) (*inventory.Inventory, error)
2921
type GitHubMCPServerFactoryFunc func(r *http.Request, deps github.ToolDependencies, inventory *inventory.Inventory, cfg *github.MCPServerConfig) (*mcp.Server, error)
3022

@@ -83,6 +75,14 @@ func WithFeatureChecker(checker inventory.FeatureFlagChecker) HandlerOption {
8375
}
8476
}
8577

78+
// WithSchemaCache sets a shared SchemaCache for the handler.
79+
// This avoids repeated schema reflection when a new MCP Server is created per request.
80+
func WithSchemaCache(cache *mcp.SchemaCache) HandlerOption {
81+
return func(o *HandlerOptions) {
82+
o.SchemaCache = cache
83+
}
84+
}
85+
8686
func NewHTTPMcpHandler(
8787
ctx context.Context,
8888
cfg *ServerConfig,

0 commit comments

Comments
 (0)