> ## Documentation Index
> Fetch the complete documentation index at: https://milford.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Milford with npm or pnpm, or run it with Docker.

Milford ships as npm packages under the `@milfordai` scope and as Docker images. Pick the server to run flows over HTTP, the MCP server to expose flows as tools, or the libraries to embed the engine in your own app.

## Requirements

* Node.js 22 or later. Every package declares this in `engines`.
* npm or pnpm.
* Docker, if you run the images.

## Packages

| Package | Install it to | Provides |
| - | - | - |
| `@milfordai/server` | Run flows over HTTP. Includes Slack, Telegram and webhook channels. | the `milford-server` command |
| `@milfordai/mcp` | Expose flows as tools to LLM clients, and call other MCP servers. | the `milford-mcp` command |
| `@milfordai/core` | Embed the engine in a TypeScript app. | flows, nodes and the provider port. No I/O. |
| `@milfordai/providers` | Add OpenAI-compatible servers, Anthropic, Jev and generic HTTP providers to the library. | provider adapters |
| `@milfordai/config` | Load a config file yourself. | the config loader and the JSON Schema |
| `@milfordai/channels` | Use the Slack, Telegram and webhook adapters directly. | channel adapters |

The server and MCP packages already depend on the others, so installing one of them is enough to run Milford. All packages are released together. Keep every `@milfordai/*` dependency on the same version.

## Run a server

Run the server without installing anything:

<CodeGroup>
  ```bash npm theme={null}
  npx @milfordai/server milford.config.yaml
  ```

  ```bash pnpm theme={null}
  pnpm dlx @milfordai/server milford.config.yaml
  ```
</CodeGroup>

Run the MCP server the same way with `@milfordai/mcp`.

To add the server to a project, install it and run the command it provides:

<CodeGroup>
  ```bash npm theme={null}
  npm install @milfordai/server
  npx milford-server milford.config.yaml
  ```

  ```bash pnpm theme={null}
  pnpm add @milfordai/server
  pnpm exec milford-server milford.config.yaml
  ```
</CodeGroup>

To put `milford-server` and `milford-mcp` on your `PATH`, install the packages globally:

<CodeGroup>
  ```bash npm theme={null}
  npm install --global @milfordai/server @milfordai/mcp
  ```

  ```bash pnpm theme={null}
  pnpm add --global @milfordai/server @milfordai/mcp
  ```
</CodeGroup>

The commands read the config file you pass, or the path in `MILFORD_CONFIG`, or `milford.config.yaml` in the current directory. See the [configuration reference](/reference/config).

## Use the library

<CodeGroup>
  ```bash npm theme={null}
  npm install @milfordai/core @milfordai/providers
  ```

  ```bash pnpm theme={null}
  pnpm add @milfordai/core @milfordai/providers
  ```
</CodeGroup>

The packages are ES modules and ship their own type declarations, so use `import` and no extra `@types` package.

```ts theme={null}
import { createEngine, defaultRegistry, flow } from "@milfordai/core";
import { registerProviders } from "@milfordai/providers";
```

The [quickstart](/quickstart) has a complete example.

## Editor completion for the config file

`@milfordai/config` ships the JSON Schema of the config file. After you install it, point your editor's YAML language server at it with the first line of `milford.config.yaml`:

```yaml theme={null}
# yaml-language-server: $schema=./node_modules/@milfordai/config/milford.config.schema.json
```

## Docker

| Image | Runs |
| - | - |
| `ghcr.io/milfordai/milford` | The HTTP server |
| `ghcr.io/milfordai/milford-mcp` | The MCP server. It needs `mcp.transport: http` in the config. |

Tags are the release version, such as `0.0.3`, and `latest`. Mount a directory with `milford.config.yaml` at `/config`, and pass the variables your config uses:

```bash theme={null}
docker run -p 8080:8080 \
  -e MILFORD_TOKEN=change-me \
  -v "$PWD:/config:ro" \
  ghcr.io/milfordai/milford:latest
```

Images are built for `linux/amd64` and `linux/arm64`. See [deployment](/reference/deployment).

## Next steps

<Columns cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">Run your first flow.</Card>
  <Card title="Configuration" icon="settings" href="/reference/config">Every key of the config file.</Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.