raxol_mcp is an Elixir package under the packages directory of the raxol repository, positioned as an MCP (Model Context Protocol) server and client implementation in the Elixir ecosystem.
Purpose The package is used to integrate MCP into Elixir applications: it can act as an MCP server, exposing tools, resources, and prompts externally via JSON-RPC 2.0; it can also act as an MCP client, consuming external MCP servers.
Main capabilities
- MCP Server: routes tool and resource requests with a GenServer, dispatching based on JSON-RPC 2.0.
- MCP Client: a stdio JSON-RPC 2.0 client for connecting to external MCP servers.
- Registry: an ETS-based registry for tools, resources, and prompts, which the materials state avoids GenServer bottlenecks.
- Transports: supports stdio (for CLI tools) and Plug-based HTTP/SSE (without depending on Phoenix).
- ToolProvider: automatically derives MCP tools from the widget tree; the materials state that 16 Component modules implement this behavior.
- FocusLens: attention-aware tool filtering, providing three modes: focused, all, and hover.
- ResourceProvider: exposes TEA model state as MCP resources.
- Test Harness: provides a pipeline-style API (click, type_into, assert_component) and includes functor law property tests.
- Circuit Breaker: a three-state ETS state machine for handling unstable tool callbacks.
Usage The materials list the following modules and responsibilities: Raxol.MCP.Server (GenServer handling JSON-RPC dispatch), Raxol.MCP.Registry (ETS registration), Raxol.MCP.Protocol (JSON-RPC 2.0 encoding/decoding), Raxol.MCP.Transport.Stdio (stdio transport), Raxol.MCP.Transport.SSE (HTTP/SSE transport), Raxol.MCP.Client (consuming external MCP servers), Raxol.MCP.ToolProvider (widget-to-tool derivation behavior), Raxol.MCP.Test (testing utilities with assertions). Specific installation commands, configuration steps, and complete examples are not provided in the materials and should be found in the main documentation.
Applicable scenarios Suitable for developers who need to implement or integrate an MCP server/client in Elixir projects, especially those who want to automatically generate agent tools from the UI widget tree, expose MCP capabilities via stdio or HTTP/SSE, or simulate component interactions in tests.
Limitations The materials do not provide version requirements, dependency descriptions, installation commands, license, performance data, or complete usage examples; some capabilities (such as the specific behavior of FocusLens and circuit breaker parameters) are only given by name and brief description, with details not yet provided.