Modules
ExMCP - Complete Elixir implementation of the Model Context Protocol.
Facade for the Agent Client Protocol (ACP).
Behaviour for adapting non-native CLI agents to ACP.
GenServer bridge between ACP clients and non-native CLI agents.
Pure ACP event builders for agent adapters.
ExMCP.Transport implementation that delegates to an AdapterBridge.
Adapter for Claude Code using the Claude Agent SDK process protocol.
Pure Claude SDK message to ACP message mapping.
Pure helpers for Claude Code's SDK-flavoured stream-json protocol.
Pure helpers for Claude Code's SDK session store.
Pure Claude tool-use to ACP tool-call metadata conversion.
Adapter for Codex CLI using codex app-server persistent mode.
Pure config and mode helpers for the Codex ACP adapter.
Pure event-mapping helpers for the Codex ACP adapter.
Pure mappings for Codex file change lifecycle notifications.
Pure session and thread helpers for the Codex ACP adapter.
Pure slash-command parsing helpers for the Codex ACP adapter.
ACP adapter for the Pi coding agent.
Runtime for building native Elixir Agent Client Protocol agents.
Behaviour for native Elixir ACP agents.
Transport behaviour for ACP agent runtimes.
In-memory ACP transport for tests and local integration.
Server-side stdio transport for ACP agents.
Pure helpers for ACP capability maps.
GenServer client for the Agent Client Protocol (ACP).
Default ACP handler that collects events and denies permissions.
Behaviour for handling ACP session events and agent requests.
Pure JSON-RPC 2.0 envelope builders for ACP messages.
Pure normalization and validation for ACP session lifecycle parameters.
Small pure map helpers used by ACP protocol, client, agent, and adapters.
Pure helpers for ACP _meta extension placement.
Pure normalizers for ACP name/value list shapes.
Small functional queue core for ACP adapter prompt backlogs.
ACP-specific message encoding.
Helpers for the public ACP agent registry.
Type specifications and builder functions for the Agent Client Protocol (ACP).
Behaviour for implementing approval handlers in MCP clients.
MCP Authorization support for OAuth 2.1 with PKCE.
OAuth 2.1 Authorization Server Metadata Discovery (RFC 8414).
RFC 7523 Section 2.2 — JWT client assertions for private_key_jwt authentication.
OAuth Client ID Metadata Document support for MCP authorization.
Deprecated Dynamic Client Registration for OAuth 2.1.
Pluggable persistence boundary for issuer-bound OAuth credentials.
An OAuth client registration bound to one authorization-server issuer.
OAuth tokens together with their complete, non-secret authorization binding.
Full 401 -> discovery -> auth orchestrator for MCP OAuth.
Client-side enterprise SSO orchestrator for MCP.
Handles authorization-related errors and triggers appropriate OAuth flows.
Full OAuth 2.1 authorization code flow with PKCE for MCP.
HTTP client functionality for OAuth 2.1 requests.
ID-JAG (Identity JWT Authorization Grant) creation and validation.
Server-side handler for processing ID-JAG tokens in JWT bearer grants.
Request interceptor that automatically adds authorization headers.
Exact authorization-server issuer comparison.
General-purpose JWT module wrapping JOSE for MCP authorization.
RFC 7523 Section 2.1 — JWT Bearer Grant.
Fail-closed HTTP fetch boundary for OAuth metadata documents.
OAuth 2.1 flow implementations for MCP authorization.
Bounded, node-local single-use state for OAuth authorization-code flows.
OpenID Connect Discovery support for MCP authorization.
PKCE (Proof Key for Code Exchange) implementation for OAuth 2.1.
OAuth 2.0 Protected Resource Metadata Discovery (RFC 9728 - Draft).
Behaviour for pluggable OAuth/auth providers in MCP transports.
OAuth 2.1 authorization provider with PKCE, PRM discovery, and scope step-up.
Static token provider for pre-existing bearer tokens.
Selects the OAuth client registration mechanism for an authorization server.
Maps MCP operations to required OAuth scopes and validates them.
Bounded, redirect-free HTTP boundary for OAuth protocol requests.
Centralized configuration management for OAuth 2.1 authorization server settings.
OAuth 2.1 Resource Server guard for validating bearer tokens.
RFC 8693 Token Exchange implementation.
Manages OAuth tokens with automatic refresh and expiration tracking.
Client-side OAuth 2.0 Token Revocation (RFC 7009).
Validation functions for OAuth 2.1 parameters and endpoints.
Unified MCP client combining the best features of all implementations.
Callback-based handler for MCP client events.
Connection lifecycle management for ExMCP client.
This module provides ExMCP extensions beyond the standard MCP specification.
Default elicitation handler for MCP clients.
Stores protocol-era observations independently of an individual client.
Performs the side-effect-free server/discover probe used to establish a
modern MCP connection before any application request is sent.
Enhanced error formatting and actionable guidance for MCP.
This module implements the standard MCP specification.
Interactive terminal handler for MCP client events.
Middleware pipeline for cross-cutting concerns in the ExMCP client.
Prompt operations for ExMCP client.
Resource operations for ExMCP client.
Client operations for legacy tasks and the modern Tasks extension.
Tool operations for ExMCP client.
Request/response processing for ExMCP client.
Response normalization and transformation utilities for MCP.
A client-owned MCP 2026-07-28 subscription stream.
A reference to an active subscription process.
Shared type definitions for ExMCP.Client modules.
Configuration builder for ExMCP clients.
Raised when client operations fail
Raised when MCP connection fails
A behaviour for handling user consent for accessing external resources.
A consent handler that prompts the user for consent via the command line.
Suitable for interactive stdio transport sessions.
A consent handler that denies all requests for external resource access. This is the default, production-safe handler.
A consent handler for web applications.
Content handling utilities for MCP messages.
Smart constructors and builder patterns for ExMCP content creation.
Content protocol for ExMCP - type-safe content handling system.
Content sanitization utilities for MCP content.
Fail-closed resource policy for JSON Schema compilation and validation.
Schema validation for MCP content.
Security scanning utilities for MCP content.
Content transformation utilities for MCP content.
Content validation and transformation utilities for ExMCP.
GenServer-based validator registry that replaces Process dictionary usage.
Error types and utilities for ExMCP.
Errors related to MCP protocol violations.
Errors that occur during resource operations.
Errors that occur during tool execution.
Errors related to transport layer issues.
Errors related to input validation.
Feature flag system for controlling rollout of new MCP features.
Helper macros and functions for common MCP patterns in ExMCP.
HTTP Plug for MCP (Model Context Protocol) requests. Compatible with Phoenix and Cowboy servers.
Pure request/response decisions for ExMCP.HttpPlug.
Connection operations ExMCP.HttpPlug.SSEHandler needs from its socket.
Default ExMCP.HttpPlug.SSEConnection implementation backed by Plug.Conn.
Server-Sent Events handler with backpressure control.
Supervised owner of the SSE session table used by ExMCP.HttpPlug.
Core message processing abstraction for ExMCP.
Connection struct representing an MCP message processing context.
Plug for DNS rebinding protection.
Serves a JSON Web Key Set (JWKS) for token signature verification.
Serves Protected Resource Metadata per RFC 9728.
Plug for validating and extracting the MCP-Protocol-Version header.
Server-side token introspection endpoint (RFC 7662).
Server-side token revocation endpoint (RFC 7009).
Progress tracking for MCP 2025-06-18 specification compliance.
Raised when prompt operations fail
Defines and validates the cache hints required by modern MCP results.
JSON-RPC 2.0 and MCP-specific error codes.
Builds and validates MCP _meta objects.
Canonical registry of MCP methods understood by ExMCP.
Processes JSON-RPC requests for MCP servers.
Manages tracking of pending requests and cancellations for MCP servers.
Utility module for building JSON-RPC 2.0 responses in MCP.
Classifies result envelopes according to the negotiated MCP protocol era.
Validates and bounds W3C trace-context fields carried in MCP _meta.
Negotiates legacy MCP revisions during the initialize handshake.
Registry for managing tools, resources, and prompts in ExMCP.
Convenience functions for reliability features.
Circuit breaker GenServer wrapper.
Pure circuit-breaker state machine used by ExMCP.Reliability.CircuitBreaker.
Health check system for MCP clients and servers.
Retry logic with exponential backoff for MCP operations.
Supervisor for reliability components in ExMCP.
Wrapper process that integrates reliability features for MCP clients.
Raised when resource operations fail
Structured response types for MCP operations.
Handles Cross-Origin Resource Sharing (CORS) logic.
Manages user consent for various operations.
Handles outbound credential isolation and exact-origin trust classification.
Handles request and response validation, including transport layer security configurations.
Public server-side helpers for running MCP servers.
Strategy for propagating notifications/cancelled into handler state.
Default cancellation tracker.
Helper module to build server capabilities.
Access to the validated context of the currently executing server callback.
Modern DSL for defining MCP server primitives next to their handlers.
Response helpers for the modern server DSL.
Assembles and validates server/discover results.
Single MCP method table for handler modules invoked with their own state.
This module implements the standard MCP specification.
This module provides ExMCP extensions beyond the standard MCP specification.
Normalizes ExMCP.Server.Handler callback returns into canonical
GenServer.handle_call/3 replies.
Transport-aware process for ExMCP.Server.Handler modules.
A server result that suspends a modern MCP operation for client input.
Behaviour for atomically consuming MRTR continuation identifiers.
Node-local atomic replay cache for MRTR request state.
Validated protocol context for one inbound MCP message.
Seals and verifies opaque MCP multi-round-trip request state.
Shared result and error normalization for every server dispatch path.
Server-side SSE session manager for bidirectional MCP communication.
STDIO transport server for MCP protocol.
Registry and publication coordinator for MCP 2026-07-28 subscriptions.
Storage contract for modern MCP subscription registrations.
Node-local subscription adapter backed by a private ETS table.
A modern MCP subscription registration.
Cluster fan-out adapter for modern MCP subscriptions.
DSL for defining MCP tools in server handlers.
Validates AST nodes to ensure they are safe for evaluation.
Simplified tool builder that reduces metaprogramming complexity.
Runtime representation of a tool definition.
Helper functions for building tool responses and working with schemas.
Runtime tool registry that manages tool definitions and handlers.
Normalizes tool responses to comply with MCP specification.
Simplified tool definition DSL that reduces metaprogramming complexity.
Transport configuration and lifecycle management for ExMCP servers.
Legacy session management for Streamable HTTP connections.
Launcher module for STDIO servers that handles Mix.install output.
Tracks streamable-HTTP resource subscriptions by MCP session.
Durable lifecycle helpers for the MCP Tasks extension.
Capability and wire helpers for the MCP Tasks extension.
Server-callback adapters for ExMCP.Tasks.
Persistence contract for the MCP Tasks extension.
Bounded node-local Tasks store with atomic lifecycle operations.
Task struct and state machine validation for MCP Tasks.
Telemetry integration for ExMCP.
Custom test case for ExMCP with MCP-specific testing utilities.
Custom assertions for MCP protocol testing.
Test data builders and generators for ExMCP.
Mock MCP server implementation for testing.
Mock transport implementation that connects to MockServer.
Generates valid test values from JSON Schema definitions.
Raised when tool operations fail
Behaviour definition for MCP transport implementations.
Standardized error handling for MCP transports.
Streamable HTTP client transport for both supported MCP wire eras.
HTTP server transport for MCP with security and CORS support.
Example HTTP server configuration that includes protocol version validation.
Local BEAM transport for ExMCP.
Transport wrapper that adds circuit breaker protection to any MCP transport.
Server-Sent Events client for the Streamable HTTP transport.
Standardized security error handling across transports.
Transport-layer security interceptor that enforces MCP security policies.
This module implements the standard MCP specification.
In-memory transport for testing purposes.
Transport abstraction layer with fallback mechanisms.
Type definitions for the Model Context Protocol.
Type definitions for MCP protocol version 2024-11-05.
Type definitions for MCP protocol version 2025-03-26.
Type definitions for MCP protocol version 2025-06-18.
Type definitions for MCP protocol version 2025-11-25.
Type definitions for MCP protocol version 2026-07-28.
Validates MCP tool names according to the 2025-11-25 specification.