# `MCPKit.Router`
[🔗](https://github.com/mcostasilva/mcp_kit/blob/v0.2.4/lib/mcp_kit/router.ex#L1)

Phoenix router DSL for mounting an MCP endpoint and declaring exposed tools,
prompts, and resources.

Typical usage:

    mcp_scope "/mcp", MyApp.MCP do
      tool "project_create", Tools.ProjectCreate
      tool "project_status", Tools.ProjectStatus
      prompt "draft_release_notes", Prompts.DraftReleaseNotes
      resource "project", Resources.Project
    end

The second argument behaves like a regular Phoenix `scope` alias. Given the
example above, `Tools.ProjectCreate` resolves to `MyApp.MCP.Tools.ProjectCreate`.

`mcp_scope/2` and `mcp_scope/3` generate the underlying route automatically,
so the host router does not need a separate MCP pipeline or `forward` call.

Runtime state is handled by a host-started `MCPKit.Runtime` child. The router
infers its name from the definition module unless overridden with `runtime:`.

`resource/2` mounts MCP resources for the scope.

# `mcp_scope`
*macro* 

Mounts an MCP endpoint under the given router path.

The second argument may be either a scope alias or router options. When a
scope alias is given, `mcp_scope/2` infers a sibling `Definition` module and
runtime name from that scope.

Inside the block you may declare `tool/2`, `prompt/2`, and `resource/2`
entries.

# `mcp_scope`
*macro* 

Mounts an MCP endpoint under the given router path with an explicit scope alias
and options.

Supports `definition:` to override the inferred `Definition` module and
`runtime:` to override the inferred runtime name.

# `prompt`
*macro* 

Declares a prompt inside `mcp_scope`.

The prompt name is exposed over MCP and the module must implement
`MCPKit.Prompt`.

# `resource`
*macro* 

Declares a resource inside `mcp_scope`.

The resource name is used for policy and completion routing, and the module
must implement `MCPKit.Resource`.

# `tool`
*macro* 

Declares a tool inside `mcp_scope`.

The tool name is exposed over MCP and the module must implement
`MCPKit.Tool`.

---

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