Corex MCP

View Source

Introduction

You expose Corex component metadata to AI tools (Cursor, Claude Desktop, VS Code) from your running app. The MCP server is self-hosted—no external SaaS.

Built on Tidewave Phoenix (Apache-2.0).

Do not enable MCP in production. The tools are read-only, but the endpoint still widens your attack surface. Use it only while developing locally (or in :test when generated apps include it for CI).

Before you start

RequirementNotes
{:corex, "~> 0.1.0-rc.0"}In mix.exs
Running HTTP serverPhoenix endpoint or Tableau Bandit child

Phoenix endpoint

Add plug Corex.MCP in lib/my_app_web/endpoint.ex after Plug.Static and before the code reloader block:

if Mix.env() == :dev do
  plug Corex.MCP
end

Start the app. MCP is available at http://localhost:4000/corex/mcp (adjust host and port).

Cursor.cursor/mcp.json:

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

Claude Desktopclaude_desktop_config.json:

{
  "mcpServers": {
    "corex": {
      "transport": {
        "type": "http",
        "url": "http://localhost:4000/corex/mcp"
      }
    }
  }
}

Tableau Bandit

Tableau has no Phoenix endpoint. Run MCP on a separate Bandit port—see Tableau (MCP section).

Point your client at http://localhost:4004 when using the default MCP port there.

Tools

All tools are read-only.

ToolPurpose
list_componentsAll component ids (accordion, date_picker, …)
get_componentModule, slots, docs, source_path for one id
installation_guideInstall steps for new or existing projects (scenario: new_project, existing_project, all)

Call list_components before get_component when you need a valid id.

  • Installationmix corex.new enables MCP in dev by default
  • Tableau — Bandit MCP for static sites