# Configure the Slack MCP Server

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

## Overview

Slack operates an official hosted MCP server at `mcp.slack.com` for channels, threads, messages, canvases, and user search. Access is authorized through OAuth via a Slack app you register yourself.

## 1. Configure Slack

1. Go to <a href="https://api.slack.com/apps" target="_blank" rel="noopener noreferrer">api.slack.com/apps</a> and select **Create New App → Blank app**. Name the app (for example, "Dtwo Gateway") and choose the workspace it should connect to.
2. Open **OAuth & Permissions** and add the Bot Token Scopes your agents need — for example `search:read.public`, `channels:history`, and `chat:write`. Add a Redirect URL matching your gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.
3. Open **Basic Information → App Credentials** and copy the **Client ID** and **Client Secret**.

## 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 the following entry:

```yaml
  - name: slack
    description: "Slack's official hosted MCP server for channels, messages, and canvases."
    url: https://mcp.slack.com/mcp
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      scopes:
        - search:read.public
        - channels:history
        - chat:write
      client_id: "<CLIENT_ID>"
      client_secret: "<CLIENT_SECRET>"
      authorization_url: "https://slack.com/oauth/v2/authorize"
      token_url: "https://slack.com/api/oauth.v2.access"
      redirect_uri: "<CALLBACK_URL>"
```

Replace the placeholder values:

- `<CLIENT_ID>` and `<CLIENT_SECRET>` — come from the Slack app you created in step 1.
- `<CALLBACK_URL>` — the same Redirect URL you set in step 1, 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 Slack via the gateway. This opens the Slack 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).