TA

tidewave-ai/tidewave_phoenix

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

858 stars 73 forks 质量 69 趋势 42Apache-2.0

配备 Phoenix 开发运行时级工具的 MCP 服务器

概览

Tidewave Phoenix 是一个 MCP 服务器,提供运行时级工具,用于使用编码代理开发 Phoenix 应用。 您的代理将能够使用该MCP服务器与正在开发的Phoenix应用通信: - 在运行应用的上下文中执行代码(比如代理的IEx会话) - 读取应用的实时日志 - 查询你的开发数据库 - 获取模块和函数的源位置 - 阅读固定到你项目依赖的精确十六进制包版本的文档 该MCP服务器是Tidewave的开源组件,Tidewave是Phoenix和Rails的代理开发环境。 你可以将该项目作为独立的MCP服务器使用,也可以与Tidewave产品集成。 如需将其作为独立的MCP服务器使用,请按照以下安装说明操作。 把潮浪包加入你的mix.exs: 然后,对于Phoenix应用,去你的lib/my_app_web/endpoint.ex,在if code_reloading上方?先block,然后添加:

概述(AI 翻译)

Tidewave Phoenix 是一个 MCP 服务器,提供运行时级工具,用于使用编码代理开发 Phoenix 应用。

您的代理将能够使用该MCP服务器与正在开发的Phoenix应用通信:

  • 在运行应用的上下文中执行代码(如代理的IEx会话)
  • 阅读应用的实时日志
  • 查询您的开发数据库
  • 获取模块和函数的源位置
  • 阅读你项目所依赖的精确十六进制包版本的文档

该MCP服务器是Tidewave的开源组件,Tidewave是Phoenix和Rails的代理开发环境。

您可以按照以下安装说明将该项目作为独立的MCP服务器使用,或与Tidewave产品集成。

安装

1.把Tidewave hex包添加到你的应用里

选项1:手动

将tidewave包添加到你的mix.exs中:

然后,对于凤凰申请,请进入你的lib/my_app_web/endpoint.ex,在if code_reloading? do块上方,添加:

[!提示] Tidewave 在 Phoenix LiveView v1.1 或更高版本上运行最佳。一旦你更新了它, 确保在你的config/dev.exs中启用以下选项:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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:

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:

+  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:

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:

# install igniter_new if you haven't already
mix archive.install hex igniter_new

# install tidewave
mix 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.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →