feat: log Slack MCP Server connect URL on startup#8
Conversation
zimeg
left a comment
There was a problem hiding this comment.
@mwbrooks Thanks for bringing these changes to adjacent apps too. I'm approving now with one finding that might be caused from server changes but not a blocker - this appears after MCP requests complete:
WARNING:slack_bolt.App:Unhandled request ({'type': 'event_callback', 'event': {'type': 'function_executed_success'}})
---
[Suggestion] You can handle this type of event with the following listener function:
@app.event("function_executed_success")
def handle_function_executed_success_events(body, logger):
logger.info(body)
| port = int(os.environ.get("PORT", 3000)) | ||
| redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "") | ||
| if redirect_uri: | ||
| install_url = urljoin(redirect_uri, "/slack/install") |
There was a problem hiding this comment.
🐍 praise: TIL about urljoin! It's clean implementation!
Yea, I've noticed this as well. 🤔 I didn't give it a lot of thought while putting together these apps, but we can check in with the team to see if this is intentional or not. |
|
@zimeg Thanks again for the reviews! 🙇🏻 |
Summary
This pull request logs the Slack MCP Server install URL when the OAuth HTTP server starts. When
SLACK_REDIRECT_URIis set, the app derives the origin and prints aConnect the Slack MCP Server: <origin>/slack/installmessage, making it easy for developers to find the OAuth install link.Testing
python3 app_oauth.py(orslack run app_oauth.py) withSLACK_REDIRECT_URIsetSLACK_REDIRECT_URIset and confirm no extra log line appears