@@ -18,43 +18,43 @@ import (
1818type InventoryFactoryFunc func (r * http.Request ) (* inventory.Inventory , error )
1919type GitHubMCPServerFactoryFunc func (r * http.Request , deps github.ToolDependencies , inventory * inventory.Inventory , cfg * github.MCPServerConfig ) (* mcp.Server , error )
2020
21- type HTTPMcpHandler struct {
21+ type Handler struct {
2222 ctx context.Context
23- config * HTTPServerConfig
23+ config * ServerConfig
2424 deps github.ToolDependencies
2525 logger * slog.Logger
2626 t translations.TranslationHelperFunc
2727 githubMcpServerFactory GitHubMCPServerFactoryFunc
2828 inventoryFactoryFunc InventoryFactoryFunc
2929}
3030
31- type HTTPMcpHandlerOptions struct {
31+ type HandlerOptions struct {
3232 GitHubMcpServerFactory GitHubMCPServerFactoryFunc
3333 InventoryFactory InventoryFactoryFunc
3434}
3535
36- type HTTPMcpHandlerOption func (* HTTPMcpHandlerOptions )
36+ type HandlerOption func (* HandlerOptions )
3737
38- func WithGitHubMCPServerFactory (f GitHubMCPServerFactoryFunc ) HTTPMcpHandlerOption {
39- return func (o * HTTPMcpHandlerOptions ) {
38+ func WithGitHubMCPServerFactory (f GitHubMCPServerFactoryFunc ) HandlerOption {
39+ return func (o * HandlerOptions ) {
4040 o .GitHubMcpServerFactory = f
4141 }
4242}
4343
44- func WithInventoryFactory (f InventoryFactoryFunc ) HTTPMcpHandlerOption {
45- return func (o * HTTPMcpHandlerOptions ) {
44+ func WithInventoryFactory (f InventoryFactoryFunc ) HandlerOption {
45+ return func (o * HandlerOptions ) {
4646 o .InventoryFactory = f
4747 }
4848}
4949
5050func NewHTTPMcpHandler (
5151 ctx context.Context ,
52- cfg * HTTPServerConfig ,
52+ cfg * ServerConfig ,
5353 deps github.ToolDependencies ,
5454 t translations.TranslationHelperFunc ,
5555 logger * slog.Logger ,
56- options ... HTTPMcpHandlerOption ) * HTTPMcpHandler {
57- opts := & HTTPMcpHandlerOptions {}
56+ options ... HandlerOption ) * Handler {
57+ opts := & HandlerOptions {}
5858 for _ , o := range options {
5959 o (opts )
6060 }
@@ -69,7 +69,7 @@ func NewHTTPMcpHandler(
6969 inventoryFactory = DefaultInventoryFactory (cfg , t , nil )
7070 }
7171
72- return & HTTPMcpHandler {
72+ return & Handler {
7373 ctx : ctx ,
7474 config : cfg ,
7575 deps : deps ,
@@ -82,7 +82,7 @@ func NewHTTPMcpHandler(
8282
8383// RegisterRoutes registers the routes for the MCP server
8484// URL-based values take precedence over header-based values
85- func (h * HTTPMcpHandler ) RegisterRoutes (r chi.Router ) {
85+ func (h * Handler ) RegisterRoutes (r chi.Router ) {
8686 r .Use (middleware .WithRequestConfig )
8787
8888 r .Mount ("/" , h )
@@ -109,7 +109,7 @@ func withToolset(next http.Handler) http.Handler {
109109 })
110110}
111111
112- func (h * HTTPMcpHandler ) ServeHTTP (w http.ResponseWriter , r * http.Request ) {
112+ func (h * Handler ) ServeHTTP (w http.ResponseWriter , r * http.Request ) {
113113 inventory , err := h .inventoryFactoryFunc (r )
114114 if err != nil {
115115 w .WriteHeader (http .StatusInternalServerError )
@@ -128,7 +128,7 @@ func (h *HTTPMcpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
128128 w .WriteHeader (http .StatusInternalServerError )
129129 }
130130
131- mcpHandler := mcp .NewStreamableHTTPHandler (func (r * http.Request ) * mcp.Server {
131+ mcpHandler := mcp .NewStreamableHTTPHandler (func (_ * http.Request ) * mcp.Server {
132132 return ghServer
133133 }, & mcp.StreamableHTTPOptions {
134134 Stateless : true ,
@@ -141,7 +141,7 @@ func DefaultGitHubMCPServerFactory(r *http.Request, deps github.ToolDependencies
141141 return github .NewMCPServer (r .Context (), cfg , deps , inventory )
142142}
143143
144- func DefaultInventoryFactory (cfg * HTTPServerConfig , t translations.TranslationHelperFunc , staticChecker inventory.FeatureFlagChecker ) InventoryFactoryFunc {
144+ func DefaultInventoryFactory (_ * ServerConfig , t translations.TranslationHelperFunc , staticChecker inventory.FeatureFlagChecker ) InventoryFactoryFunc {
145145 return func (r * http.Request ) (* inventory.Inventory , error ) {
146146 b := github .NewInventory (t ).WithDeprecatedAliases (github .DeprecatedToolAliases )
147147
0 commit comments