MCP cover image

Elixir模型上下文协议(MCP)SDK

7

Github Watches

8

Github Forks

98

Github Stars

Hermes MCP

hex.pm docs ci

[!WARNING]

This library is under active development, may expect breaking changes

A high-performance Model Context Protocol (MCP) implementation in Elixir.

Overview

Hermes MCP is a comprehensive Elixir SDK for the Model Context Protocol, aiming to provide complete client and server implementations. The library leverages Elixir's exceptional concurrency model and fault tolerance capabilities to deliver a robust MCP experience.

Currently, Hermes MCP offers a feature-complete client implementation conforming to the MCP 2024-11-05 specification. Server-side components are planned for future releases.

Roadmap

Current Status

  • Complete client implementation (MCP 2024-11-05)
  • Multiple transport options (STDIO and HTTP/SSE)
  • Built-in connection supervision and automatic recovery
  • Comprehensive capability negotiation
  • Progress tracking and cancellation support
  • Structured logging system

Upcoming

  • Client support for MCP 2025-03-26 specification

    • Authorization framework (OAuth 2.1)
    • Streamable HTTP transport
    • JSON-RPC batch operations
    • Enhanced tool annotations
  • Server Implementation

    • STDIO transport
    • HTTP/SSE transport
    • Streamable HTTP transport
    • Support for resources, tools, and prompts
  • Sample Implementations

    • Reference servers
    • Integration examples with popular Elixir libraries

For a more detailed roadmap, see ROADMAP.md.

Installation

Library Usage

Add Hermes MCP to your dependencies in mix.exs:

def deps do
  [
    {:hermes_mcp, "~> 0.3"}
  ]
end

Standalone CLI Installation

Download the appropriate binary for your platform from the GitHub releases page.

# Make it executable (Linux/macOS)
# or hermes_cli-macos-intel, hermes_cli-macos-arm
mv hermes_mcp_linux hermes-mcp && chmod +x hermes-mcp

# Run it
./hermes-mcp --transport sse --base-url="http://localhost:8000"

Quick Start

Interactive Testing

Hermes MCP provides interactive tools for testing MCP servers with a user-friendly CLI.

Using the CLI Binary:

# Test an SSE server
hermes_cli --transport sse --base-url="http://localhost:8000" --base-path="/mcp"

# Test a local process via STDIO
hermes_cli --transport stdio --command="mcp" --args="run,path/to/server.py"

Using Mix Tasks (For Elixir Developers):

# Test an SSE server
mix hermes.sse.interactive --base-url="http://localhost:8000" --base-path="/mcp"

# Test a local process via STDIO
mix hermes.stdio.interactive --command="mcp" --args="run,path/to/server.py"

These interactive shells provide commands for listing and calling tools, exploring prompts, and accessing resources.

Setting up a Client

defmodule MyApp.Application do
  use Application

  def start(_type, _args) do
    children = [
      # Start the MCP transport
      {Hermes.Transport.STDIO, [
        name: MyApp.MCPTransport,
        client: MyApp.MCPClient, 
        command: "mcp",
        args: ["run", "path/to/server.py"]
      ]},
      
      # Start the MCP client using the transport
      {Hermes.Client, [
        name: MyApp.MCPClient,
        transport: [layer: Hermes.Transport.STDIO, name: MyApp.MCPTransport],
        client_info: %{
          "name" => "MyApp",
          "version" => "1.0.0"
        },
        capabilities: %{
          "roots" => %{"listChanged" => true},
          "sampling" => %{}
        }
      ]}
    ]
    
    opts = [strategy: :one_for_all, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

Making Client Requests

# Call a tool
{:ok, result} = Hermes.Client.call_tool(MyApp.MCPClient, "example_tool", %{"param" => "value"})

# Handle errors properly
case Hermes.Client.call_tool(MyApp.MCPClient, "unavailable_tool", %{}) do
  {:ok, %Hermes.MCP.Response{}} ->
    # Handle successful result
    
  {:error, %Hermes.MCP.Error{} = err} ->
    # Handle error response
    IO.puts(inspect(err, pretty: true))
end

Documentation

For detailed guides and examples, visit the official documentation

Why Hermes?

The library is named after Hermes, the Greek god of boundaries, communication, and commerce. This namesake reflects the core purpose of the Model Context Protocol: to establish standardized communication between AI applications and external tools.

Like Hermes who served as a messenger between gods and mortals, this library facilitates seamless interaction between Large Language Models and various data sources or tools.

Local Development

# Setup the project
mix setup

# Run tests
mix test

# Code quality
mix lint

# Start development MCP servers
# Echo server (Python)
just echo-server
# Calculator server (Go)
just calculator-server

The MCP servers in priv/dev require:

  • Python 3.11+ with uv (for echo server)
  • Go 1.21+ (for calculator server)

See CONTRIBUTING.md for detailed contribution guidelines.

License

Hermes MCP is released under the MIT License. See LICENSE for details.

相关推荐

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

    Reviews

    2 (1)
    Avatar
    user_Bh9TOCTG
    2025-04-17

    I've been using hermes-mcp by Cloudwalk for a while now, and I'm thoroughly impressed. The seamless integration and robust functionality have made my workflows significantly more efficient. It's well-documented and easy to navigate. Highly recommend for anyone looking for a reliable MCP application!