barrel_mcp_http (barrel_mcp v2.0.2)

View Source

Simple HTTP transport for MCP (POST/OPTIONS, no sessions/SSE).

A minimal JSON-RPC-over-HTTP transport on the built-in h1/h2 server (barrel_mcp_http_listener). For the full Streamable HTTP transport (sessions, SSE, async tools) use barrel_mcp_http_stream.

Authentication Options

The auth option is a map with provider, provider_opts and required_scopes. See barrel_mcp_auth.

Summary

Functions

Start the simple HTTP server for MCP.

Stop the simple HTTP server.

Functions

start(Opts)

-spec start(map()) -> {ok, pid()} | {error, term()}.

Start the simple HTTP server for MCP.

Same security defaults as barrel_mcp_http_stream: binds to 127.0.0.1 by default and requires explicit allowed_origins for non-loopback binds.

stop()

-spec stop() -> ok | {error, not_found}.

Stop the simple HTTP server.