feat: add Slack MCP Server support as HTTP Server#47
Conversation
Add app_oauth.py as an alternative to app.py that starts an HTTP server instead of using Socket Mode. Include manifest_oauth.json with request URLs configured for ngrok and update READMEs with setup instructions.
Add a toggle button to the App Home that tracks account connection state using an in-memory store. This is a placeholder for the real OAuth flow.
This reverts commit 9fe578d.
Replace the deep-link authorize URL with the standard /slack/install path for the App Home connect link. Remove the MCP server try/except fallback from run_casey() to avoid silently dropping all MCP tools on connection errors. Clean up unused AuthorizeUrlGenerator.
| # oauth data | ||
| data/ |
There was a problem hiding this comment.
question: Is data/ the standard directory name? Or, should we use something more specific?
| USER_SCOPES = [ | ||
| "search:read", | ||
| "channels:history", | ||
| "channels:read", | ||
| "groups:history", | ||
| "groups:read", | ||
| "im:history", | ||
| "mpim:history", | ||
| "users:read", | ||
| ] |
There was a problem hiding this comment.
note: These scopes should match what's in the manifest file
…ents-sdk Port all pydantic-ai branch changes to the other two implementations: - Add Slack MCP Server integration with OAuth user token - Replace button-based App Home UI with text-based MCP status - Use AsyncOAuthSettings for claude-agent-sdk's AsyncApp - Add MCP setup steps to README OAuth sections - Expand user scopes for MCP capabilities - Update system prompt with Slack MCP Server section - Simplify app_home_opened to use context.user_token
RunContextWrapper.context IS the CaseyDeps instance directly — unlike Pydantic AI's RunContext which has a .deps property. The incorrect .deps access raised AttributeError silently caught by the SDK.
Prevents accidentally committing App IDs from maintainer environments. This top-level gitignore is not part of the app templates.
Update the agent system prompt and tool descriptions so the agent tries to look up the user's email from their Slack profile before triggering a password reset, falling back to asking the user if the lookup fails.
…le file Merge both manifests into a single manifest.json per directory. The superset manifest includes user scopes and placeholder URLs using ngrok-free.app, which validates against Slack's schema. For HTTP/OAuth mode, developers just set socket_mode_enabled to false and replace ngrok-free.app with their ngrok domain.
WilliamBergamin
left a comment
There was a problem hiding this comment.
Very nice work on this 💯 🚀
| redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "") | ||
| install_url = urljoin(redirect_uri, "/slack/install") |
There was a problem hiding this comment.
Nice 💯 I like this better then what I did before
| @@ -0,0 +1,89 @@ | |||
| import json | |||
There was a problem hiding this comment.
When working on the project I was wondering if we could actually move this logic at the top of app_oauth.py that way everything is in one file 🤔
There was a problem hiding this comment.
I would love to do that! When I originally tried, it caused a circular dependency with app_home_opened.py. But maybe our new approach removed those dependencies entirely 👀 I'll make a note to look.
There was a problem hiding this comment.
Great suggestion @WilliamBergamin! I've been able to combine app_oauth.py and oauth.py now, which is much better!
Commit 13a37ea
| [tool.ruff.format] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| asyncio_mode = "auto" |
There was a problem hiding this comment.
Not sure we need this since the sample uses sync python 🤔
There was a problem hiding this comment.
Good call @WilliamBergamin!
Since we use the @pytest.mark.asyncio decorators on the async tests, we can use asyncio_mode = "strict" and because strict is the default, we can remove it entirely. The auto allows async tests to skip the decorator and automatically run as an async test. But generally I prefer the explicit use of the decorator and it's one less configuration setting.
Commit 9fb82fe
Type of change
Summary
This pull request adds Slack MCP Server support. The MCP Server currently support User Tokens, so it requires OAuth and a HTTP Server. The goal is to allow Casey to run as a Socket Mode server without the Slack MCP Server or as a HTTP Server with Slack MCP Server support.
app_oauth.pyas an alternative toapp.pythat starts an HTTP server instead of using Socket Mode.manifest.jsonfor Socket Mode and HTTP configured for ngrok.README.mdfiles with setup instructions.Reviewers
Requirements