> ## Documentation Index
> Fetch the complete documentation index at: https://fastmcp-ts.docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CustomRouteHandler

```ts theme={null}
type CustomRouteHandler = (request) => Response | Promise<Response>;
```

Defined in: [server/customRoutes.ts:10](https://github.com/PrefectHQ/fastmcp-ts/blob/main/src/server/customRoutes.ts#L10)

Handler for a custom HTTP route served by the listener `run()` starts.
Owns the whole exchange: no MCP auth, no DNS-rebinding guards, and no CORS
headers run in front of it, and its Response is written back verbatim.

## Parameters

### request

`Request`

## Returns

`Response` | `Promise`\<`Response`>
