# Discord Mcp Server (`goodboycoder/discord-mcp-server`) Actor

Connect your AI assistant directly to Discord and automate messages, roles, and moderation without building or hosting custom bots.

- **URL**: https://apify.com/goodboycoder/discord-mcp-server.md
- **Developed by:** [goodboycoder](https://apify.com/goodboycoder) (community)
- **Categories:** MCP servers, Automation, Integrations
- **Stats:** 9 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Discord MCP Server

**Connect your AI assistant directly to Discord and automate messages, roles, and moderation — without building or hosting custom bots.**

Discord MCP Server is a ready‑to‑use **Model Context Protocol (MCP) server** that lets AI tools control Discord servers through a simple, secure interface. It runs on **Apify**, so you get reliability, scaling, and security out of the box.

***

### What You Can Do

With Discord MCP Server, your AI assistant can:

- 📨 **Send messages** to Discord channels
- 📖 **Read conversations** and recent message history
- 👥 **View members and roles**
- 🎭 **Automatically manage roles**
- 🔍 **Monitor channels** for activity
- 🛡️ **Moderate content** using simple rules

No backend servers. No bot hosting. Just connect and automate.

***

### Who This Is For

- **AI developers** building Discord‑connected assistants
- **Community managers** automating moderation and engagement
- **Customer support teams** running AI support in Discord
- **Businesses & creators** managing Discord communities at scale

***

### Why Use Discord MCP Server

#### 🚀 Zero Infrastructure

Runs entirely on Apify. No servers to deploy, scale, or maintain.

#### 🤖 Built for AI

Designed specifically for **MCP‑compatible clients** like Cursor, Claude Desktop, Windsurf, and VS Code.

#### 🔒 Secure by Design

- Uses your own Discord bot
- Access limited by Discord permissions
- Runs with Apify‑managed security

#### 💸 Simple, Pay‑Per‑Use Pricing

Pay only when the Actor runs. No subscriptions or long‑term commitments.

***

### How It Works (Simple)

1. You provide a Discord bot token and server ID
2. The Actor runs securely on Apify
3. Your AI assistant connects via MCP and controls Discord

***

### Pay‑Per‑Event Pricing

Discord MCP Server uses **simple, transparent pay‑per‑event pricing**. You only pay for the actions your AI actually performs. There are **no subscriptions** and **no minimum commitments**.

| Action            | Description                         | Price (USD) |
| ----------------- | ----------------------------------- | ----------- |
| **Send Message**  | Send a message to a Discord channel | $0.01       |
| **Get Messages**  | Fetch messages from a channel       | $0.005      |
| **List Channels** | List all channels in a server       | $0.002      |
| **List Members**  | List server members                 | $0.005      |
| **List Roles**    | List available roles                | $0.002      |
| **Add Role**      | Add a role to a user                | $0.01       |
| **Remove Role**   | Remove a role from a user           | $0.01       |

💡 **Tip:** Most users spend only a few dollars per month, even with daily automation.

***

### Setup Requirements

#### 1️⃣ Create a Discord Bot

1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)
2. Click **New Application** and give it a name
3. Go to the **Bot** section and click **Add Bot**
4. Under **Privileged Gateway Intents**, enable:
   - ✅ **Server Members Intent**
   - ✅ **Message Content Intent**
5. Click **Reset Token** and copy your bot token (keep it secret!)
6. Go to **OAuth2 → URL Generator**
   - Select scopes: `bot`
   - Select bot permissions: `Send Messages`, `Read Messages`, `Manage Roles`, etc.
7. Copy the generated URL and use it to invite the bot to your Discord server

#### 2️⃣ Get Your Discord Server (Guild) ID

1. Enable **Developer Mode** in Discord (User Settings → Advanced → Developer Mode)
2. Right-click your Discord server icon
3. Click **Copy ID** — this is your Guild ID

***

### How to Use

#### Step 1: Start the Actor on Apify

1. Go to the [Actor page on Apify](https://console.apify.com/actors/7NVnVLCPUfh1SuJU2)
2. Click **"Start"**
3. In the input form, provide:
   - **Discord Bot Token**: Your bot token from Step 1️⃣ above
   - **Discord Server (Guild) ID**: Your server ID from Step 2️⃣ above
4. Click **"Start"** to run the Actor in standby mode

The Actor will start and wait for MCP requests. You'll get a unique Actor run URL like:

```
https://goodboycoder--discord-mcp-server.apify.actor/runs/YOUR_RUN_ID
```

#### Step 2: Connect Your MCP Client

##### For Claude Desktop or Windsurf

Add this to your MCP configuration file (usually `~/Library/Application Support/Claude/claude_desktop_config.json` on Mac or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json
{
  "mcpServers": {
    "discord": {
      "transport": "http",
      "url": "https://goodboycoder--discord-mcp-server.apify.actor/mcp?token=YOUR_APIFY_API_TOKEN"
    }
  }
}
```

##### For Cursor

Add this to your Cursor MCP configuration file (`.cursor/mcp.json` in your workspace):

```json
{
  "mcpServers": {
    "discord": {
      "transport": "http",
      "url": "https://goodboycoder--discord-mcp-server.apify.actor/mcp?token=YOUR_APIFY_API_TOKEN"
    }
  }
}
```

**Note:** Replace `YOUR_APIFY_API_TOKEN` with your API token from [Apify Console](https://console.apify.com/account/integrations)

#### Step 3: Use the Discord Tools

Once connected, you can use commands like:

- "List my Discord channels"
- "Send a message to #general saying 'Hello!'"
- "Show me the recent messages in #general"
- "List all members in my Discord server"

***

### What Data It Can Access

The Actor only accesses data from servers where **your bot is invited and permitted**:

- Messages (read & send)
- Channels (read)
- Members (read)
- Roles (read & manage)

You remain fully in control through Discord permissions.

***

### Get Started

Deploy the Actor, connect your MCP client, and start automating your Discord server with AI in minutes.

***

Built with ❤️ by **goodboycoder**

# Actor input Schema

## `discordBotToken` (type: `string`):

Your Discord bot token from the Discord Developer Portal. Get it from https://discord.com/developers/applications

## `discordGuildId` (type: `string`):

Your Discord server ID. Enable Developer Mode in Discord, right-click your server, and copy ID.

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("goodboycoder/discord-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("goodboycoder/discord-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call goodboycoder/discord-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,goodboycoder/discord-mcp-server"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7NVnVLCPUfh1SuJU2/builds/qAdwM7hhOELzvU4DH/openapi.json
