Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/mcp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ export function createMcpServer(): Server {
try {
switch (name) {
case "send-message": {
const { channel: channelIdentifier, message } =
const { server, channel: channelIdentifier, message } =
SendMessageSchema.parse(args);
const channel = await findChannel(channelIdentifier);
const channel = await findChannel(channelIdentifier, server);
const sent = await channel.send(message);
return {
content: [
Expand All @@ -217,9 +217,9 @@ export function createMcpServer(): Server {
};
}
case "react-to-message": {
const { channel: chId, messageId, emoji } =
const { server, channel: chId, messageId, emoji } =
ReactToMessageSchema.parse(args);
const reactChannel = await findChannel(chId);
const reactChannel = await findChannel(chId, server);
const targetMsg = await reactChannel.messages.fetch(messageId);

try {
Expand Down Expand Up @@ -393,9 +393,9 @@ export function createMcpServer(): Server {
};
}
case "read-messages": {
const { channel: channelIdentifier, limit } =
const { server, channel: channelIdentifier, limit } =
ReadMessagesSchema.parse(args);
const channel = await findChannel(channelIdentifier);
const channel = await findChannel(channelIdentifier, server);
const messages = await channel.messages.fetch({ limit });
const formatted = [];
for (const msg of messages.values()) {
Expand Down