Hermes MCP - Model Context Protocol Implementation for Elixir

Hey folks!

I would like to introduce hermes-mcp, a comprehensive elixir implementation of the https://spec.modelcontextprotocol.io/ that we’ve been building and using in production at CloudWalk. MCP enables standardized communication between LLMs and external tools, and we’re excited to share what we’ve built with the community.

current state & protocol support

hermes provides both client and server implementations with full support for the MCP spec:

  • draft & 2024-11-05 spec: complete implementation
  • 2025-03-26 spec: partial (missing OAuth authentication)
  • 2025-06-18 spec: on the roadmap

client architecture

the client supports multiple transport layers:

  • STDIO
  • SSE (Server-Sent Events)
  • WebSocket
  • Streamable HTTP

what’s interesting about the architecture is how it leverages OTP patterns. each client runs as a supervised process tree:
Client.Supervisor
├── Client.Base (handles MCP protocol and state management)
└── Transport Process (manages I/O and acts like a bridge between external world and the client process)

you can use it either as a long-running process or spawn one-off clients for specific tasks. the supervision strategy ensures fault tolerance based on the :one_for_all strategy.

server architecture

the server implementation supports:

  • STDIO, SSE, and Streamable HTTP transports
  • direct integration with Plug/Phoenix applications
  • component-based design for tools, prompts, and resources
  • low level implementation or higher-level where the library handle most of the requests/notifications

the server supervision tree adapts based on transport type:
Server.Supervisor
├── Session.Supervisor (for HTTP transports)
├── Server.Base (protocol handler)
└── Transport Process

production usage

we’re currently running hermes in production at CloudWalk, powering capabilities for JIM, our financial assistant serving hundreds of thousands of users across Brazil. our setup includes:

  • as MCP client: both local and clusterized deployments providing server capabilities to JIM
  • as MCP server (in progress): building a clusterized implementation using Horde for JIM to expose capabilities to external clients like Claude Desktop

why elixir for MCP?

Have you thought about how elixir’s concurrency model maps perfectly to MCP’s architecture? each session gets its own supervised process, state management is clean through genservers, and the fault tolerance means a single bad request won’t bring down your integration. plus, with libraries like Horde, we can easily distribute MCP servers across nodes.

looking for community input

some questions we’re exploring:

  • what patterns have you found useful for managing stateful connections with external services?
  • how are you handling protocol version negotiation in your APIs?
  • anyone else working with MCP or similar AI tool protocols?

we’d particularly love feedback on:

  • the component-based server design (using use Hermes.Server.Component)
  • our approach to transport abstraction and supervision tree architecture
  • ideas for the clusterized server implementation and possible edge cases/caveats

The library is available on

Documentation is on hermes_mcp v0.10.3 — Documentation

What challenges are you facing with LLM integration that MCP and maybe hermes-mcp might help solve?

16 Likes

Looks cool! Curious if there is a way to add tools that does not involve defining modules? i.e tools derived at runtime?

1 Like

I’m linking to Zach’s comment in the Vancouver thread for additional context, which I’m guessing that the above question is to figure out if/how AshAI can auto generate “Tools derived from Ash Resource actions/DSL” to be served by a Hermes server?

1 Like

I’ll also say that @zoedsoupe :clap: has been very responsive to, and providing answers/fixes/improvements to, inquiries in my own journey/experience/experimentation Hermes in my own project.

i’ve started a more in deep discussion on your open github issue but it could also benefit from moving it to here - although hermes-mcp seems to have more visibility on the github side…

hey @zachdaniel, now we have runtime server components registration feature: wdyt?

need to update documentation accordingly though

1 Like

It looks good at first glance, will need to see if I can get someone to try it out or find some time myself :smiley:

1 Like

I won’t have time myself, happy to advise someone on integrating these two tools and consider using ti as part of Ash AI

I’ve gotten a proof of concept working of a Hermes.Server that can register and call AshAi tools. It’s enough of a “walking skeleton” that it seems worth exploring further.

3 Likes

Hello, I’m playing with the echo example. I may be wrong but it seems that the MCP “transport” is not registered with an unique name, but with {:via, Registry, {Hermes.Server.Registry, {:transport, EchoMCP.Server, :sse}}}, meaning that all connected clients will use the same server right?

And then this server will make another GenServer.call in forward_request_to_server to another GenServer, which seem to be the actual server, which copies de input data once more. There are dynamic sessions processes but I don’t know how everything works yet.

I think this could be simplified because that transport GenServer looks like a bottleneck.

we’re kinda discussing that on the following github issue, wdyt?

Well I’m not really aligned with your conclusions. If we want to implement a tool that is not fast (it searches through database or runs network calls to an Elastic search instance), then all other users will have to wait in line.

Typical handler execution: 10-5000ms (dominated by I/O)

5 seconds is a lot. If you have 3 users using the server at the same time, one user will wait 15 seconds before the calling llm displays anything.