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

# Slack MCP server

> Connect Slack's hosted MCP server through Portkey MCP Gateway for channels, messaging, and workspace context

Use Slack's remote MCP server to read channels, post messages, and work with workspace data. Portkey MCP Gateway adds centralized auth, access control, and observability on top of Slack's endpoint.

## When should you use this server

* Surface channel context or recent threads during agent workflows
* Draft or send messages from AI assistants with human-in-the-loop review
* Look up users or channel metadata for routing and notifications

## Key features

* Workspace-aware tools (channels, chat, users—depending on granted Bot Token Scopes)
* Hosted endpoint—no self-hosted Slack MCP binary to run
* OAuth-based access aligned with Slack app permissions

## Authentication

* **Method:** OAuth 2.1 with **manual OAuth metadata** (Slack does not use Dynamic Client Registration for this flow)
* **Slack app:** Create an app at [api.slack.com/apps](https://api.slack.com/apps), configure redirect URL, Bot Token Scopes, and **Agents & AI Apps → Enable MCP** (required)

## Endpoint

**Remote MCP server:**

```
https://mcp.slack.com/mcp
```

***

## Connect via Portkey MCP Gateway

<Note>
  Slack requires registering an OAuth app and passing `client_id`, `client_secret`, `redirect_uri`, and `scope` in Portkey **Advanced Configuration**—same pattern as other providers that need manual OAuth metadata (for example [GitHub](/integrations/mcp-servers/github-mcp-server#method-1-oauth-with-github-oauth-app)).
</Note>

### Step 1: Create a Slack OAuth app

1. Open [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → **From scratch**.

2. Set an app name (e.g. `Portkey MCP Gateway`) and pick a workspace.

3. Go to **OAuth & Permissions**.

4. Under **Redirect URLs**, add exactly:

   ```
   https://mcp.portkey.ai/oauth/upstream-callback
   ```

5. Under **Scopes** → **Bot Token Scopes**, add the scopes agents need (e.g. `channels:read`, `chat:write`, `users:read`). Match these to the `scope` string in Step 3.

6. Open **Basic Information** and copy **Client ID** and **Client Secret**.

### Step 2: Enable MCP (Agents & AI Apps)

<Warning>
  Turn **Enable MCP** on under **Agents & AI Apps** in the Slack app sidebar. If this stays off, tool discovery fails and OAuth breaks at the end of the flow.
</Warning>

1. In the Slack app settings sidebar, open **Agents & AI Apps**.
2. Toggle **Enable MCP** to on.
3. Save.

### Step 3: Register the integration in Portkey

1. In Portkey, go to **MCP Registry** → **Add MCP Integration**.
2. Set:

| Field          | Value                       |
| -------------- | --------------------------- |
| **Name**       | Slack                       |
| **Slug**       | `slack`                     |
| **Server URL** | `https://mcp.slack.com/mcp` |
| **Auth Type**  | OAuth 2.1                   |

3. Expand **Advanced Configuration** and paste (replace placeholders; align `scope` with Bot Token Scopes from Step 1):

```json theme={"system"}
{
  "oauth_metadata": {
    "client_id": "YOUR_SLACK_CLIENT_ID",
    "client_secret": "YOUR_SLACK_CLIENT_SECRET",
    "redirect_uri": "https://mcp.portkey.ai/oauth/upstream-callback",
    "scope": "channels:read chat:write users:read"
  }
}
```

4. Configure workspace access as needed, then save the integration.

### Step 4: Connect from an agent

Gateway URL pattern: `https://mcp.portkey.ai/{slug}/mcp` (use the registry slug, e.g. `slack`).

```json Claude Desktop / Cursor theme={"system"}
{
  "mcpServers": {
    "slack": {
      "url": "https://mcp.portkey.ai/slack/mcp"
    }
  }
}
```

On first tool use, the client opens Slack authorization. Portkey stores and refreshes tokens.

***

## Tools provided

<Note>
  Slack publishes machine-readable tool definitions at runtime (`tools/list` on `https://mcp.slack.com/mcp` after auth). Tool names and optional fields can change—use the client’s tool inspector or `tools/list` as the source of truth. Summaries below follow [Slack MCP server overview](https://docs.slack.dev/ai/slack-mcp-server) and the [developing with Slack MCP](https://docs.slack.dev/ai/slack-mcp-server/developing) scope table.

  Tool results are **human-readable markdown** with hydrated user and channel names where applicable—not raw IDs only.
</Note>

### OAuth scopes by capability

| Capability                 | User token scopes (examples)                                                      |
| -------------------------- | --------------------------------------------------------------------------------- |
| Search messages / channels | `search:read.public`, `search:read.private`, `search:read.mpim`, `search:read.im` |
| Search files               | `search:read.files`                                                               |
| Search users               | `search:read.users`                                                               |
| Send message               | `chat:write`                                                                      |
| Read channel / thread      | `channels:history`, `groups:history`, `mpim:history`, `im:history`                |
| Create / update canvas     | `canvases:read`, `canvases:write`                                                 |
| Read user profile          | `users:read`, `users:read.email`                                                  |

Rate limits follow [Slack Web API tiers](https://docs.slack.dev/apis/web-api/rate-limits) per action (see the [overview rate limit table](https://docs.slack.dev/ai/slack-mcp-server#rate-limits)).

***

### **slack\_search\_public**

Search public Slack content (messages and files in accessible public channels). Keyword-oriented unless the workspace has features that enable broader search.

**Arguments:**

* `query` *(string, required)* — Search string; supports Slack modifiers (`in:`, `from:`, dates, etc.).
* `content_types` *(string, optional)* — Comma-separated: `messages`, `files`.
* `cursor` *(string, optional)* — Pagination cursor from a prior response.
* `limit` *(number, optional)* — Page size (capped by Slack).
* `sort` *(string, optional)* — Often `score` or `timestamp`.
* `sort_dir` *(string, optional)* — `asc` or `desc`.
* `response_format` *(string, optional)* — e.g. `detailed` or `concise`.
* `include_context` *(boolean, optional)* — Include surrounding context messages when supported.
* `max_context_length` *(number, optional)* — Cap context length per hit.
* `context_channel_id` *(string, optional)* — Hint channel for ranking or context.
* `after` / `before` *(string, optional)* — Unix timestamp window filters.
* `include_bots` *(boolean, optional)* — Include bot-authored messages.

**Returns:** Text (markdown) hits plus pagination fields the server exposes (e.g. `next_cursor`).

***

### **slack\_search\_public\_and\_private**

Same search surface extended to private channels, DMs, and MPIMs the authorized user can access. Requires private search scopes (e.g. `search:read.private`, `search:read.im`, `search:read.mpim`).

**Arguments:** Same family as `slack_search_public` (see `tools/list` for the exact schema on your build).

**Returns:** Markdown search results and pagination metadata.

***

### **slack\_search\_channels**

Find channels by name or description.

**Arguments:**

* `query` *(string, required)* — Search text.
* `cursor` *(string, optional)* — Pagination.
* `limit` *(number, optional)* — Page size.
* `response_format` *(string, optional)* — `detailed` or `concise`.
* `include_archived` *(boolean, optional)* — Include archived channels.

**Returns:** Channel metadata (IDs, topics, purposes) as markdown or structured text per `response_format`.

***

### **slack\_search\_users**

Find workspace members by name, email, or profile attributes.

**Arguments:**

* `query` *(string, required)* — Search string.
* `cursor` *(string, optional)* — Pagination.
* `limit` *(number, optional)* — Page size.
* `response_format` *(string, optional)* — `detailed` or `concise`.

**Returns:** User summaries (IDs, display names, titles, etc.).

***

### **slack\_read\_channel**

Read recent messages from a channel, group, or conversation ID.

**Arguments:**

* `channel_id` *(string, required)* — Channel or conversation ID (`C…`, `G…`, `D…`).
* `limit` *(number, optional)* — Messages to return.
* `cursor` *(string, optional)* — Pagination cursor.
* `latest` / `oldest` *(string, optional)* — Timestamp bounds.
* `response_format` *(string, optional)* — `detailed` or `concise`.

**Returns:** Message timeline as markdown (authors and text hydrated where possible).

***

### **slack\_read\_thread**

Read all replies in a thread.

**Arguments:**

* `channel_id` *(string, required)* — Channel containing the thread.
* `message_ts` *(string, required)* — Parent message timestamp (`1234567890.123456`).
* `limit` *(number, optional)* — Max replies.
* `cursor` *(string, optional)* — Pagination.
* `latest` / `oldest` *(string, optional)* — Bounds.
* `response_format` *(string, optional)* — `detailed` or `concise`.

**Returns:** Thread transcript as markdown.

***

### **slack\_send\_message**

Post a message to a channel or DM.

**Arguments:**

* `channel_id` *(string, required)* — Destination channel or DM ID.
* `message` *(string, required)* — Message body (Slack-flavored markdown where supported).
* `thread_ts` *(string, optional)* — Reply in a thread.
* `reply_broadcast` *(boolean, optional)* — Also post to channel.
* `draft_id` *(string, optional)* — Send and consume a drafted message if the flow created one.

**Returns:** Confirmation text and message identifiers when provided by Slack.

***

### **slack\_send\_message\_draft**

Create a draft in a channel or thread without sending.

**Arguments:**

* `channel_id` *(string, required)* — Target conversation.
* `message` *(string, required)* — Draft markdown.
* `thread_ts` *(string, optional)* — Draft as a thread reply.

**Returns:** Draft handle or link the client uses to open or send the draft later.

***

### **slack\_schedule\_message**

Schedule a message for later delivery.

**Arguments:**

* `channel_id` *(string, required)* — Target conversation.
* `message` *(string, required)* — Body to send at `post_at`.
* `post_at` *(integer, required)* — Unix time (must be in the future; Slack enforces min/max horizon).
* `thread_ts` *(string, optional)* — Schedule as a thread reply.
* `reply_broadcast` *(boolean, optional)* — Broadcast thread reply to channel.
* `draft_id` *(string, optional)* — Delete a draft after scheduling.

**Returns:** Scheduled message metadata (e.g. schedule ID) when Slack returns it.

***

### **slack\_create\_canvas**

Create a Slack Canvas from markdown content.

**Arguments:**

* `title` *(string, required)* — Canvas title.
* `content` *(string, required)* — Canvas-flavored markdown body.

**Returns:** Canvas URL or ID string the model can surface to the user.

***

### **slack\_read\_canvas**

Fetch a canvas as markdown (and section metadata when supported).

**Arguments:**

* `canvas_id` *(string, required)* — Canvas file / document ID.

**Returns:** Markdown content plus optional `section_id_mapping` for follow-up edits.

***

### **slack\_update\_canvas**

Append, prepend, or replace canvas sections.

**Arguments:**

* `canvas_id` *(string, required)* — Target canvas.
* `action` *(string, required)* — `append`, `prepend`, or `replace`.
* `content` *(string, required)* — Markdown to apply (Canvas-flavored rules apply).
* `section_id` *(string, optional)* — Target section from `slack_read_canvas` mapping; required for safe `replace`.
* `title` *(string, optional)* — Update canvas title only when updating title-only.

**Returns:** Updated canvas URL and revised section mapping when provided.

***

### **slack\_read\_user\_profile**

Load profile fields for a member (or the authenticated user if `user_id` omitted).

**Arguments:**

* `user_id` *(string, optional)* — Slack user ID; defaults to current user when omitted.
* `include_locale` *(boolean, optional)* — Include locale fields.
* `response_format` *(string, optional)* — `detailed` or `concise`.

**Returns:** Profile card text / markdown.

***

<Note>
  Add `"headers": { "x-portkey-api-key": "YOUR_PORTKEY_API_KEY" }` when the workspace requires the Portkey API key on the MCP request—see [Integrations](/product/mcp-gateway/integrations). For self-hosted gateways, replace `mcp.portkey.ai` with the gateway host.

  Third-party Slack apps send prompts and workspace data to Slack under their terms. Grant only the Bot Token Scopes agents need.
</Note>
