---
title: McpOptions
description: The options of an `mcp` Effect.
---

# `McpOptions`

Type, in `@jr2/orchestrator/src/mcp-effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.

```ts
type McpOptions<S extends z.ZodObject | undefined = undefined> = {
  input?: S;
  timeout?: Duration;
  maxBody?: number;
  idempotent?: boolean;
};
```

The options of an `mcp` Effect.

**Fields**

- `input` (optional): `S`

  The zod schema of the input of the Effect: what the `input` of the `invoke`, or `fromPick`,
  gives it. For `mcp.call` the parsed input is the tool's arguments; for `mcp.prompt`, the
  prompt's arguments, each a string. jr2 parses the input with it before the call. When it
  starts, input that does not agree with it makes the Effect fail (its `onError` route): `mcp
  "<slot>": its input does not match the definition's input schema — <path>: <message>`. With no
  schema, the input of the `invoke` is the arguments as it is, and `{}` when it has none.
- `timeout` (optional): [`Duration`](type-duration.md)

  How long jr2 waits for the answer: a number and a unit, such as `"30s"` or `"2m"`. Default:
  the server's `timeout` in `jr2.config.ts` (60 seconds when it sets none). With no answer in
  that time, the output is `unknown`. It refuses a value that is not a positive duration: `mcp:
  timeout "<timeout>" is not a positive duration (like "30s", "2m")`.
- `maxBody` (optional): `number`

  The largest number of bytes of `text`, and of `structured` as JSON, that the output keeps.
  Default 65536. Past it, jr2 cuts `text`, drops `structured`, and sets `truncated`. It refuses
  a value that is not a positive whole number: `mcp({ maxBody }): a positive number of bytes`.
- `idempotent` (optional): `boolean`

  `true` when it is safe to send the request two times: the tool only reads, or it has its own
  idempotency key. Default `false`. After an Orchestrator restart, jr2 cannot always tell if the
  request went out. Then it sends an idempotent one again, and gives any other the output
  `unknown`. jr2 does not read the tool's `idempotentHint`.
