Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_login

Authenticate with Discord by using a configured token to enable AI assistants to perform actions like messaging, managing channels, and handling webhooks.

Instructions

Logs in to Discord using the configured token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringNo

Implementation Reference

  • Zod schema for validating input arguments to the discord_login tool (random_string optional).
    const DiscordLoginSchema = z.object({ random_string: z.string().optional() });
  • src/index.ts:195-204 (registration)
    Tool registration in the MCP server's listTools response, including name, description, and input schema.
    { name: "discord_login", description: "Logs in to Discord using the configured token", inputSchema: { type: "object", properties: { random_string: { type: "string" } }, required: [] }
  • Main handler logic for discord_login: validates args, checks login status, performs Discord client login using config token, handles success/error responses.
    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 }; } }

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