# Server configuration

> How a FrontMCP server is put together and configured: apps and their endpoints, configuration files and environment variables, the MCP revisions it speaks, background tasks, logging, tracing and metrics, apps loaded from npm or another MCP server, and the flows every request runs through.

Source: https://frontmcp.dev/reference/server

This section covers the server as a whole, across decorators: how apps combine into one server and what clients discover, where settings come from and which one wins, what the server logs and how to watch it run, how to serve tools from an npm package or from another MCP server, which MCP revisions clients can speak to it and how slow tools run as background tasks, and the flows every request runs through, which hooks attach to. It's for you once a server has more than one app, or is about to run somewhere other than your machine. Each option is also listed on [`@FrontMcp`](https://frontmcp.dev/reference/sdk/frontmcp) or [`@App`](https://frontmcp.dev/reference/sdk/app); these pages show how they work together. Start with [Apps, discovery and splitting](https://frontmcp.dev/reference/server/apps).

```ts
@FrontMcp({
  info,
  apps: [HelpDeskApp, App.esm(specifier, options?), App.remote(url, options?)], // your apps, a package's, another server's
  splitByApp?, logging?, observability?, metrics?, health?,
  tasks?, transport?: { defaultProtocolVersion? },                             // background tasks; requests that name no MCP revision
  plugins: [ConfigPlugin.init({ schema, loadYaml: true })],                     // your own settings, as this.config
})
```

---

## Composing a server

| Page | Covers |
| --- | --- |
| [Apps, discovery and splitting](https://frontmcp.dev/reference/server/apps) | How a server is built from apps, what clients see and discover, what happens when two apps use the same name, and how `standalone` and `splitByApp` give apps endpoints and auth of their own |
| [Loading apps from npm (ESM)](https://frontmcp.dev/reference/server/esm) | `App.esm()`: a package's tools, resources and prompts, loaded from npm when the server starts and run in your server's process |
| [Remote servers](https://frontmcp.dev/reference/server/remote) | `App.remote()`: another MCP server mounted as an app, so its tools, resources and prompts appear on your server and calls are forwarded to it |

## Settings and environment

| Page | Covers |
| --- | --- |
| [Configuration files](https://frontmcp.dev/reference/server/config-files) | Every place a server takes settings from: the `@FrontMcp` options, the environment variables FrontMCP reads, `.env` and YAML files through `ConfigPlugin`, and the `frontmcp.config` file the CLI reads, and which one wins |
| [Environment awareness](https://frontmcp.dev/reference/server/environment) | `availableWhen`, which offers a tool, resource or prompt only on some runtimes, platforms or deployments, and `this.runtimeContext`, which branches on where the server runs |

## Talking to clients

| Page | Covers |
| --- | --- |
| [Protocol versions](https://frontmcp.dev/reference/server/protocol-versions) | The MCP revisions the server speaks on one endpoint, from 2024-11-05 to 2026-07-28, how it picks one for each request, and what 2026-07-28 changed |
| [Background tasks](https://frontmcp.dev/reference/server/tasks) | Slow tools that run as MCP tasks: the client gets a task id at once, polls it for the result, answers the tool's questions, and can cancel it |

## Watching it run

| Page | Covers |
| --- | --- |
| [Logging](https://frontmcp.dev/reference/server/logging) | The server's own log: levels, where lines go, custom transports, request tags, and the line that matches an error ID |
| [Observability and telemetry](https://frontmcp.dev/reference/server/observability) | OpenTelemetry traces for every request, your own spans and counters, `/metrics`, and health checks |

## Inside a request

| Page | Covers |
| --- | --- |
| [Flows and stages](https://frontmcp.dev/reference/server/flows) | The named flows every request runs through, each a fixed plan of stages, the state each stage sets, how flows nest in one request, and how to write your own |

## Which page for which task

| You want to | Read |
| --- | --- |
| Split one product into areas, like tickets and billing | [Composition patterns](https://frontmcp.dev/reference/server/apps#composition-patterns) |
| Fix two apps that use the same tool name | [Handling name clashes](https://frontmcp.dev/reference/server/apps#handling-name-clashes) |
| Give one app its own URL and its own auth | [Giving an app its own endpoint](https://frontmcp.dev/reference/server/apps#giving-an-app-its-own-endpoint) |
| Serve another MCP server's tools next to your own | [Mounting a remote server](https://frontmcp.dev/reference/server/remote#mounting-a-remote-server) |
| Add tools that a team published to npm | [Loading a package](https://frontmcp.dev/reference/server/esm#loading-a-package) |
| Give the server settings of your own, read with `this.config` | [Reading your own settings](https://frontmcp.dev/reference/server/config-files#reading-your-own-settings) |
| Keep those settings' defaults in a YAML file | [Keeping defaults in a YAML file](https://frontmcp.dev/reference/server/config-files#keeping-defaults-in-a-yaml-file) |
| Look up an environment variable FrontMCP reads | [Environment variables](https://frontmcp.dev/reference/server/config-files#environment-variables) |
| See which MCP revisions the server speaks | [Asking which revisions a server speaks](https://frontmcp.dev/reference/server/protocol-versions#asking-which-revisions-a-server-speaks) |
| Serve clients that send plain JSON-RPC, with no protocol version | [Serving requests that name no revision](https://frontmcp.dev/reference/server/protocol-versions#serving-requests-that-name-no-revision) |
| Let a slow tool answer at once and finish in the background | [Letting a tool run as a task](https://frontmcp.dev/reference/server/tasks#letting-a-tool-run-as-a-task) |
| Offer a tool only on Node, or only in production | [Offering a tool only where it works](https://frontmcp.dev/reference/server/environment#offering-a-tool-only-where-it-works) |
| Find the log line for an error ID a user reported | [Finding the line for an error ID](https://frontmcp.dev/reference/server/logging#finding-the-line-for-an-error-id) |
| Send the log somewhere other than the console | [Writing a transport](https://frontmcp.dev/reference/server/logging#writing-a-transport) |
| Follow a request across services with OpenTelemetry | [Following a request across services](https://frontmcp.dev/reference/server/observability#following-a-request-across-services) |
| Count things and serve them to Prometheus | [Counting things](https://frontmcp.dev/reference/server/observability#counting-things) |
| Pick the stage a hook should attach to | [Stages of the request flows](https://frontmcp.dev/reference/server/flows#stages-of-the-request-flows) |

## Related pages

- [`@FrontMcp`](https://frontmcp.dev/reference/sdk/frontmcp) and [`@App`](https://frontmcp.dev/reference/sdk/app): every option of the server and of an app.
- [Hook decorators](https://frontmcp.dev/reference/sdk/hooks): running code before, after or around a stage of a flow.
- [Health checks and metrics](https://frontmcp.dev/reference/deployment/health-and-metrics): wiring `/healthz`, `/readyz` and `/metrics` into a deployment.
- [frontmcp CLI](https://frontmcp.dev/reference/cli): the commands that read `frontmcp.config`.
- Learn: [Grouping Capabilities into Apps](https://frontmcp.dev/learn/grouping-capabilities-into-apps) and [Structuring a Server](https://frontmcp.dev/learn/structuring-a-server).
