Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_login

Authenticate with Discord using a configured token to enable AI assistants to interact with Discord platforms for messaging, channel management, and webhook handling.

Instructions

Logs in to Discord using the configured token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringNo

Implementation Reference

  • The main handler for the discord_login tool. Parses optional random_string arg (unused), checks if client is ready, logs in using client.login(config.DISCORD_TOKEN), returns success message with user tag or error.
    case "discord_login": { const { random_string } = DiscordLoginSchema.parse(args); try { // Check if already logged in if (client.isReady()) { return { content: [{ type: "text", text: `Already logged in as ${client.user?.tag}` }] }; } // Try to login await client.login(config.DISCORD_TOKEN); return { content: [{ type: "text", text: `Successfully logged in as ${client.user?.tag}` }] }; } catch (error) { return { content: [{ type: "text", text: `Login failed: ${error}` }], isError: true }; } }
  • Zod validation schema for the tool's input: optional random_string.
    const DiscordLoginSchema = z.object({ random_string: z.string().optional() });
  • src/index.ts:195-204 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and input schema matching the Zod schema.
    { name: "discord_login", description: "Logs in to Discord using the configured token", inputSchema: { type: "object", properties: { random_string: { type: "string" } }, required: [] }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jar285/mcp-discord'

If you have feedback or need assistance with the MCP directory API, please join our Discord server