Skip to content

Commit d193d68

Browse files
mcp-type-adaptability (#576)
Summary: - Remove server transoprt hardcoded overwrite. - The positive scenario is covered by the pre-existing robot test `Concurrent psql and Reverse Proxy MCP HTTP Server Query Tool`.
1 parent 1a4dab0 commit d193d68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/stackql/cmd/mcp.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ var mcpSrvCmd = &cobra.Command{
6767
func runMCPServer(handlerCtx handler.HandlerContext) {
6868
var config mcp_server.Config
6969
json.Unmarshal([]byte(mcpConfig), &config) //nolint:errcheck // TODO: investigate
70-
config.Server.Transport = mcpServerType
70+
if config.Server.Transport == "" {
71+
config.Server.Transport = mcpServerType
72+
}
7173
var isReadOnly bool
7274
if config.Server.IsReadOnly != nil {
7375
isReadOnly = *config.Server.IsReadOnly
7476
}
7577
var backend mcp_server.Backend
7678
var backendErr error
7779
if mcpServerType == "reverse_proxy" {
78-
config.Server.Transport = "http"
7980
dsn := config.GetBackendConnectionString()
8081
// conn
8182
var cfg dto.SQLBackendCfg

0 commit comments

Comments
 (0)