Skip to content

Commit 4232de4

Browse files
committed
Call client.Start() for sse transport.
1 parent 46b9c03 commit 4232de4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ mcp web https://ne.tools
340340
The web interface includes:
341341

342342
- A sidebar listing all available tools, resources, and prompts
343-
- Form-based and JSON-based parameter editing
343+
- Form-based and JSON-based parameter editing
344344
- Formatted and raw JSON response views
345345
- Interactive parameter forms automatically generated from tool schemas
346346
- Support for complex parameter types (arrays, objects, nested structures)
@@ -559,7 +559,7 @@ mcp proxy tool --unregister add_operation
559559
mcp proxy start
560560
```
561561

562-
Running `mcp tools localhost:3000` with the proxy server will show the registered tools with their parameters:
562+
Running `mcp tools http://localhost:3000/sse` with the proxy server will show the registered tools with their parameters:
563563

564564
```
565565
add_operation(a:int, b:int)
@@ -626,7 +626,7 @@ mcp proxy tool count_lines "Counts lines in a file" "file:string" -e "wc -l < \"
626626
The guard mode allows you to restrict access to specific tools, prompts, and resources based on pattern matching. This is useful for security purposes when:
627627

628628
- Restricting potentially dangerous operations (file writes, deletions, etc.)
629-
- Limiting the capabilities of AI assistants or applications
629+
- Limiting the capabilities of AI assistants or applications
630630
- Providing read-only access to sensitive systems
631631
- Creating sandboxed environments for testing or demonstrations
632632

cmd/mcptools/commands/utils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var (
2323

2424
// IsHTTP returns true if the string is a valid HTTP URL.
2525
func IsHTTP(str string) bool {
26-
return strings.HasPrefix(str, "http://") || strings.HasPrefix(str, "https://")
26+
return strings.HasPrefix(str, "http://") || strings.HasPrefix(str, "https://") || strings.HasPrefix(str, "localhost:")
2727
}
2828

2929
// CreateClientFunc is the function used to create MCP clients.
@@ -48,6 +48,10 @@ var CreateClientFunc = func(args []string, _ ...client.ClientOption) (*client.Cl
4848

4949
if len(args) == 1 && IsHTTP(args[0]) {
5050
c, err = client.NewSSEMCPClient(args[0])
51+
if err != nil {
52+
return nil, err
53+
}
54+
err = c.Start(context.Background())
5155
} else {
5256
c, err = client.NewStdioMCPClient(args[0], nil, args[1:]...)
5357
}

0 commit comments

Comments
 (0)