Discord Connector
Discord connector for guilds, channels, messages, and approved sends.
Credential setup
api_key_headerEnter the credential as `Bot <token>` and grant the bot only the required guild permissions.
Setup docs: https://discord.com/developers/applications
After adding this connector, attach the credential on the server page, then run astrail tools list.
Hosted MCP endpoint
/api/mcp/preset-discordPrivate servers require an Astrail API key in the Authorization header.
MCP client snippets
ConnectClaude Desktop config
{
"mcpServers": {
"discord-connector": {
"url": "/api/mcp/preset-discord"
}
}
}cURL initialize
curl -sS -X POST "/api/mcp/preset-discord" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'cURL tools/list
curl -sS -X POST "/api/mcp/preset-discord" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'cURL tools/call
curl -sS -X POST "/api/mcp/preset-discord" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"discord_list_guilds","arguments":{"before":"example","after":"example","limit":10}}}'Runtime behavior
healthynot_checkedsafe_rest_executionnot recordednot recordednot recordednonestructured fallbackstandardauth_required / oauth_requiredmapping_requiredAstrail does not evaluate generated TypeScript inside Next.js. Hosted calls are routed through stored tool metadata and endpoint maps.
Tools
4discord_list_guildsList Discord guilds available to the connected bot or user token.
discord_list_channelsList channels in a Discord guild.
discord_get_messagesGet recent messages from a Discord channel.
discord_send_messageSend a Discord channel message after approval.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "Discord Connector", version: "1.0.0" });
// Curated Astrail connector for: discord_list_guilds, discord_list_channels, discord_get_messages, discord_send_message.
// The hosted endpoint executes its verified deterministic endpoint map. Attach a least-privilege provider credential before calling private tools.
server.tool("connector_status", "Confirm this curated connector template is installed.", z.object({}), async () => ({
content: [{ type: "text", text: "Connector installed. Attach provider credentials to enable hosted API calls." }],
}));
const transport = new StdioServerTransport();
await server.connect(transport);