# Configure the DocuSign MCP Server

Connect DocuSign's official hosted MCP server to a Dtwo gateway via OAuth.

## Overview

DocuSign operates an official hosted MCP server for envelope, workflow, and directory operations. Access is authorized through OAuth.

## 1. Configure DocuSign

1. Sign in to your DocuSign account and go to **Admin → Integrations → Apps and Keys**.
2. Click **Add App and Integration Key** and give it a name (for example, `Dtwo`).
3. Set **Integration Type** to **Private custom integration**, and select **Yes** for "Is your application able to securely store a client secret?"
4. Check **Require Proof Key for Code Exchange (PKCE)**.
5. Click **Add Secret Key** to generate a secret key. Note the value of the generated secret key and the integration key at the top of the page — you'll need both for your gateway config.
6. Under **Redirect URIs**, click **Add URI** and enter your Dtwo gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.
7. Repeat this process for each DocuSign environment (demo/developer and production) you plan to connect.

## 2. Add the MCP server to your gateway config

Go to your gateway in the Dtwo UI and open **Configuration → Advanced**. In the `mcp_servers` section add an entry for the environment you're targeting.

For a demo/developer account:

```yaml
  - name: docusign-demo
    description: "DocuSign official hosted MCP server - developer/demo environment."
    url: https://mcp-d.docusign.com/mcp
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      issuer: "https://account-d.docusign.com"
      scopes:
        - signature
      client_id: "<DOCUSIGN_INTEGRATION_KEY>"
      client_secret: "<DOCUSIGN_SECRET_KEY>"
      authorization_url: "https://account-d.docusign.com/oauth/auth"
      token_url: "https://account-d.docusign.com/oauth/token"
      redirect_uri: "<CALLBACK_URL>"
      pkce_enabled: true
```

For a production account:

```yaml
  - name: docusign
    description: "DocuSign official hosted MCP server - production environment."
    url: https://mcp.docusign.com/mcp
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      issuer: "https://account.docusign.com"
      scopes:
        - signature
      client_id: "<DOCUSIGN_INTEGRATION_KEY>"
      client_secret: "<DOCUSIGN_SECRET_KEY>"
      authorization_url: "https://account.docusign.com/oauth/auth"
      token_url: "https://account.docusign.com/oauth/token"
      redirect_uri: "<CALLBACK_URL>"
      pkce_enabled: true
```

Replace the placeholder values:

- `<DOCUSIGN_INTEGRATION_KEY>` and `<DOCUSIGN_SECRET_KEY>` — come from the integration key and secret key you created in step 1 for that environment.
- `<CALLBACK_URL>` — your Dtwo gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.

## 3. Deploy and verify

Save the configuration and deploy the gateway.

Then, in your AI client, ask it to authorize DocuSign via the gateway. This opens the DocuSign login screen — sign in as the user whose permissions the agent should inherit, and approve the consent prompt. Once authorized, confirm the server's tools appear and run a quick call to make sure the connection works.

If the tools don't appear after you authorize, refresh the tool list in your AI client — some clients don't pick it up automatically.

---

Having trouble? Email [support@dtwo.ai](mailto:support@dtwo.ai).