EMCP

v1.0.0Developer Toolsstable

A Model Context Protocol (MCP) Server for Elixir

emcpmcpai-integration
Share:
32
Stars
0
Downloads
0
Weekly
0/5

What is EMCP?

EMCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server for elixir

A Model Context Protocol (MCP) Server for Elixir

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) Server for Elixir

Use Cases

Build Elixir applications with Model Context Protocol support.
Integrate Elixir development tools with LLM assistants.
PJUllrich

Maintainer

LicenseMIT
Languageelixir
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx emcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use EMCP

EMCP is an Elixir library that lets you build MCP servers natively inside Phoenix applications, exposing tools, prompts, and resources to AI clients over a StreamableHTTP or STDIO transport. It integrates with Phoenix Router's forward macro, uses ETS for session management, and supports origin validation for production deployments. Elixir developers use it to make their Phoenix application's business logic directly accessible to Claude and other MCP-compatible AI assistants without writing a separate sidecar process.

Prerequisites

  • Elixir 1.15 or later and the Mix build tool
  • An existing Phoenix application (or a new one created with 'mix phx.new')
  • The EMCP hex package added as a dependency in mix.exs
  • An MCP client such as Claude Desktop or Claude Code
1

Add EMCP to your mix.exs dependencies

Add the emcp package to your project's dependency list. Check hex.pm/packages/emcp for the current version number.

# In mix.exs deps:
{:emcp, "~> 0.1"}
2

Fetch dependencies

Download and compile the EMCP library and its transitive dependencies.

mix deps.get
3

Initialize the session store

Add the ETS session store initialization to your application's start/2 function in lib/my_app/application.ex so sessions persist across requests.

def start(_type, _args) do
  EMCP.SessionStore.ETS.init()
  # ... rest of your supervision tree
end
4

Define an MCP server module

Create a module that uses EMCP.Server and declares which tools, prompts, and resources it exposes. Each tool, prompt, and resource is its own module implementing the relevant behaviour.

defmodule MyApp.MCPServer do
  use EMCP.Server,
    name: "my-app",
    version: "1.0.0",
    tools: [MyApp.Tools.Echo],
    prompts: [MyApp.Prompts.CodeReview],
    resources: [MyApp.Resources.Readme]
end
5

Mount the transport in your Phoenix router

Add the StreamableHTTP transport outside any pipeline scope so it handles MCP JSON-RPC requests at the /mcp path.

scope "/mcp" do
  forward "/", EMCP.Transport.StreamableHTTP, server: MyApp.MCPServer
end
6

Configure your MCP client

For Claude Code, add the server to .claude/settings.json using the mix run command. For Claude Desktop with a running Phoenix server, use an HTTP transport URL pointing at the /mcp endpoint.

{
  "mcpServers": {
    "my-app": {
      "command": "mix",
      "args": ["run", "--no-halt"],
      "cwd": "/path/to/your/elixir/project"
    }
  }
}

EMCP Examples

Client configuration

Claude Code configuration that starts your Phoenix app as an MCP server via Mix. For a running web server, use an HTTP transport URL (e.g. http://localhost:4000/mcp) in Claude Desktop instead.

{
  "mcpServers": {
    "my-app": {
      "command": "mix",
      "args": ["run", "--no-halt"],
      "cwd": "/path/to/your/elixir/project"
    }
  }
}

Prompts to try

Once your Elixir application exposes tools via EMCP, Claude can call them by name through natural language.

- "Call the echo tool with the message 'hello from Claude'"
- "Use the code_review prompt to review this function with focus on performance"
- "List all available tools in the my-app MCP server"
- "Fetch the Readme resource from the server"
- "Call the user_profile resource template for user id 42"

Troubleshooting EMCP

MCP client cannot connect — connection refused on the /mcp endpoint

Ensure your Phoenix server is running ('mix phx.server') and that the forward route is mounted outside any authenticated pipeline scope. Check that the port in your client config matches the Phoenix server port (default 4000).

Session errors — 'session not found' when calling tools

Confirm that EMCP.SessionStore.ETS.init() is called in your application's start/2 function before the supervision tree starts. If you set recreate_missing_session to false in the transport config, expired sessions will not be auto-recreated — either set it back to true (the default) or handle re-initialization in your client.

Origin validation rejecting requests in development

The validate_origin option defaults to false. If you enabled it, add your development origin (e.g. 'localhost:4000') to the allowed_origins list in the transport configuration. In production, use bare domain names or full URLs matching the client's Origin header.

Frequently Asked Questions about EMCP

What is EMCP?

EMCP is a Model Context Protocol (MCP) server that model context protocol (mcp) server for elixir It connects AI assistants to external tools and data sources through a standardized interface.

How do I install EMCP?

Follow the installation instructions on the EMCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with EMCP?

EMCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is EMCP free to use?

Yes, EMCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "emcp": { "command": "npx", "args": ["-y", "emcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use EMCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides