You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Static analysis of the internal/server package found 2 significant duplication patterns across transport.go and routed.go. These two files both implement HTTP servers for the MCP Gateway (unified and routed modes respectively) and share structural logic that has been copy-pasted rather than extracted into shared helpers.
Maintainability Risk: Medium — any change to session logging format or middleware order must be made in two places, risking divergence
Refactoring Priority: Low-Medium — the duplication is contained, but repeated changes (e.g. adding middleware, changing log formats) will require touching both files
Next Steps
Review individual pattern sub-issues for detailed analysis
Consider extracting shared helper(s) into http_helpers.go or a new server_factory.go
Prioritize refactoring alongside any planned changes to session handling or middleware
Analysis Metadata
Analyzed Files: 4 non-test Go files (transport.go, routed.go, http_helpers.go, handlers.go)
Analysis of latest commit on main
Summary
Static analysis of the
internal/serverpackage found 2 significant duplication patterns acrosstransport.goandrouted.go. These two files both implement HTTP servers for the MCP Gateway (unified and routed modes respectively) and share structural logic that has been copy-pasted rather than extracted into shared helpers.Detected Patterns
Overall Impact
internal/server/transport.go,internal/server/routed.go)Next Steps
http_helpers.goor a newserver_factory.goAnalysis Metadata
transport.go,routed.go,http_helpers.go,handlers.go)