About Elixir MCP Server
Elixir MCP Server is a basic MCP server example built with Elixir, Bandit, and Plug for developers learning or building Elixir services. It uses SSE and includes file listing, echo, and weather tools.
Key features
- 01Implement an MCP server in Elixir
- 02Use SSE transport
- 03Provide a file-listing tool
- 04Provide a message echo tool
- 05Provide a weather lookup tool
Use cases
- 01Learn to implement an Elixir MCP server
- 02Test an SSE client connection
- 03Look up weather information
- 04Extend the example with custom tools
MCP support
The server exposes `list_files`, `echo`, and `get_weather` tools to MCP clients over SSE. Clients connect over SSE and send requests through the message endpoint.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEElixir MCP Server
An Elixir implementation of the Model Context Protocol (MCP) server using Elixir with Bandit and Plug.
The Model Context Protocol (MCP) is an open protocol that enables AI models to securely interact with local and remote resources through standardized server implementations. This project is a basic example of an MCP server using SSE (Server-Sent Events) as the transport protocol. It is based off the example at https://modelcontextprotocol.io/quickstart/server
Prerequisites
-
Elixir 1.18 or higher
-
Erlang/OTP 27 or higher
-
The weather API key can be set through the
WEATHER_API_KEYenvironment variable. The default service is using the free tier of https://www.weatherapi.com/.
Getting Started
-
Install dependencies:
mix deps.get -
Start the server:
WEATHER_API_KEY="1234567890abcdef" mix run --no-halt -
The server will be available at:
- SSE endpoint: http://localhost:4000/sse
- Message endpoint: http://localhost:4000/message
Available Tools
list_files: List files in a directoryecho: Echo a message backget_weather: Get weather information
Testing with MCP Client
Install the NXP Inspector client and follow the instructions to connect to the server.
Make sure to use SSE (Server-Sent Events) as the transport protocol, then you should be able to list available tools and call them. Also to ping/keepalive the connection, you can use the ping tool.
Adding Custom Tools
To add custom tools, update the handle_initialize/2 function to include your tool definitions and implement corresponding handle_call_tool/3 clauses.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.