Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Erlmcp

FreeNot checked

Stateless Model Context Protocol (MCP) client and server library for Erlang/OTP, targeting protocol version 2026-07-28.

GitHubEmbed

About

Stateless Model Context Protocol (MCP) client and server library for Erlang/OTP, targeting protocol version 2026-07-28.

README

Stateless Model Context Protocol (MCP) client and server library for Erlang/OTP, targeting protocol version 2026-07-28.

Features (v0.1.0)

Area Status
JSON-RPC 2.0 Complete validation, construction, errors, notifications
MCP protocol 2026-07-28 Stateless _meta, server/discover, resultType, MRTR (input_required)
Tools Registration, discovery, JSON Schema, concurrent execution with timeouts
MCP client Discovery, tool listing, tool invocation, response validation
MCP server Dispatch, tool execution, error mapping
STDIO transport Newline-delimited JSON (client side)
Streamable HTTP Client transport (POST + headers + JSON/SSE) + minimal server handler
Concurrency Request correlation, pending-request limits, process isolation
Reliability Timeouts, cancellation via process monitors, back-pressure

Quick start

As a library (rebar3 / mix)

Add to your rebar.config (or equivalent) and start the application:

{ok, _} = erlmcp:start().

Register a tool (server side)

erlmcp:register_tool(#{
    name => <<"echo">>,
    description => <<"Echo the input text">>,
    input_schema => #{
        <<"type">> => <<"object">>,
        <<"properties">> => #{
            <<"text">> => #{<<"type">> => <<"string">>}
        },
        <<"required">> => [<<"text">>]
    },
    handler => fun(#{<<"text">> := Text}) ->
        #{content => [#{<<"type">> => <<"text">>, <<"text">> => Text}]}
    end
}).

Client over STDIO

{ok, #{connection := Conn}} = erlmcp:start_stdio_client(),
{ok, Discover} = erlmcp_client:discover(Conn),
{ok, Tools}    = erlmcp_client:list_tools(Conn),
{ok, Result}   = erlmcp_client:call_tool(Conn, <<"echo">>, #{<<"text">> => <<"hello">>}).

Client over Streamable HTTP

{ok, #{connection := Conn}} = erlmcp:start_http_client(<<"https://example.com/mcp">>),
{ok, Result} = erlmcp_client:call_tool(Conn, <<"echo">>, #{<<"text">> => <<"hello">>}).

HTTP server integration (Cowboy sketch)

%% In your Cowboy handler:
handle(Req, State) ->
    {ok, Body, Req1} = cowboy_req:read_body(Req),
    Headers = cowboy_req:headers(Req),
    case erlmcp_http_handler:handle(Body, Headers) of
        {ok, Status, RespHeaders, RespBody} ->
            cowboy_req:reply(Status, maps:from_list(RespHeaders), RespBody, Req1);
        {error, Status, ErrorBody} ->
            cowboy_req:reply(Status, #{<<"content-type">> => <<"application/json">>},
                             ErrorBody, Req1)
    end,
    {ok, Req1, State}.

Architecture

erlmcp_client  ──►  erlmcp_client_connection  ──►  transport (stdio | http)
                                                          │
                                                          ▼
erlmcp_server  ◄──  erlmcp_http_handler / stdio reader
       │
       ├── erlmcp_tool_registry
       └── erlmcp_tool_executor
  • Client path is fully asynchronous and supports concurrent in-flight requests with correlation by JSON-RPC id.
  • Server path is pure: erlmcp_server:handle_message/1 has no process state. Transports and the HTTP handler are thin adapters around it.
  • Tool handlers run in isolated monitored processes with per-call timeouts.

Protocol notes (2026-07-28)

  • No initialize handshake and no protocol-level sessions.
  • Every request carries io.modelcontextprotocol/protocolVersion, client capabilities and (optionally) client info inside params._meta.
  • server/discover is the recommended first call.
  • Multi-round-trip requests return resultType: "input_required"; the client retries with inputResponses / requestState.
  • Streamable HTTP requires MCP-Protocol-Version and Mcp-Method headers (plus Mcp-Name for tools/call).

Building & testing

rebar3 compile
rebar3 eunit          # once you add the test suite

License

Apache-2.0


from github.com/pooriayousefi/erlmcp

Installing Erlmcp

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/pooriayousefi/erlmcp

FAQ

Is Erlmcp MCP free?

Yes, Erlmcp MCP is free — one-click install via Unyly at no cost.

Does Erlmcp need an API key?

No, Erlmcp runs without API keys or environment variables.

Is Erlmcp hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Erlmcp in Claude Desktop, Claude Code or Cursor?

Open Erlmcp on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Erlmcp with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All ai MCPs