summaryrefslogtreecommitdiff
path: root/mcp_dispatcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'mcp_dispatcher.py')
-rw-r--r--mcp_dispatcher.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/mcp_dispatcher.py b/mcp_dispatcher.py
index 8148f58..4fb52c7 100644
--- a/mcp_dispatcher.py
+++ b/mcp_dispatcher.py
@@ -268,6 +268,23 @@ async def send_slack_message(channel: str, message: str, thread_ts: str = "") ->
@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 使用情况。
session: tmux session 名。默认 dispatcher。可填 claude/claude2/claude3 查 lab worker(需要 lab 端可达)。