@@ -14,10 +14,12 @@ import (
14
14
15
15
"github.com/stacklok/toolhive/pkg/logger"
16
16
"github.com/stacklok/toolhive/pkg/transport/types"
17
+ "github.com/stacklok/toolhive/pkg/versions"
17
18
)
18
19
19
20
// StdioBridge connects stdin/stdout to a target MCP server using the specified transport type.
20
21
type StdioBridge struct {
22
+ name string
21
23
mode types.TransportType
22
24
rawTarget string // upstream base URL
23
25
@@ -29,8 +31,12 @@ type StdioBridge struct {
29
31
}
30
32
31
33
// NewStdioBridge creates a new StdioBridge instance for the given target URL and transport type.
32
- func NewStdioBridge (rawURL string , mode types.TransportType ) (* StdioBridge , error ) {
33
- return & StdioBridge {mode : mode , rawTarget : rawURL }, nil
34
+ func NewStdioBridge (name , rawURL string , mode types.TransportType ) (* StdioBridge , error ) {
35
+ return & StdioBridge {
36
+ name : name ,
37
+ mode : mode ,
38
+ rawTarget : rawURL ,
39
+ }, nil
34
40
}
35
41
36
42
// Start initializes the bridge and connects to the upstream MCP server.
@@ -71,8 +77,8 @@ func (b *StdioBridge) run(ctx context.Context) {
71
77
72
78
// Tiny local stdio server
73
79
b .srv = server .NewMCPServer (
74
- "toolhive-stdio-bridge" ,
75
- "0.1.0" ,
80
+ fmt . Sprintf ( "thv-%s" , b . name ) ,
81
+ versions . Version ,
76
82
server .WithToolCapabilities (true ),
77
83
server .WithResourceCapabilities (true , true ),
78
84
server .WithPromptCapabilities (true ),
0 commit comments