New creates a Server with all 7 GoSQLX tools registered.
(cfg *Config)
| 32 | |
| 33 | // New creates a Server with all 7 GoSQLX tools registered. |
| 34 | func New(cfg *Config) *Server { |
| 35 | s := &Server{cfg: cfg} |
| 36 | s.mcpSrv = mcpserver.NewMCPServer( |
| 37 | "gosqlx-mcp", |
| 38 | "1.14.0", |
| 39 | mcpserver.WithToolCapabilities(false), |
| 40 | ) |
| 41 | s.registerTools() |
| 42 | return s |
| 43 | } |
| 44 | |
| 45 | // Handler returns the HTTP handler chain (MCP server + auth middleware) |
| 46 | // without starting an HTTP server. Use this when you need to wrap |