API Reference anubis_mcp v#1.5.0

Copy Markdown

Modules

MCP (Model Context Protocol) client for connecting to MCP servers.

Represents an operation to be performed by the MCP client.

Test case template for MCP protocol testing.

Validator for the restricted JSON Schema subset allowed in elicitation requests.

Fluent API for building MCP protocol errors.

Handles parsing and validation of MCP (Model Context Protocol) messages using the Peri library.

Represents successful responses in the MCP protocol.

MCP protocol version management.

Behaviour that each MCP protocol version module must implement.

Registry for MCP protocol version modules.

Protocol implementation for MCP specification version 2024-11-05.

Protocol implementation for MCP specification version 2025-03-26.

Protocol implementation for MCP specification version 2025-06-18.

Protocol implementation for MCP specification version 2025-11-25.

Build MCP servers that extend language model capabilities.

Defines the behaviour for MCP prompts.

Defines the behaviour for MCP resources.

Defines the behaviour for MCP tools.

RFC 6570 URI Template parser and matcher (Levels 1 and 2).

Raised when required MCP server configuration is missing or invalid.

Read-only session and request context, set by the SDK before each callback.

The Anubis Frame — pure user state + read-only context.

Behaviour for pluggable session registries and deterministic naming utilities.

ETS-based session registry for HTTP transports.

No-op registry for STDIO transport.

Fluent interface for building MCP component responses.

Per-client MCP session process.

Behaviour for session persistence adapters.

Redis-based session store implementation.

Represents an MCP task — a durable state machine wrapping a long-running request.

Behaviour for pluggable MCP task storage backends.

In-memory Anubis.Server.TaskStore adapter backed by a single GenServer.

SSE (Server-Sent Events) transport implementation for MCP servers.

A Plug implementation for the SSE (Server-Sent Events) transport.

STDIO transport implementation for MCP servers.

StreamableHTTP transport implementation for MCP servers.

A Plug implementation for the Streamable HTTP transport.

Mock session store for testing persistence functionality.

Synchronization helpers that replace fixed Process.sleep/1 waits in tests.

Functional behaviour for MCP transport implementations.

Defines the behavior that all transport implementations must follow.

A transport implementation that uses Server-Sent Events (SSE) for receiving messages and HTTP POST requests for sending messages back to the server.

A transport implementation that uses standard input/output.

A transport implementation that uses Streamable HTTP as specified in MCP 2025-03-26.

A transport implementation that uses WebSockets for bidirectional communication with the MCP server.

Test server with controllable tool timing for async dispatch tests.

A mock transport that delegates parse/encode to STDIO (for buffering) but stubs the GenServer behaviour. Used to test chunked STDIO responses.

Default Mox stub-with module for Anubis.MockTransport.

Minimal test server that implements only the required callbacks.

Test server that rejects session recovery via handle_session_expired/2.

Test server that implements handle_session_expired/2, supplying custom client info and marking the frame with a recovery flag.

Simple mock transport for MCP protocol testing. Records all messages sent through it for inspection in tests.

Stub MCP server used by Tasks lifecycle tests.

Returns a CallToolResult with isError: true.

Mandatory task tool.

Default policy — task augmentation forbidden.

Adds two integers after waiting for a {:proceed, sig} message.

Minimal Erlang IO-protocol server for exercising Anubis.Server.Transport.STDIO in tests.

Test prompt with field metadata

Legacy prompt without field macros

Prompt with nested fields

Tool with list of dates

Tool with datetime field

Tool with date field

Tool with deeply nested fields

Tool demonstrating enum with type specification

Tool with nested date fields

Tool using traditional Peri schema syntax without field macros

Tool with naive datetime field

Tool with nested field definitions

Tool demonstrating required: true option

Tool with single nested field

Tool with time field

A tool with annotations

A tool with custom annotations implementation

A tool that returns data not matching its output schema

A tool with _meta support

A tool with output schema

A tool without annotations

A tool with no required parameters

Mix Tasks

Mix task to test the SSE transport implementation, interactively sending commands.

Mix task to test the STDIO transport implementation, interactively sending commands.

Mix task to test the Streamable HTTP transport implementation, interactively sending commands.

Mix task to test the WebSocket transport implementation, interactively sending commands.