@flowrelay/mcp-server 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +11 -0
- package/dist/api.js +9 -0
- package/dist/index.js +31 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -55,4 +55,15 @@ export declare class FlowRelayAPI {
|
|
|
55
55
|
created_at: string;
|
|
56
56
|
}>;
|
|
57
57
|
}>;
|
|
58
|
+
discordListChannels(): Promise<{
|
|
59
|
+
channels: Array<{
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
topic: string;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
discordSendMessage(channelId: string, content: string): Promise<{
|
|
66
|
+
ok: boolean;
|
|
67
|
+
message_id: string;
|
|
68
|
+
}>;
|
|
58
69
|
}
|
package/dist/api.js
CHANGED
|
@@ -49,4 +49,13 @@ export class FlowRelayAPI {
|
|
|
49
49
|
params.set('limit', String(limit));
|
|
50
50
|
return this.request(`/events?${params}`);
|
|
51
51
|
}
|
|
52
|
+
async discordListChannels() {
|
|
53
|
+
return this.request('/discord/channels');
|
|
54
|
+
}
|
|
55
|
+
async discordSendMessage(channelId, content) {
|
|
56
|
+
return this.request('/discord/send', {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
body: JSON.stringify({ channel_id: channelId, content }),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
52
61
|
}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ if (!apiKey) {
|
|
|
12
12
|
const api = new FlowRelayAPI(apiKey, process.env.FLOWRELAY_BASE_URL);
|
|
13
13
|
const server = new McpServer({
|
|
14
14
|
name: 'flowrelay',
|
|
15
|
-
version: '0.3.
|
|
15
|
+
version: '0.3.5',
|
|
16
16
|
});
|
|
17
17
|
// ── Tool: list handoffs ──────────────────────────────────────────────
|
|
18
18
|
server.tool('list_handoffs', 'List your Flow Relay handoffs. Returns recent handoffs with summaries, decisions, and next steps.', {
|
|
@@ -95,6 +95,36 @@ server.tool('list_events', 'List recent context events (commits, messages, issue
|
|
|
95
95
|
}).join('\n');
|
|
96
96
|
return { content: [{ type: 'text', text: `**Recent events:**\n${text}` }] };
|
|
97
97
|
});
|
|
98
|
+
// ── Tool: discord list channels ──────────────────────────────────────
|
|
99
|
+
server.tool('discord_list_channels', 'List text channels in your connected Discord server.', {}, async () => {
|
|
100
|
+
try {
|
|
101
|
+
const { channels } = await api.discordListChannels();
|
|
102
|
+
if (channels.length === 0) {
|
|
103
|
+
return { content: [{ type: 'text', text: 'No text channels found in the connected Discord server.' }] };
|
|
104
|
+
}
|
|
105
|
+
const text = channels.map((ch) => {
|
|
106
|
+
const topic = ch.topic ? ` — ${ch.topic}` : '';
|
|
107
|
+
return `- **#${ch.name}** (${ch.id})${topic}`;
|
|
108
|
+
}).join('\n');
|
|
109
|
+
return { content: [{ type: 'text', text: `**Discord channels:**\n${text}` }] };
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
return { content: [{ type: 'text', text: `Could not list Discord channels: ${err.message}` }] };
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// ── Tool: discord send message ──────────────────────────────────────
|
|
116
|
+
server.tool('discord_send_message', 'Send a message to a Discord channel in your connected server.', {
|
|
117
|
+
channel_id: z.string().describe('The Discord channel ID to send the message to'),
|
|
118
|
+
content: z.string().describe('The message content to send'),
|
|
119
|
+
}, async ({ channel_id, content }) => {
|
|
120
|
+
try {
|
|
121
|
+
const result = await api.discordSendMessage(channel_id, content);
|
|
122
|
+
return { content: [{ type: 'text', text: `Message sent (ID: ${result.message_id})` }] };
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
return { content: [{ type: 'text', text: `Failed to send message: ${err.message}` }] };
|
|
126
|
+
}
|
|
127
|
+
});
|
|
98
128
|
// ── Start ────────────────────────────────────────────────────────────
|
|
99
129
|
const transport = new StdioServerTransport();
|
|
100
130
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowrelay/mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Flow Relay MCP Server for Claude Desktop and Claude Code — handoffs, integrations, and context events via natural conversation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|