Skip to main content
Glama
jakemoshel

discord-support-mcp

by jakemoshel
README.md
# discord-support-mcp

An [MCP](https://modelcontextprotocol.io) server that exposes Discord support
tickets as tools for AI agents. Built for servers that manage tickets with
[Ticket Tool](https://tickettool.xyz) (which has no public API): it reads the
ticket channels directly through the Discord bot API.

## Tools

| Tool | What it does |
|---|---|
| `list_open_tickets` | Lists channels in the configured ticket category, oldest first |
| `read_ticket` | Returns recent message history of a ticket |
| `reply_to_ticket` | Posts a message into a ticket as the bot |
| `rename_ticket` | Renames a ticket channel |
| `close_ticket` | Locks + renames a ticket (`closed-` prefix) |
| `list_members` | Username substring lookup (respects PII_REDACT) |

## Compliance / self-hosting

If agents touching user-identifying information must be self-hosted, run this
server **on your own infrastructure next to your self-hosted model** and set
`PII_REDACT=true`. All message content is then stripped of emails, phone
numbers, mentions and snowflake IDs before it reaches any upstream (cloud)
agent. Only the sanitized layer should be exposed beyond the host.

## Setup

1. Create a bot at https://discord.com/developers/applications
   - Enable **Message Content Intent** and **Server Members Intent**.
   - Invite with scopes `bot` and permissions: View Channels, Read Message
     History, Send Messages, Manage Channels, Manage Roles (for close).
2. Find the category ID Ticket Tool puts tickets in (right-click the category
   in Discord with developer mode on → Copy Channel ID).
3. Configure:

```bash
cp .env.example .env   # fill in values
npm install
npm run build
```

4. Wire into an MCP client (e.g. Claude Desktop config):

```json
{
  "mcpServers": {
    "discord-support": {
      "command": "node",
      "args": ["/absolute/path/to/discord-support-mcp/dist/index.js"],
      "env": {
        "DISCORD_TOKEN": "...",
        "GUILD_ID": "...",
        "TICKET_CATEGORY_ID": "...",
        "PII_REDACT": "true"
      }
    }
  }
}
```

## Notes

- `close_ticket` is a safe archive (lock + rename). Actual transcript/deletion
  stays with Ticket Tool's own `/close` so your transcripts channel keeps
  working; the agent can also just call Ticket Tool's close command flow
  manually for now.
- Discord rate limits apply; history reads are capped at 100 messages per call.