Excessibility.MCP.Registry (Excessibility v0.14.0)

View Source

Auto-discovers MCP tools, resources, and prompts at compile time.

Built-in modules are discovered from:

  • lib/excessibility/mcp/tools/ - Tool modules
  • lib/excessibility/mcp/resources/ - Resource modules
  • lib/excessibility/mcp/prompts/ - Prompt modules

Custom Plugins

Users can register custom modules via application config:

# config/test.exs
config :excessibility,
  custom_mcp_tools: [MyApp.MCP.Tools.Custom],
  custom_mcp_resources: [MyApp.MCP.Resources.Custom],
  custom_mcp_prompts: [MyApp.MCP.Prompts.Custom]

Custom modules must implement the appropriate behaviour.

Usage

# Get all tools (built-in + custom)
Registry.discover_tools()

# Get tool by name
Registry.get_tool("e11y_check")

# Get all resources
Registry.discover_resources()

# Find resource for URI
Registry.get_resource_for_uri("snapshot://test.html")

Summary

Functions

Returns all registered prompts (built-in + custom).

Returns all registered resources (built-in + custom).

Returns all registered tools (built-in + custom).

Finds a prompt by name.

Finds a resource by name.

Finds a resource that can handle the given URI.

Finds a tool by name.

Functions

discover_prompts()

Returns all registered prompts (built-in + custom).

Custom prompts can be configured via :custom_mcp_prompts in app config.

discover_resources()

Returns all registered resources (built-in + custom).

Custom resources can be configured via :custom_mcp_resources in app config.

discover_tools()

Returns all registered tools (built-in + custom).

Custom tools can be configured via :custom_mcp_tools in app config.

get_prompt(name)

Finds a prompt by name.

Returns nil if not found.

get_resource(name)

Finds a resource by name.

Returns nil if not found.

get_resource_for_uri(uri)

Finds a resource that can handle the given URI.

Returns nil if no matching resource found.

get_tool(name)

Finds a tool by name.

Returns nil if not found.