Corex MCP
View SourceCorex includes a self-hosted Model Context Protocol (MCP) server, allowing you to securely serve Corex component registry and documentation to AI-powered tools like Cursor, Claude, and VS Code directly from your Phoenix app with no external dependencies or cloud services.
Corex MCP is based of Tidewave Phoenix which is under Apache Licence 2
1. Install Corex
def deps do
[
{:corex, "~> 0.1.0-beta.2"}
]
endmix deps.get
2. Mount the MCP plug
Add plug Corex.MCP to lib/my_app_web/endpoint.ex before the if code_reloading? do block, and after Plug.Static
if Mix.env() == :dev do
plug Corex.MCP
end4. Configure your MCP client
Use http://localhost:4000/corex/mcp (same host and port as the running Phoenix server).
Cursor
.cursor/mcp.json at the root of your project:
{
"servers": {
"corex": {
"url": "http://localhost:4000/corex/mcp"
}
}
}Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json add to mcpServers:
{
"mcpServers": {
"corex": {
"transport": {
"type": "http",
"url": "http://localhost:4000/corex/mcp"
}
}
}
}VS Code
settings.json:
{
"mcp.servers": {
"corex": {
"url": "http://localhost:4000/corex/mcp"
}
}
}Generic MCP client
{
"name": "corex",
"url": "http://localhost:4000/corex/mcp"
}5. Available tools
Corex MCP exposes the following tools