> ## 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 quickstart

> Connect Claude, ChatGPT, Claude Code, Cursor, VS Code or any MCP client to the Sendforsign remote MCP server: paste the URL, sign in, choose the account and what the agent may do.

The Sendforsign MCP server is a remote server over **Streamable HTTP**:

```bash theme={null}
https://api.sendforsign.com/mcp
```

There are two ways to connect:

* **Sign in with Sendforsign (OAuth)** — for AI apps people use: Claude, ChatGPT, Claude Code, Cursor, VS Code. Paste
  the URL, sign in, and choose on the consent screen which account the app may use and what it may do. No API key is
  copied anywhere.
* **API key in headers** — for [server-side agents](#server-side-agents-api-key) you run yourself, where your code
  sets the account and the guardrails per connection.

## Connect an AI app

Every client below follows the same three steps:

1. Add the server URL `https://api.sendforsign.com/mcp`.
2. Sign in to Sendforsign in the browser window that opens (or create an account).
3. On the consent screen, choose:
   * **Account** — the client (`clientKey`) the app works in, and optionally a **user** (tenant) inside it. If you pick
     a user, the connector can only act as that user and cannot list or create users. Without one, it works at the
     account level and can address any user of the account.
   * **What the agent may do** — *read only*, *create drafts* (the default) or *send for signature*. Even with
     *send*, every email still needs your explicit approval in the chat (`confirm: true`).
   * **Allowed recipient domains** (optional) — the app cannot send contracts to anyone outside them.

You can change these later only by disconnecting and connecting again. See
[modes and accountability](https://about.sendforsign.com/ai-agents/accountability.md) for what each choice means.

> [tab] Claude
>
> In Claude on the web or desktop:
>
> 1. Open **Settings → Connectors → Add custom connector**.
> 2. Name it `Sendforsign` and paste `https://api.sendforsign.com/mcp`.
> 3. Click **Connect**, sign in to Sendforsign and approve the consent screen.
>
> In a chat, enable Sendforsign from the tools menu. On Team and Enterprise plans, an owner may have to add the
> connector for the organization first.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http sendforsign https://api.sendforsign.com/mcp
> ```
>
> Then run `/mcp` inside Claude Code, select **sendforsign** and choose **Authenticate**. Your browser opens the
> Sendforsign sign-in and consent screen.
>
> Add `--scope project` to share the server with your team through `.mcp.json`; each person signs in with their
> own account. Install the [Sendforsign skill](https://about.sendforsign.com/ai-agents/skills.md) too, so Claude knows the recipes and pitfalls.

> [tab] Cursor
>
> [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=sendforsign\&config=eyJ1cmwiOiJodHRwczovL2FwaS5zZW5kZm9yc2lnbi5jb20vbWNwIn0%3D)
> (opens Cursor and asks to install the server).
>
> Or add it by hand to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):
>
> ```json mcp.json theme={null}
> {
>   "mcpServers": {
>     "sendforsign": {
>       "url": "https://api.sendforsign.com/mcp"
>     }
>   }
> }
> ```
>
> In **Cursor Settings → MCP**, click **Login** (or **Needs login**) next to sendforsign to sign in.

> [tab] VS Code
>
> [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22sendforsign%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.sendforsign.com%2Fmcp%22%7D)
> (opens VS Code and asks to install the server).
>
> Or add it by hand to `.vscode/mcp.json` in your workspace, or with **MCP: Add Server** in the Command Palette:
>
> ```json .vscode/mcp.json theme={null}
> {
>   "servers": {
>     "sendforsign": {
>       "type": "http",
>       "url": "https://api.sendforsign.com/mcp"
>     }
>   }
> }
> ```
>
> Start the server from the file or the MCP view; VS Code asks you to sign in to Sendforsign. Use the tools from
> Copilot Chat in agent mode.

> [tab] ChatGPT
>
> Custom connectors in ChatGPT need **developer mode**, available on some plans and possibly limited by your
> workspace admin. Menu names change between ChatGPT releases.
>
> 1. In **Settings → Apps & Connectors → Advanced settings**, turn on **Developer mode**.
> 2. Create a connector: name `Sendforsign`, MCP server URL `https://api.sendforsign.com/mcp`, authentication
>    **OAuth**.
> 3. Sign in to Sendforsign and approve the consent screen.
>
> In a chat, pick the connector from the tools menu. ChatGPT asks before it runs tools that change data.

> [tab] Any OAuth client
>
> The server implements the MCP authorization spec: **OAuth 2.1** with **dynamic client registration** (RFC 7591)
> and **PKCE** (S256). A compliant MCP client needs only the URL.
>
> | Step | Endpoint |
> | - | - |
> | Unauthenticated `POST /mcp` | `401` with `WWW-Authenticate: Bearer resource_metadata="…"` |
> | Protected resource metadata | `https://api.sendforsign.com/.well-known/oauth-protected-resource/mcp` |
> | Authorization server metadata | `https://api.sendforsign.com/.well-known/oauth-authorization-server` (issuer `https://api.sendforsign.com/`) |
> | Registration, authorization, token, revocation | Listed in the metadata (`/register`, `/authorize`, `/token`, `/revoke`) |
>
> Details:
>
> * One scope: `contracts`. What the agent may do is set by the mode chosen on the consent screen, not by scopes.
> * Send the `resource` parameter (`https://api.sendforsign.com/mcp`) in the authorization and token requests.
> * Access tokens last 1 hour. Refresh tokens last 90 days and **rotate on every use**; reusing an old refresh token
>   or an authorization code revokes the whole connection.
> * The OpenAI Agents SDK and other SDKs connect the same way when given an OAuth provider; for an agent that runs
>   on your servers without a person signing in, use an [API key](#server-side-agents-api-key) instead.

## Try it

Ask the agent:

> What can you do with Sendforsign on this connection?

It calls [`get_connection_info`](https://about.sendforsign.com/ai-agents/tools#get_connection_info) and tells you its mode, account and allowed
domains. Then:

> List my templates. Draft an NDA from the NDA template for Acme Ltd, signer Anna Smith, [anna@example.com](mailto:anna@example.com).
> Show me what you filled in and the signing link. Don't send it yet.

The agent uses `list_templates` → `get_template` → `create_contract`, returns a draft with a `signingUrl` and lists
the fields left for the counterparty. Nobody is emailed until you approve and the agent calls `send_for_signature`
with `confirm: true` on a connection allowed to send. More in the [prompt library](https://about.sendforsign.com/ai-agents/prompts.md).

## Server-side agents (API key)

For agents that run in your backend (your own product's assistant, a workflow, a scheduled job), authenticate with
your API key and configure each connection with [headers](https://about.sendforsign.com/ai-agents/headers.md). Your code, not a consent screen,
decides the account, tenant, mode and allowed domains, so you can open one connection per customer of your product.

### Get your keys

1. Sign up at [app.sendforsign.com](https://app.sendforsign.com) and open the **API Keys** tab of the dashboard.
2. Copy your **API key** (`X-Sendforsign-Key`).
3. Copy a **client key** (`clientKey`) — the account space the agent works in. If you embed Sendforsign for several
   customers, [create a client](https://about.sendforsign.com/api-reference/client/create.md) per customer and use its key.

> [!WARNING]
>
> An API key gives full access to your account. Keep it out of prompts, repositories and chat transcripts; put it in
> environment variables or a secret store. Start new integrations with `X-Sendforsign-Agent-Mode: draft` so the agent
> cannot email anyone until you are ready.

| Header | Value |
| - | - |
| `X-Sendforsign-Key` | Your API key |
| `X-Sendforsign-Client-Key` | Your client key |

Recommended on top: `X-Sendforsign-Agent` (a name for this agent), `X-Sendforsign-On-Behalf-Of` (the person or
company it acts for), `X-Sendforsign-Agent-Mode` and `X-Sendforsign-Allowed-Domains`. Note that the header default
mode is `send`, unlike the consent screen. See the [headers reference](https://about.sendforsign.com/ai-agents/headers.md).

> [tab] OpenAI Agents SDK
>
> ```python agent.py theme={null}
> import asyncio, os
> from agents import Agent, Runner
> from agents.mcp import MCPServerStreamableHttp
>
> async def main():
>     async with MCPServerStreamableHttp(
>         name="sendforsign",
>         params={
>             "url": "https://api.sendforsign.com/mcp",
>             "headers": {
>                 "X-Sendforsign-Key": os.environ["SENDFORSIGN_API_KEY"],
>                 "X-Sendforsign-Client-Key": os.environ["SENDFORSIGN_CLIENT_KEY"],
>                 "X-Sendforsign-Agent": "contracts-agent",
>                 "X-Sendforsign-On-Behalf-Of": "jane@customer.com",
>                 "X-Sendforsign-Agent-Mode": "draft",
>             },
>         },
>         cache_tools_list=True,
>     ) as sfs:
>         agent = Agent(
>             name="Contracts",
>             instructions="Prepare contracts from templates. Never send without the user's approval.",
>             mcp_servers=[sfs],
>         )
>         result = await Runner.run(agent, "List my templates and draft an NDA for Acme Ltd.")
>         print(result.final_output)
>
> asyncio.run(main())
> ```
>
> With the **Responses API** hosted MCP tool, pass the same headers and keep approvals on:
>
> ```json theme={null}
> {
>   "type": "mcp",
>   "server_label": "sendforsign",
>   "server_url": "https://api.sendforsign.com/mcp",
>   "headers": {
>     "X-Sendforsign-Key": "YOUR_API_KEY",
>     "X-Sendforsign-Client-Key": "YOUR_CLIENT_KEY",
>     "X-Sendforsign-Agent-Mode": "draft"
>   },
>   "require_approval": "always"
> }
> ```

> [tab] Claude API
>
> The Messages API MCP connector sends a single bearer token, so authenticate with a
> [client token](https://about.sendforsign.com/api-reference/implementation_server.md#generate-client-tokens) instead of the API key. The client
> is taken from the token, so no client key header is needed. Client tokens expire (see `expires_in`); mint a new
> one per conversation from your backend.
>
> ```bash cURL theme={null}
> curl https://api.anthropic.com/v1/messages \
>   -H "x-api-key: $ANTHROPIC_API_KEY" \
>   -H "anthropic-version: 2023-06-01" \
>   -H "anthropic-beta: mcp-client-2025-11-20" \
>   -H "content-type: application/json" \
>   -d '{
>     "model": "claude-opus-5-5",
>     "max_tokens": 16000,
>     "mcp_servers": [{
>       "type": "url",
>       "url": "https://api.sendforsign.com/mcp",
>       "name": "sendforsign",
>       "authorization_token": "SENDFORSIGN_CLIENT_TOKEN"
>     }],
>     "tools": [{ "type": "mcp_toolset", "mcp_server_name": "sendforsign" }],
>     "messages": [{ "role": "user", "content": "Which of my contracts are still waiting for a signature?" }]
>   }'
> ```
>
> Guardrail headers cannot be set through this connector, so the server runs in the default `send` mode; tools that
> email people still require `confirm: true`. Prefer a connection with headers when the agent acts without a human
> in the loop.

> [tab] Claude Code / Cursor with a key
>
> For a shared service account or CI, where nobody signs in:
>
> ```bash theme={null}
> claude mcp add --transport http sendforsign https://api.sendforsign.com/mcp \
>   --header "X-Sendforsign-Key: $SENDFORSIGN_API_KEY" \
>   --header "X-Sendforsign-Client-Key: $SENDFORSIGN_CLIENT_KEY" \
>   --header "X-Sendforsign-Agent: claude-code" \
>   --header "X-Sendforsign-Agent-Mode: draft"
> ```
>
> In Cursor's `mcp.json`, add a `headers` object next to `url`, reading secrets from the environment:
>
> ```json mcp.json theme={null}
> {
>   "mcpServers": {
>     "sendforsign": {
>       "url": "https://api.sendforsign.com/mcp",
>       "headers": {
>         "X-Sendforsign-Key": "${env:SENDFORSIGN_API_KEY}",
>         "X-Sendforsign-Client-Key": "${env:SENDFORSIGN_CLIENT_KEY}",
>         "X-Sendforsign-Agent-Mode": "draft"
>       }
>     }
>   }
> }
> ```

> [tab] Generic JSON and cURL
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "sendforsign": {
>       "type": "http",
>       "url": "https://api.sendforsign.com/mcp",
>       "headers": {
>         "X-Sendforsign-Key": "YOUR_API_KEY",
>         "X-Sendforsign-Client-Key": "YOUR_CLIENT_KEY",
>         "X-Sendforsign-User-Key": "OPTIONAL_TENANT_USER_KEY",
>         "X-Sendforsign-Agent": "my-agent",
>         "X-Sendforsign-On-Behalf-Of": "jane@customer.com",
>         "X-Sendforsign-Agent-Mode": "draft",
>         "X-Sendforsign-Allowed-Domains": "customer.com,partner.org"
>       }
>     }
>   }
> }
> ```
>
> Raw JSON-RPC, to check the connection from a terminal:
>
> ```bash cURL theme={null}
> curl -X POST https://api.sendforsign.com/mcp \
>   -H "Content-Type: application/json" \
>   -H "Accept: application/json, text/event-stream" \
>   -H "X-Sendforsign-Key: $SENDFORSIGN_API_KEY" \
>   -H "X-Sendforsign-Client-Key: $SENDFORSIGN_CLIENT_KEY" \
>   -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
> ```
>
> The server is stateless: only `POST` is supported (`GET` and `DELETE` return `405`).

## Troubleshooting

| Error | Cause |
| - | - |
| `401` and the app asks you to sign in again | The connection was disconnected or its refresh token expired or was reused. Connect again. |
| `401 Missing credentials` | Header connection without `X-Sendforsign-Key` or `Authorization: Bearer`. Check that your client passes headers to remote servers. |
| `400 Missing X-Sendforsign-Client-Key` | API-key auth also needs the client key header. |
| `Blocked by policy: this connection is read_only / in draft mode` | The tool needs a higher [agent mode](https://about.sendforsign.com/ai-agents/accountability.md#agent-modes). For OAuth, reconnect and choose a different mode on the consent screen. |
| `Not executed: ... needs confirm: true` | Expected: the agent must ask the human, then call again with `confirm: true`. |
| `Blocked by policy: recipients outside the allowed domains` | A recipient's email is outside the allowed domains of this connection. |
| `405 Method not allowed` | The client tried SSE (`GET`). Use the Streamable HTTP transport. |


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