Content
# Discord MCP
A Discord MCP (Model Context Protocol) server that authenticates with your personal Discord account using OAuth.
## Setup
### 1. Create a Discord Application
1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)
2. Click "New Application" and give it a name
3. Go to **OAuth2** in the sidebar
4. Add a redirect URI: `http://localhost:8910/callback`
5. Copy your **Client ID** and **Client Secret**
### 2. Install
```bash
pnpm install
pnpm build
```
### 3. Authenticate
Run the auth command to link your Discord account:
```bash
pnpm auth
```
This will:
1. Prompt for your Client ID and Client Secret (first time only)
2. Open your browser to authorize the app
3. Save your tokens to `~/.config/discord-mcp/config.json`
## Usage
### With Claude Desktop
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["/path/to/discord-mcp/dist/index.js"]
}
}
}
```
### With Claude Code
Add to your Claude Code MCP settings:
```json
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["/path/to/discord-mcp/dist/index.js"]
}
}
}
```
## Available Tools
| Tool | Description |
|------|-------------|
| `get_current_user` | Get your Discord profile |
| `get_guilds` | List servers you're a member of |
| `get_guild_member` | Get your membership info for a specific server |
| `get_connections` | Get your connected accounts (Twitch, YouTube, etc.) |
| `get_guild_channels` | List channels in a server (limited by OAuth scopes) |
## OAuth Scopes
This MCP requests the following scopes:
- `identify` - Access your username, avatar, and banner
- `email` - Access your email address
- `guilds` - List the servers you're in
- `guilds.members.read` - Read your membership info in servers
## Limitations
Discord's OAuth scopes for users are limited compared to bot tokens. You **cannot**:
- Read message content in channels
- Send messages
- Manage server settings
For those capabilities, you need a bot. This MCP is for personal account data access only.
## Token Refresh
Tokens are automatically refreshed when expired. Your refresh token is stored locally in `~/.config/discord-mcp/config.json`.
## License
MIT