AR

anima-research/discord-mcpl

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 9 forks 质量 67 趋势 20

discord-mcpl puts an AI agent on Discord through a bot account. It is an MCPL server. MCPL (MCP Live) extends the Model Context Protocol so that a server can register channels with its host and push...

概览

discord-mcpl puts an AI agent on Discord through a bot account. It is an MCPL server. MCPL (MCP Live) extends the Model Context Protocol so that a server can register channels with its host and push events to it, besides offering tools. Through discord-mcpl, the agent reads and posts in Discord channels and DMs, and messages that mention the bot, reply to it or DM it reach the agent's host even from channels the agent hasn't opened. In the Connectome stack, connectome-host runs agents on agent-framework, which starts discord-mcpl as a child process and talks to it over stdio. An MCP client can run it too, as a server that offers tools only. Its protocol code comes from @animalabs/mcpl-core, and slack-mcpl and telegram-mcpL are its counterparts for Slack and Telegram. - discord-mcpl registers Discord channels with its host as MCPL channels, with IDs of the form discord: : , or discord:dm: for a DM. (A guild is what Discord's API calls a server.

README

以下为原文 README 节选,完整内容请查看原文。

discord-mcpl

discord-mcpl puts an AI agent on Discord through a bot account. It is an MCPL server. MCPL (MCP Live) extends the Model Context Protocol so that a server can register channels with its host and push events to it, besides offering tools. Through discord-mcpl, the agent reads and posts in Discord channels and DMs, and messages that mention the bot, reply to it or DM it reach the agent’s host even from channels the agent hasn’t opened.

In the Connectome stack, connectome-host runs agents on agent-framework, which starts discord-mcpl as a child process and talks to it over stdio. An MCP client can run it too, as a server that offers tools only. Its protocol code comes from @animalabs/mcpl-core, and slack-mcpl and telegram-mcpL are its counterparts for Slack and Telegram.

What it does

  • Channels. discord-mcpl registers Discord channels with its host as MCPL channels, with IDs of the form discord::, or discord:dm: for a DM. (A guild is what Discord’s API calls a server.) The host opens and closes channels, and discord-mcpl delivers the messages posted in an open channel as they arrive, unless the agent has muted it.
  • Messages addressed to the bot. discord-mcpl also delivers a message that mentions the bot or its own role, replies to one of the bot’s messages, or comes as a DM, whether or not its channel is open, as long as the filters admit it and the agent hasn’t muted that channel. Messages delivered as they arrive carry MCPL event tags, such as chat:mention, chat:reply, chat:dm, chat:ambient and chat:from-bot, which the host’s wake policy can match. An edit carries the same address tags beside chat:edited, read from the message as edited, unless its addressing isn’t known: an edit of a message discord.js holds only in part, or of a reply whose target Discord didn’t send, carries none.
  • Edits, deletions and reactions. discord-mcpl delivers edits and deletions from DMs and open channels, unless the agent has muted them, and reactions from server channels where reaction visibility is on. Opening a channel the agent hasn’t muted turns its reaction visibility on, and closing it turns it off, and the agent can also set it with set_reaction_visibility. discord-mcpl doesn’t request Discord’s DM reaction events, so reactions in DMs never arrive.
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

"mcpServers": { "discord": { "command": "node", "args": ["/absolute/path/to/dist/src/index.js", "--stdio"], "env": { "DISCORD_TOKEN": "${DISCORD_TOKEN}", "DISCORD_WATERMARK_FILE": "/absolute/path/to/data/discord-watermarks.json" }, "allowHostCommands": true } }