Setting up Tidewave in your Phoenix app

almirsarajcic

almirsarajcic

Created 22 days ago

If you’re reading this, you’re ready to ride this wave of coding using AI agents. Just follow these simple instructions and you’ll be more productive in no time.

Install tidewave in the dev environment and add the plug to the Endpoint module:

# mix.exs
{:tidewave, "~> 0.1", only: :dev}

# lib/my_app_web/endpoint.ex
# just above the `if code_reloading? do` block
if Code.ensure_loaded?(Tidewave) do
  plug Tidewave
end

If you’re using Cursor, create a file .cursor/mcp.json in your project:

{
   "mcpServers": {
     "tidewave": {
       "url": "http://localhost:4000/tidewave/mcp"
     }
   }
 }

For other editors, check out https://hexdocs.pm/tidewave/mcp.html.

That’s it. Start the Phoenix server and go vibing.
More info: https://github.com/tidewave-ai/tidewave_phoenix.

If you get an issue with the plug dependency, make sure to update it to version 1.17:

{:plug, "~> 1.17"}

If you consistently see SSE errors in the Cursor’s MCP configuration, you might want to use MCP Proxy.
Learn how to set it up: https://elixirdrops.net/d/uX3gTNPJ.