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

# MCP headers reference

> Request headers of the Sendforsign MCP server: authentication, default client and tenant, agent identity, on-behalf-of principal, agent mode and recipient domain allowlist.

Connections authenticated with an **API key** (or a client token) are configured with HTTP headers. Every MCP
request carries them, and the server enforces them on every tool call. They are set by whoever configures the
connection (you, your backend) and **cannot be changed by the agent** through tool arguments.

> [!NOTE]
>
> **OAuth connections ignore these headers.** When an AI app connects by
> [signing in with Sendforsign](https://about.sendforsign.com/ai-agents/mcp-quickstart.md#connect-an-ai-app), the grant the user approved on the
> consent screen is the source of truth: account, user (tenant) if one was picked, mode (drafts only by default) and
> allowed domains.
> Headers such as `X-Sendforsign-Client-Key`, `X-Sendforsign-User-Key`, `X-Sendforsign-Agent-Mode`,
> `X-Sendforsign-Allowed-Domains` and `X-Sendforsign-On-Behalf-Of` have no effect there, so an app cannot change the
> approved account, user, mode or allowed domains. `X-Sendforsign-Agent`, if sent, is only appended to the app's name in the
> [audit log](https://about.sendforsign.com/ai-agents/accountability.md#audit-log). Header authentication works as described below.

| Header | Required | Meaning |
| - | - | - |
| `X-Sendforsign-Key` | one of the two | Your API key, as in the [REST API](https://about.sendforsign.com/api-reference/introapi.md). |
| `Authorization: Bearer <client token>` | one of the two | A [client token](https://about.sendforsign.com/api-reference/implementation_server.md#generate-client-tokens) instead of the API key. The client comes from the token. (OAuth access tokens also travel in this header; then the grant applies, not the headers below.) |
| `X-Sendforsign-Client-Key` | with the API key | The `clientKey` every tool works in. Required with `X-Sendforsign-Key`. |
| `X-Sendforsign-User-Key` | no | Default `userKey`: the tenant or end user whose templates and contracts the agent sees. Tools also accept a `userKey` argument that overrides it per call. |
| `X-Sendforsign-Agent` | no | A name or ID for this agent, written to the [audit log](https://about.sendforsign.com/ai-agents/accountability.md#audit-log). Defaults to the client's `User-Agent`. |
| `X-Sendforsign-On-Behalf-Of` | no | The principal the agent acts for: an email or ID of a person or company. Written to the audit log. |
| `X-Sendforsign-Agent-Mode` | no | `read_only`, `draft` or `send`. Default: `send`. See [agent modes](https://about.sendforsign.com/ai-agents/accountability.md#agent-modes). |
| `X-Sendforsign-Allowed-Domains` | no | Comma-separated allowlist of recipient email domains, e.g. `customer.com,partner.org`. Empty means any domain. |

## Examples

A production agent in a multi-tenant product, acting for one of your customers' employees, allowed to prepare and
send contracts only to that customer's domain and its client's domain:

```bash theme={null}
X-Sendforsign-Key: YOUR_API_KEY
X-Sendforsign-Client-Key: CLIENT_KEY_OF_THIS_CUSTOMER
X-Sendforsign-User-Key: USER_KEY_OF_THIS_EMPLOYEE
X-Sendforsign-Agent: acme-crm-assistant/2.3
X-Sendforsign-On-Behalf-Of: jane.doe@customer.com
X-Sendforsign-Agent-Mode: send
X-Sendforsign-Allowed-Domains: customer.com,client-of-customer.com
```

A research or reporting agent that must never change anything:

```bash theme={null}
X-Sendforsign-Key: YOUR_API_KEY
X-Sendforsign-Client-Key: YOUR_CLIENT_KEY
X-Sendforsign-Agent: weekly-status-report
X-Sendforsign-Agent-Mode: read_only
```

## Notes

* Header names are case-insensitive. Values for the mode are case-insensitive too (`DRAFT`, `read-only` and
  `read_only` all work); an unknown value falls back to `send`, so spell it carefully when you mean to restrict.
* For an allowlist, a leading `@` is ignored (`@customer.com` = `customer.com`), and subdomains are not
  included: list `eu.customer.com` separately if needed.
* Call the [`get_connection_info`](https://about.sendforsign.com/ai-agents/tools#get_connection_info) tool to see how the server read your
  headers.
* The REST API ignores these MCP headers. Use [userKey](https://about.sendforsign.com/api-reference/user/create.md) and `clientKey` in the request
  body there.


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