Tidewave Phoenix

io.github.tidewave-ai由 GitHub 账号 tidewave-ai 发布v0.8.0更新于 Oct 24, 2026

Runtime-level MCP server for Phoenix development: run code, read logs, query the DB, read docs.

已验证STDIO仅桌面数据库开发者工具

概览

AI 生成的概览

面向 Phoenix 应用的运行时级 MCP 服务器,让编码代理执行 Elixir 代码、读取实时日志、查询开发数据库,并查阅文档与源码位置。

可以做什么
  • 在运行中的 Phoenix 应用内执行 Elixir 代码,相当于给代理一个 IEx 会话
  • 读取应用实时服务器日志,包括请求日志与调用栈
  • 对应用的开发数据库执行 SQL 查询
  • 按 mix.lock 中锁定的确切 hex 包版本查阅文档
  • 定位模块或函数定义所在的文件与行号,包括依赖中的定义
适用场景
适合编码代理开发 Phoenix 应用时使用:与其猜测行为,不如在运行中的应用里复现失败路径、查看函数返回值、请求后检查日志,或核对开发数据库中的数据。
运行要求
需在应用中添加仅用于开发环境的 tidewave hex 包,并在 Phoenix endpoint 中加入 Tidewave plug。应用需以开发模式运行;MCP 客户端通过 streamable HTTP 连接应用的 /tidewave/mcp 路径与端口(例如 localhost:4000),端口不固定时(如使用 worktree)可改用 mix tidewave.proxy 的 STDIO 方式。建议使用 Phoenix LiveView 1.1 或更高版本。
安装前请注意
代理可在运行中的应用里执行任意 Elixir 代码,并对开发数据库执行任意 SQL,因此可能读取或修改数据。默认仅允许 localhost 访问;allow_remote_access 选项须极其谨慎使用,并置于认证代理之后。Tidewave 加载的环境中会为 script-src 启用 unsafe-eval 并禁用 frame-ancestors,且默认向 HTML 页面注入工具栏。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tidewave Phoenix,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Tidewave Phoenix

Tidewave Phoenix is an MCP server that provides runtime-level tools for developing Phoenix apps using coding agents.

Your agent will be able to use this MCP server to talk to your running Phoenix app in development to:

  • execute code in the context of the running app (like an IEx session for agents)
  • read the app's live logs
  • query your development database
  • get source locations of modules and functions
  • read documentation pinned to the exact hex package versions your project depends on

This MCP server is an open-source component of Tidewave, the agentic development environment for Phoenix and Rails.

You can use this project as a standalone MCP server or integrated with the Tidewave product by following the installation instructions below.

Installation

1. Add the Tidewave hex package to your app

Option 1: Manually

Add the tidewave package to your mix.exs:

elixir
def deps do  [    {:tidewave, "~> 0.9", only: :dev},    {:phoenix, ...},  ]end

Then, for Phoenix applications, go to your lib/my_app_web/endpoint.ex and right above the if code_reloading? do block, add:

diff
+  if Mix.env() == :dev do+    plug Tidewave+  end
   if code_reloading? do

[!TIP] Tidewave works best with Phoenix LiveView v1.1 or later. Once you update it, make sure to enable the following options in your config/dev.exs:

elixir
config :phoenix_live_view,  debug_heex_annotations: true,  debug_attributes: true

Those are enabled by default for Phoenix v1.8+ apps.

Option 2: Using Igniter

Alternatively, you can use igniter to automatically install Tidewave MCP into an existing Phoenix application:

sh
# install igniter_new if you haven't alreadymix archive.install hex igniter_new
# install tidewavemix igniter.install tidewave
Umbrella projects

For umbrella projects, you can follow the manual steps above in the application that defines your Phoenix endpoint (typically apps/your_app_web).

2. Add the Tidewave MCP to your agent/editor

Add the Tidewave MCP server to your editor or MCP client configuration as the type "http" (streamable), pointing to the /tidewave/mcp path and port your web application is running at. For example, http://localhost:4000/tidewave/mcp.

We also have specific instructions for:

[!TIP] If you are using worktrees, you are likely running your web server on different ports, and therefore there isn't a single host and port combo you can use.

In such cases, you may want to add mix tidewave.proxy as STDIO MCP instead, which adds a "port" parameter to all tool definitions, and is responsible to dispatch to the correct application.

Usage

As with any other MCP server, your agent will call the tools exposed by the Tidewave MCP whenever it sees fit. But you can also prompt it to call them explicitly.

Available MCP tools

project_eval

Evaluates Elixir code within your running application, giving the agent access to your runtime, dependencies, and in-memory data. It's like an IEx for the agent.

[project_eval demo]

Your agent can use it when it would rather run code than assume behavior, grounding its next step in what the running app actually does. For example, calling a function to see what comes back or reproducing a failing code path against live app state to debug it.

execute_sql_query

Executes a SQL query within your app's development database.

[execute_sql_query demo]

Your agent can use it to run any SQL against your development database. Useful for the agent to verify the result of an action.

get_docs

Get the documentation for a given module/function. It consults the exact versions locked in your project's mix.lock, ensuring you get correct information.

[get_docs demo]

get_logs

Reads logs written by the server.

[get_logs demo]

Your agent can use it to see what happened after a request. For example, reading the request log and backtrace when something misbehaves.

get_source_location

Get the source location for a given module/function, across both your app and its dependencies.

[get_source_location demo]

Your agent can use it to jump straight to where a module/function is defined, by file and line, instead of grepping for it, including when the definition lives in a hex dependency.

Troubleshooting

Using multiple hosts/subdomains

If you are using multiple hosts/subdomains during development, you must use *.localhost, as such domains are considered secure by browsers. Additionally, add the following immediately @session_options definition in your lib/your_app_web/endpoint.ex:

elixir
@session_options [  # ... your configuration]
if code_reloading? do  @session_options Keyword.merge(@session_options, same_site: "None", secure: true)end

The above will allow your application to run embedded within Tidewave across multiple subdomains, as long as it is using a secure context (such as admin.localhost, www.foobar.localhost, etc).

Content security policy

If you have enabled Content-Security-Policy, Tidewave will automatically enable "unsafe-eval" under script-src in order for contextual browser testing to work correctly. It also disables the frame-ancestors directive. This is done only in the environments that Tidewave is loadead (development by default).

Configuration

You may configure the Tidewave plug using the following syntax:

elixir
  plug Tidewave, options

The following options are available:

  • :allow_remote_access - Tidewave only allows requests from localhost by default, even if your server listens on other interfaces, for security purposes. Read our security guidelines for more information and when to allow remote access. Use this option with extreme care and, once enabled, ensure you have an authentication proxy in front of your app.

  • :allowed_origins - a list of values matched against the Origin and Host headers to prevent cross origin and DNS rebinding attacks. Each value must be a string of shape [scheme:]//host[:port], where both scheme and port are optional. The host may also start with "*". Only the host is compared against the Host header. IP addresses, localhost, and *.localhost are always allowed as hosts. When not set, defaults to the host of your Phoenix endpoint URL. Example: ["//localhost:8000", "//*.test"]

  • :inspect_opts - custom options passed to Kernel.inspect/2 when formatting some tool results. Defaults to: [charlists: :as_lists, limit: 50, pretty: true]

  • :team - set your Tidewave Team configuration, such as team: [id: "my-company"]

  • :toolbar - controls whether the Tidewave toolbar is injected into your HTML pages. Defaults to true

  • tmp_dir - temporary directory Tidewave uses for screenshots and recordings. It must be a relative directory to the current application root. Defaults to tmp, storing files under tmp/tidewave/screenshots and tmp/tidewave/recordings

License

Copyright (c) 2025 Dashbit

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

来源:README.md,提交 64056ef

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.8.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分