Skip to content

Commit 7163ce3

Browse files
authored
fix: remove the default mcp path for streamable http (#226)
## Problem We force to add `/mcp` in all url for streamable http. ## Solution We remove this implicit rule. ## Rationale We normally add the whole path with the url when setup the transport.
1 parent 6a37f44 commit 7163ce3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
erlang 27.3
1+
erlang 27.3.4
22
elixir 1.19.0-rc.0-otp-27

lib/hermes/transport/streamable_http.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ defmodule Hermes.Transport.StreamableHTTP do
8383
name: {{:custom, &Hermes.genserver_name/1}, {:default, __MODULE__}},
8484
client: {:required, Hermes.get_schema(:process_name)},
8585
base_url: {:required, {:string, {:transform, &URI.new!/1}}},
86-
mcp_path: {:string, {:default, "/mcp/"}},
86+
mcp_path: {:string, {:default, "/"}},
8787
headers: {:map, {:default, %{}}},
8888
transport_opts: {:any, {:default, []}},
8989
http_options: {:any, {:default, []}},

test/hermes/transport/streamable_http_test.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ defmodule Hermes.Transport.StreamableHTTPTest do
5353

5454
Process.sleep(100)
5555

56-
_state = :sys.get_state(transport)
56+
state = :sys.get_state(transport)
57+
assert state.mcp_url.path == "/"
5758

5859
StreamableHTTP.shutdown(transport)
5960
StubClient.clear_messages()

0 commit comments

Comments
 (0)