epinault
MCP Serverepinaultpublic

elixir_mcp_server

An example of how to implement an MCP server using Elixir and SSE transport

Repository Info

6
Stars
2
Forks
6
Watchers
0
Issues
Elixir
Language
MIT License
License

About This Server

An example of how to implement an MCP server using Elixir and SSE transport

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Elixir 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_KEY environment variable. The default service is using the free tier of https://www.weatherapi.com/.

Getting Started

  1. Install dependencies:

    mix deps.get
    
  2. Start the server:

    WEATHER_API_KEY="1234567890abcdef" mix run --no-halt
    
    
    
  3. 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 directory
  • echo: Echo a message back
  • get_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.

Quick Start

1

Clone the repository

git clone https://github.com/epinault/elixir_mcp_server
2

Install dependencies

cd elixir_mcp_server
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerepinault
Repoelixir_mcp_server
LanguageElixir
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation