From 1ae37946df23146a0035686eb0a225b6cce18109 Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Tue, 31 Mar 2026 23:35:33 -0500 Subject: Add /help, /unbind, PM permissions, DM /meta, Slack file support, systemd service --- mcp_dispatcher.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mcp_dispatcher.py') diff --git a/mcp_dispatcher.py b/mcp_dispatcher.py index 8148f58..4fb52c7 100644 --- a/mcp_dispatcher.py +++ b/mcp_dispatcher.py @@ -267,6 +267,23 @@ async def send_slack_message(channel: str, message: str, thread_ts: str = "") -> return "Slack 消息已发送。" +@mcp.tool() +async def send_file_to_slack(filename: str, channel: str, caption: str = "") -> str: + """Send a file from broker storage to a Slack channel. + filename: file name in broker storage (use list_files to see available files) + channel: Slack channel ID + caption: optional description + """ + async with httpx.AsyncClient(timeout=60) as client: + resp = await client.post( + f"{BROKER_URL}/slack/send_file", + headers=HEADERS, + data={"filename": filename, "channel": channel, "caption": caption}, + ) + resp.raise_for_status() + return "File sent to Slack." + + @mcp.tool() async def check_context_usage(session: str = "dispatcher") -> str: """查看指定 session 的 context 使用情况。 -- cgit v1.2.3