# `mix ash_ai.gen.mcp`
[🔗](https://github.com/ash-project/ash_ai/blob/v0.6.1/lib/mix/tasks/ash_ai.gen.mcp.ex#L43)

Sets up an MCP server for your application

Adds an MCP server to your router.
Sets up Api Key authentication if
- `--no-api-key` is not provided
- `AshAuthentication` is available.
- The user module is defined

## Example

```bash
mix ash_ai.gen.mcp --api-key
```

## Options

## Flags

* `--no-api-key` - Skip setting up api key authentication and adding it to the MCP server.
* `--user` - The user to add api key auth to, if setting it up.

---

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