diff --git a/claude-agent-sdk/README.md b/claude-agent-sdk/README.md index a911a84..982fa1d 100644 --- a/claude-agent-sdk/README.md +++ b/claude-agent-sdk/README.md @@ -11,7 +11,11 @@ The starter agent interacts with users through four entry points: * **Channel @mentions** — Mention the agent in any channel to get a response without leaving the conversation. * **Assistant Panel** — Users click _Add Agent_ in Slack, select the agent, and pick from suggested prompts or type a message. -When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. +The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. + +### Slack MCP Server + +When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. When deployed with OAuth (HTTP mode), the agent automatically connects to the Slack MCP Server using the user's token. ## Setup diff --git a/claude-agent-sdk/listeners/views/app_home_builder.py b/claude-agent-sdk/listeners/views/app_home_builder.py index d317218..d70b79e 100644 --- a/claude-agent-sdk/listeners/views/app_home_builder.py +++ b/claude-agent-sdk/listeners/views/app_home_builder.py @@ -73,6 +73,27 @@ def build_app_home_view( ], } ) + else: + blocks.append( + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "\U0001f534 *Slack MCP Server is disconnected.* ", + }, + } + ) + blocks.append( + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "The Slack MCP Server enables the assistant to search messages, read channels, and more.", + } + ], + } + ) return { "type": "home", diff --git a/claude-agent-sdk/tests/test_view_builders.py b/claude-agent-sdk/tests/test_view_builders.py index 71cdb2c..72decef 100644 --- a/claude-agent-sdk/tests/test_view_builders.py +++ b/claude-agent-sdk/tests/test_view_builders.py @@ -13,7 +13,7 @@ def test_build_feedback_blocks(): def test_build_app_home_view_default(): - """Default args (app.py mode) — no MCP status section.""" + """Default args (Socket Mode) — shows disconnected status with learn-more link.""" view = build_app_home_view() assert view["type"] == "home" @@ -23,11 +23,13 @@ def test_build_app_home_view_default(): assert "header" in block_types assert "section" in block_types - # No MCP status section + # Shows MCP status as disconnected with learn-more link section_texts = [ b["text"]["text"] for b in view["blocks"] if b["type"] == "section" ] - assert not any("Slack MCP Server" in t for t in section_texts) + mcp_section = next(t for t in section_texts if "Slack MCP Server" in t) + assert "disconnected" in mcp_section + assert "Learn how to enable" in mcp_section def test_build_app_home_view_connect(): diff --git a/openai-agents-sdk/README.md b/openai-agents-sdk/README.md index 5b1ec93..7d179d8 100644 --- a/openai-agents-sdk/README.md +++ b/openai-agents-sdk/README.md @@ -11,7 +11,11 @@ The starter agent interacts with users through four entry points: * **Channel @mentions** — Mention the agent in any channel to get a response without leaving the conversation. * **Assistant Panel** — Users click _Add Agent_ in Slack, select the agent, and pick from suggested prompts or type a message. -When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. +The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. + +### Slack MCP Server + +When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. When deployed with OAuth (HTTP mode), the agent automatically connects to the Slack MCP Server using the user's token. ## Setup diff --git a/openai-agents-sdk/listeners/views/app_home_builder.py b/openai-agents-sdk/listeners/views/app_home_builder.py index d317218..089184d 100644 --- a/openai-agents-sdk/listeners/views/app_home_builder.py +++ b/openai-agents-sdk/listeners/views/app_home_builder.py @@ -73,6 +73,27 @@ def build_app_home_view( ], } ) + else: + blocks.append( + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "\U0001f534 *Slack MCP Server is disconnected.* ", + }, + } + ) + blocks.append( + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "The Slack MCP Server enables the agent to search messages, read channels, and more.", + } + ], + } + ) return { "type": "home", diff --git a/openai-agents-sdk/tests/test_view_builders.py b/openai-agents-sdk/tests/test_view_builders.py index 71cdb2c..72decef 100644 --- a/openai-agents-sdk/tests/test_view_builders.py +++ b/openai-agents-sdk/tests/test_view_builders.py @@ -13,7 +13,7 @@ def test_build_feedback_blocks(): def test_build_app_home_view_default(): - """Default args (app.py mode) — no MCP status section.""" + """Default args (Socket Mode) — shows disconnected status with learn-more link.""" view = build_app_home_view() assert view["type"] == "home" @@ -23,11 +23,13 @@ def test_build_app_home_view_default(): assert "header" in block_types assert "section" in block_types - # No MCP status section + # Shows MCP status as disconnected with learn-more link section_texts = [ b["text"]["text"] for b in view["blocks"] if b["type"] == "section" ] - assert not any("Slack MCP Server" in t for t in section_texts) + mcp_section = next(t for t in section_texts if "Slack MCP Server" in t) + assert "disconnected" in mcp_section + assert "Learn how to enable" in mcp_section def test_build_app_home_view_connect(): diff --git a/pydantic-ai/README.md b/pydantic-ai/README.md index bdbc2d3..4b64dd0 100644 --- a/pydantic-ai/README.md +++ b/pydantic-ai/README.md @@ -11,7 +11,11 @@ The starter agent interacts with users through four entry points: * **Channel @mentions** — Mention the agent in any channel to get a response without leaving the conversation. * **Assistant Panel** — Users click _Add Agent_ in Slack, select the agent, and pick from suggested prompts or type a message. -When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. +The template also includes one example tool (emoji reactions). Add your own tools to customize it for your use case. + +### Slack MCP Server + +When connected to the [Slack MCP Server](https://github.com/slackapi/slack-mcp-server), the agent can search messages and files, read channel history and threads, send and schedule messages, and create and update canvases. When deployed with OAuth (HTTP mode), the agent automatically connects to the Slack MCP Server using the user's token. ## Setup diff --git a/pydantic-ai/listeners/views/app_home_builder.py b/pydantic-ai/listeners/views/app_home_builder.py index d317218..961cc5a 100644 --- a/pydantic-ai/listeners/views/app_home_builder.py +++ b/pydantic-ai/listeners/views/app_home_builder.py @@ -73,6 +73,27 @@ def build_app_home_view( ], } ) + else: + blocks.append( + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "\U0001f534 *Slack MCP Server is disconnected.* ", + }, + } + ) + blocks.append( + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "The Slack MCP Server enables the assistant to search messages, read channels, and more.", + } + ], + } + ) return { "type": "home", diff --git a/pydantic-ai/tests/test_view_builders.py b/pydantic-ai/tests/test_view_builders.py index 71cdb2c..72decef 100644 --- a/pydantic-ai/tests/test_view_builders.py +++ b/pydantic-ai/tests/test_view_builders.py @@ -13,7 +13,7 @@ def test_build_feedback_blocks(): def test_build_app_home_view_default(): - """Default args (app.py mode) — no MCP status section.""" + """Default args (Socket Mode) — shows disconnected status with learn-more link.""" view = build_app_home_view() assert view["type"] == "home" @@ -23,11 +23,13 @@ def test_build_app_home_view_default(): assert "header" in block_types assert "section" in block_types - # No MCP status section + # Shows MCP status as disconnected with learn-more link section_texts = [ b["text"]["text"] for b in view["blocks"] if b["type"] == "section" ] - assert not any("Slack MCP Server" in t for t in section_texts) + mcp_section = next(t for t in section_texts if "Slack MCP Server" in t) + assert "disconnected" in mcp_section + assert "Learn how to enable" in mcp_section def test_build_app_home_view_connect():