Dev-only Model Context Protocol server for Corex. Exposes read-only tools so AI agents can discover components, modifiers, and themes without grepping the source.

Never enable in production. Upgrading from 0.1.x: Updating Corex.

Requirements

  • Elixir ~> 1.17

Packages

PackageKindPurposemix corex.new
corexHex depUnstyled Phoenix components, hooks, LiveView APIAlways
corex_designHex dep (runtime: false)Config-driven tokens, themes, and component CSS (Design)On by default; --no-design to skip
corex_mcpHex dep (only: [:dev, :test])Dev MCP server for AI component and design discovery (MCP); never enable in :prodOn by default; --no-mcp to skip
corex_newMix archiveGreenfield generator (mix corex.new)Install once with mix archive.install hex corex_new

Installation

corex_mcp does not depend on corex or corex_design. Add those in the host app (the installer does this by default):

def deps do
  [
    {:corex, "~> 0.2"},
    {:corex_design, "~> 0.2", runtime: false, only: :dev},
    {:corex_mcp, "~> 0.2", only: [:dev, :test]}
  ]
end

Mount in your Phoenix endpoint after Plug.Static and before the code reloader:

if Mix.env() in [:dev, :test] do
  plug Corex.MCP
end

Point your MCP client at Phoenix http://localhost:4000/corex/mcp or Tableau http://localhost:4004/corex/mcp. Prefer --no-mcp when scaffolding apps that should not expose the endpoint. Never set allow_remote_access: true casually.

Cursor / Claude Desktop / other clients

mix corex.new / mix corex.tableau.new write a project .cursor/mcp.json with the single URL for that app when --mcp is on (default). For a user-level / shared config (Cursor, Claude Desktop, VS Code, etc.) when you use both hosts, register both servers:

Cursor mcp.json:

{
  "mcpServers": {
    "corex": {
      "url": "http://localhost:4000/corex/mcp"
    },
    "corex-tableau": {
      "url": "http://localhost:4004/corex/mcp"
    }
  }
}

Claude Desktop uses the same two URLs under transport.type: "http". Other streamable HTTP clients: configure Phoenix on 4000 and Tableau on 4004; path is always /corex/mcp.

Canonical guide (tools, security, Tableau Bandit): MCP on Hexdocs / repo guides/MCP.md.

License

Apache-2.0 (MCP protocol stack adapted from Tidewave). Corex itself remains MIT.

Next steps