# `Excessibility.MCP.Registry`
[🔗](https://github.com/lessthanseventy/excessibility/blob/v0.18.1/lib/excessibility/mcp/registry.ex#L1)

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")

# `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`

Finds a prompt by name.

Returns nil if not found.

# `get_resource`

Finds a resource by name.

Returns nil if not found.

# `get_resource_for_uri`

Finds a resource that can handle the given URI.

Returns nil if no matching resource found.

# `get_tool`

Finds a tool by name.

Returns nil if not found.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
