Skip to content

feat: Add Discord MCP integration and improve README#46

Open
YaSh8202 wants to merge 1 commit intomainfrom
feat/discord-integration-and-readme-improvements
Open

feat: Add Discord MCP integration and improve README#46
YaSh8202 wants to merge 1 commit intomainfrom
feat/discord-integration-and-readme-improvements

Conversation

@YaSh8202
Copy link
Copy Markdown
Owner

🚀 Features

Discord MCP Integration

  • Complete Discord MCP app with OAuth2 authentication following the existing app pattern
  • 6 Discord tools for comprehensive Discord management:
    • get_user_info - Get current authenticated user information
    • list_guilds - List user's Discord servers
    • list_channels - List channels in a Discord server
    • send_message - Send messages to Discord channels
    • get_messages - Retrieve messages from Discord channels
    • add_reaction - Add emoji reactions to messages
  • Proper TypeScript types for Discord API with comprehensive interface definitions
  • OAuth2 authentication with appropriate Discord scopes (bot, messages.read, guilds, etc.)
  • Error handling and proper API response formatting

README Improvements

  • Added Discord integration to Available Apps section
  • Updated tool count from 159+ to 165+ tools across 12 applications
  • Improved wording for better user experience ("Easily create" vs "Create")
  • Enhanced Getting Started section with friendlier language
  • Added Discord examples to use cases section
  • Fixed LICENSE file link with proper relative path
  • Verified all section links work correctly
  • No typos found - ran comprehensive typo check

🔧 Technical Details

Discord App Structure

src/app/mcp/apps/discord/
├── index.ts           # Main Discord MCP app definition
├── common.ts          # OAuth2 configuration
├── discord-client.ts  # Discord API client with typed methods
├── types.ts           # Comprehensive Discord API TypeScript types
└── tools/
    ├── index.ts       # Tool exports
    ├── get-user-info.ts
    ├── list-guilds.ts
    ├── list-channels.ts
    ├── send-message.ts
    ├── get-messages.ts
    └── add-reaction.ts

Code Quality

  • All TypeScript checks pass - no any types used
  • Biome formatting applied - consistent code style
  • Build successful - verified with pnpm run build
  • Follows existing patterns - consistent with Slack/GitHub apps

🧪 Testing

  • ✅ TypeScript compilation successful
  • ✅ Biome linting and formatting passed
  • ✅ Build process completed without errors
  • ✅ All imports and exports properly configured

📝 Documentation

The Discord integration is now fully documented in the README with:

  • App description and tool count
  • Example use cases
  • Updated navigation links
  • Improved user-friendly language

🎯 Impact

This PR adds Discord as the 12th integrated application, bringing the total to 165+ tools and expanding communication capabilities for MCP users. The README improvements make the project more welcoming and easier to understand for new users.

@YaSh8202 can click here to continue refining the PR

- Add comprehensive Discord MCP app with OAuth2 authentication
- Implement 6 Discord tools: send messages, list guilds/channels, get messages, add reactions, get user info
- Add proper TypeScript types for Discord API
- Update README with Discord integration documentation
- Improve README wording for better user experience
- Update tool count to 165+ tools across 12 applications
- Add Discord to example use cases
- Fix LICENSE file link in README

Co-authored-by: openhands <openhands@all-hands.dev>
Copilot AI review requested due to automatic review settings December 10, 2025 08:13
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mcp-one Ready Ready Preview Comment Dec 10, 2025 8:14am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Discord as a new MCP integration with 6 tools for managing Discord servers, channels, and messages through OAuth2 authentication. The implementation follows existing app patterns (similar to Slack and GitHub integrations) and updates documentation to reflect the new integration, bringing the total from 159 to 165 tools across 12 applications.

Key changes:

  • Complete Discord MCP app with 6 tools (user info, guilds, channels, messages, reactions)
  • Comprehensive TypeScript types for Discord API entities
  • OAuth2 authentication flow with Discord
  • Updated README with Discord documentation and improved wording

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
src/app/mcp/apps/index.ts Registers Discord app in the MCP apps array
src/app/mcp/apps/discord/index.ts Main Discord app definition with metadata and logo
src/app/mcp/apps/discord/common.ts OAuth2 authentication configuration with Discord API endpoints
src/app/mcp/apps/discord/discord-client.ts Discord API client with typed methods for user, guild, channel, and message operations
src/app/mcp/apps/discord/types.ts Comprehensive TypeScript interface definitions for Discord API entities
src/app/mcp/apps/discord/tools/index.ts Exports all 6 Discord tools
src/app/mcp/apps/discord/tools/get-user-info.ts Tool to fetch authenticated user information
src/app/mcp/apps/discord/tools/list-guilds.ts Tool to list user's Discord servers
src/app/mcp/apps/discord/tools/list-channels.ts Tool to list channels in a guild with type categorization
src/app/mcp/apps/discord/tools/send-message.ts Tool to send messages with embed support
src/app/mcp/apps/discord/tools/get-messages.ts Tool to retrieve messages with pagination
src/app/mcp/apps/discord/tools/add-reaction.ts Tool to add emoji reactions to messages
README.md Updates Available Apps section with Discord, improves wording (em-dashes, friendlier language), fixes LICENSE link, adds Discord use case examples, and updates tool count to 165+

@@ -0,0 +1,89 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement should use zod/v4 instead of zod for consistency with the codebase convention. Change to:

import { z } from "zod/v4";

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +48 to +55
return {
content: [
{
type: "text" as const,
text: formatDiscordError(error),
},
],
};
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error response should include isError: true flag to follow the codebase convention for tool error handling. Update to:

return {
  content: [
    {
      type: "text" as const,
      text: formatDiscordError(error),
    },
  ],
  isError: true,
};

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +100 to +107
return {
content: [
{
type: "text" as const,
text: formatDiscordError(error),
},
],
};
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error response should include isError: true flag to follow the codebase convention for tool error handling. Update to:

return {
  content: [
    {
      type: "text" as const,
      text: formatDiscordError(error),
    },
  ],
  isError: true,
};

Copilot generated this review using guidance from repository custom instructions.
@@ -0,0 +1,58 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement should use zod/v4 instead of zod for consistency with the codebase convention. Change to:

import { z } from "zod/v4";

Copilot generated this review using guidance from repository custom instructions.
@@ -0,0 +1,70 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement should use zod/v4 instead of zod for consistency with the codebase convention. Change to:

import { z } from "zod/v4";

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +39 to +46
return {
content: [
{
type: "text" as const,
text: formatDiscordError(error),
},
],
};
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error response should include isError: true flag to follow the codebase convention for tool error handling. Update to:

return {
  content: [
    {
      type: "text" as const,
      text: formatDiscordError(error),
    },
  ],
  isError: true,
};

Copilot generated this review using guidance from repository custom instructions.
const errorText = await response.text();
throw new Error(`Discord API Error (${response.status}): ${errorText}`);
}

Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The makeRequest method will fail for Discord API endpoints that return 204 No Content responses (such as adding/removing reactions). When the response status is 204, there is no body to parse, so response.json() will throw an error.

Update the method to handle empty responses:

if (!response.ok) {
  const errorText = await response.text();
  throw new Error(`Discord API Error (${response.status}): ${errorText}`);
}

// Handle 204 No Content or other empty responses
if (response.status === 204 || response.headers.get('content-length') === '0') {
  return undefined as T;
}

return response.json();

This affects the addReaction and removeReaction methods which use PUT and DELETE endpoints that return 204.

Suggested change
// Handle 204 No Content or other empty responses
if (response.status === 204 || response.headers.get("content-length") === "0") {
return undefined as T;
}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,49 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement should use zod/v4 instead of zod for consistency with the codebase convention. Change to:

import { z } from "zod/v4";

Copilot generated this review using guidance from repository custom instructions.
@@ -0,0 +1,58 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import z.

Suggested change
import { z } from "zod";

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,49 @@
import { createParameterizedTool } from "@/app/mcp/mcp-app/tools";
import { z } from "zod";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import z.

Suggested change
import { z } from "zod";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants