Skip to content

Commit 14c6ae8

Browse files
committed
changes from review
1 parent 4064485 commit 14c6ae8

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

cmd/thv/app/proxy_stdio.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import (
1313
)
1414

1515
var proxyStdioCmd = &cobra.Command{
16-
Use: "stdio WORKLOAD-NAME SERVER_NAME",
16+
Use: "stdio WORKLOAD-NAME",
1717
Short: "Create a stdio-based proxy for an MCP server",
1818
Long: `Create a stdio-based proxy that connects stdin/stdout to a target MCP server.
1919
2020
Example:
21-
thv proxy stdio my-workload my-server-proxy
21+
thv proxy stdio my-workload
2222
`,
23-
Args: cobra.ExactArgs(2),
23+
Args: cobra.ExactArgs(1),
2424
RunE: proxyStdioCmdFunc,
2525
}
2626

@@ -29,8 +29,6 @@ func proxyStdioCmdFunc(cmd *cobra.Command, args []string) error {
2929
defer cancel()
3030

3131
workloadName := args[0]
32-
serverName := args[1]
33-
3432
workloadManager, err := workloads.NewManager(ctx)
3533
if err != nil {
3634
return fmt.Errorf("failed to create workload manager: %w", err)
@@ -39,7 +37,7 @@ func proxyStdioCmdFunc(cmd *cobra.Command, args []string) error {
3937
if err != nil {
4038
return fmt.Errorf("failed to get workload %q: %w", workloadName, err)
4139
}
42-
logger.Infof("Starting stdio proxy for server=%q -> %s", serverName, workloadName)
40+
logger.Infof("Starting stdio proxy for workload=%q", workloadName)
4341

4442
bridge, err := transport.NewStdioBridge(stdioWorkload.URL)
4543
if err != nil {

docs/cli/thv_proxy_stdio.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/proxy_stdio_test.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,19 @@ func generateUniqueProxyStdioServerName(prefix string) string {
2222

2323
var _ = Describe("Proxy Stdio E2E", Serial, func() {
2424
var (
25-
config *e2e.TestConfig
26-
proxyCmd *exec.Cmd
27-
mcpServerName string
28-
workloadName string
29-
proxyServerName string
30-
transportType types.TransportType
31-
proxyMode string // e.g. "sse" or "streamable-http"
25+
config *e2e.TestConfig
26+
proxyCmd *exec.Cmd
27+
mcpServerName string
28+
workloadName string
29+
transportType types.TransportType
30+
proxyMode string // e.g. "sse" or "streamable-http"
3231
)
3332

3433
BeforeEach(func() {
3534
config = e2e.NewTestConfig()
3635
err := e2e.CheckTHVBinaryAvailable(config)
3736
Expect(err).ToNot(HaveOccurred())
3837
workloadName = generateUniqueProxyStdioServerName("mcpserver-proxy-stdio--target")
39-
proxyServerName = generateUniqueProxyStdioServerName("mcpserver-proxy-test")
4038
})
4139

4240
JustBeforeEach(func() {
@@ -94,7 +92,6 @@ var _ = Describe("Proxy Stdio E2E", Serial, func() {
9492
proxyCmd, stdin, outputBuffer := startProxyStdioForMCP(
9593
config,
9694
workloadName,
97-
proxyServerName,
9895
)
9996

10097
// Ensure the proxy started
@@ -146,7 +143,6 @@ var _ = Describe("Proxy Stdio E2E", Serial, func() {
146143
proxyCmd, stdin, outputBuffer := startProxyStdioForMCP(
147144
config,
148145
workloadName,
149-
proxyServerName,
150146
)
151147

152148
// Ensure the proxy started
@@ -198,7 +194,6 @@ var _ = Describe("Proxy Stdio E2E", Serial, func() {
198194
proxyCmd, stdin, outputBuffer := startProxyStdioForMCP(
199195
config,
200196
workloadName,
201-
proxyServerName,
202197
)
203198

204199
// Ensure the proxy started
@@ -230,12 +225,11 @@ var _ = Describe("Proxy Stdio E2E", Serial, func() {
230225
})
231226

232227
// Helper functions
233-
func startProxyStdioForMCP(config *e2e.TestConfig, workloadName string, proxyServerName string) (*exec.Cmd, io.WriteCloser, *bytes.Buffer) {
228+
func startProxyStdioForMCP(config *e2e.TestConfig, workloadName string) (*exec.Cmd, io.WriteCloser, *bytes.Buffer) {
234229
args := []string{
235230
"proxy",
236231
"stdio",
237232
workloadName,
238-
proxyServerName,
239233
}
240234

241235
// Log the command for debugging

0 commit comments

Comments
 (0)