Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions internal/mcp/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os/exec"
"strings"
Expand Down Expand Up @@ -141,11 +140,9 @@ func NewConnection(ctx context.Context, serverID, command string, args []string,
}()

logger.LogInfo("backend", "Starting MCP backend server, command=%s, args=%v", command, sanitize.SanitizeArgs(expandedArgs))
log.Printf("Starting MCP server command: %s %v", command, sanitize.SanitizeArgs(expandedArgs))
transport := &sdk.CommandTransport{Command: cmd}

// Connect to the server (this handles the initialization handshake automatically)
log.Printf("Connecting to MCP server...")
logConn.Print("Initiating MCP server connection and handshake")
session, err := client.Connect(ctx, transport, nil)
if err != nil {
Expand Down Expand Up @@ -175,7 +172,7 @@ func NewConnection(ctx context.Context, serverID, command string, args []string,
isHTTP: false,
}

log.Printf("Started MCP server: %s %v", command, sanitize.SanitizeArgs(args))
logger.LogInfo("backend", "Started MCP server: %s %v", command, sanitize.SanitizeArgs(args))
return conn, nil
}

Expand Down Expand Up @@ -238,7 +235,6 @@ func NewHTTPConnection(ctx context.Context, serverID, url string, headers map[st
conn, err := tryStreamableHTTPTransport(ctx, cancel, serverID, url, headers, headerClient, keepAlive)
if err == nil {
logger.LogInfo("backend", "Successfully connected using streamable HTTP transport, url=%s", url)
log.Printf("Configured HTTP MCP server with streamable transport: %s", url)
return conn, nil
}
logConn.Printf("Streamable HTTP failed: %v", err)
Expand All @@ -261,7 +257,6 @@ func NewHTTPConnection(ctx context.Context, serverID, url string, headers map[st
conn, err = tryPlainJSONTransport(ctx, cancel, serverID, url, headers, headerClient)
if err == nil {
logger.LogInfo("backend", "Successfully connected using plain JSON-RPC transport, url=%s", url)
log.Printf("Configured HTTP MCP server with plain JSON-RPC transport: %s", url)
return conn, nil
}
logConn.Printf("Plain JSON-RPC transport failed: %v", err)
Expand Down
Loading