Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ config :tilex, Tilex.Notifications.Notifiers.Twitter,
token: System.get_env("twitter_access_token"),
token_secret: System.get_env("twitter_access_token_secret")

config :mime, :types, %{
"text/event-stream" => ["stream"]
}

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
16 changes: 12 additions & 4 deletions lib/tilex_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ defmodule TilexWeb.Router do
plug Tilex.Plug.RateLimiter
end

pipeline :mcp do
plug :accepts, ["json", "stream"]
end

scope "/mcp" do
pipe_through [:mcp]

forward "/",
Anubis.Server.Transport.StreamableHTTP.Plug,
server: Tilex.MCP.Server
end

scope "/api", TilexWeb do
pipe_through [:api]

Expand Down Expand Up @@ -113,8 +125,4 @@ defmodule TilexWeb.Router do
forward "/mailbox", Plug.Swoosh.MailboxPreview
end
end

forward "/mcp",
Anubis.Server.Transport.StreamableHTTP.Plug,
server: Tilex.MCP.Server
end
Loading