Erlmcp
FreeNot checkedStateless Model Context Protocol (MCP) client and server library for Erlang/OTP, targeting protocol version 2026-07-28.
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/1has 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
initializehandshake and no protocol-level sessions. - Every request carries
io.modelcontextprotocol/protocolVersion, client capabilities and (optionally) client info insideparams._meta. server/discoveris the recommended first call.- Multi-round-trip requests return
resultType: "input_required"; the client retries withinputResponses/requestState. - Streamable HTTP requires
MCP-Protocol-VersionandMcp-Methodheaders (plusMcp-Namefortools/call).
Building & testing
rebar3 compile
rebar3 eunit # once you add the test suite
License
Apache-2.0
Installing Erlmcp
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/pooriayousefi/erlmcpFAQ
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
Opencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
by GitHub ActionsRoblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
by paralovAntigravity Drawio
MCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.
by S-SUJAN-SFetch
Web content fetching and conversion for efficient LLM usage.
Mcp
ModelContextProtocol server for enhancing JSON Resumes
by mcpflow.ioVault
Bitwarden/Vaultwarden MCP server — BYOK vault access with 6 tools, Send-based reveal, TOTP, and safe agent-write
by agbergsmannAWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
by lastmile-aiCompare Erlmcp with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
