# `Urchin.Endpoint`
[🔗](https://github.com/urth-inc/urchin/blob/v0.4.0/lib/urchin/endpoint.ex#L1)

A standalone HTTP endpoint that serves an MCP server with Bandit.

This is both a `Plug` (routing the configured path to
`Urchin.Transport.StreamableHTTP`) and a supervisable process.

    children = [{Urchin.Endpoint, server: MyServer, port: 4000, path: "/mcp"}]

or, for a quick start, `Urchin.start_link/2`.

## Options

  * `:server` (required) - the `Urchin.Server` module
  * `:port` - listen port (default `4000`)
  * `:ip` - listen address (default `{127, 0, 0, 1}`; bind localhost only)
  * `:path` - the MCP endpoint path (default `"/mcp"`)
  * `:scheme` - `:http` or `:https` (default `:http`)

Remaining options are forwarded to `Urchin.Transport.StreamableHTTP`. Requires the
optional `:bandit` dependency.

When the forwarded `:auth` option is set, this endpoint also serves the OAuth 2.1
Protected Resource Metadata document (RFC 9728) at its well-known URI, so MCP clients
can discover the authorization server. See `Urchin.Auth`.

# `start_link`

```elixir
@spec start_link(keyword()) :: {:ok, pid()} | {:error, term()}
```

Starts the endpoint linked to the calling process.

---

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