Skip to content

Commit 726f3e5

Browse files
committed
feat: Log Slack MCP Server install URL on startup
1 parent 092fefb commit 726f3e5

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

claude-agent-sdk/app_oauth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
from pathlib import Path
5+
from urllib.parse import urljoin
56

67
from dotenv import load_dotenv
78
from slack_bolt.async_app import AsyncApp
@@ -120,4 +121,8 @@ async def _authorize_with_fallback_bot_token(
120121

121122
if __name__ == "__main__":
122123
port = int(os.environ.get("PORT", 3000))
124+
redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "")
125+
if redirect_uri:
126+
install_url = urljoin(redirect_uri, "/slack/install")
127+
logger.info("Connect the Slack MCP Server: %s", install_url)
123128
app.start(port=port)

openai-agents-sdk/app_oauth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
from pathlib import Path
5+
from urllib.parse import urljoin
56

67
from dotenv import load_dotenv
78
from slack_bolt import App
@@ -120,4 +121,8 @@ def _authorize_with_fallback_bot_token(
120121

121122
if __name__ == "__main__":
122123
port = int(os.environ.get("PORT", 3000))
124+
redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "")
125+
if redirect_uri:
126+
install_url = urljoin(redirect_uri, "/slack/install")
127+
logger.info("Connect the Slack MCP Server: %s", install_url)
123128
app.start(port=port)

pydantic-ai/app_oauth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
from pathlib import Path
5+
from urllib.parse import urljoin
56

67
from dotenv import load_dotenv
78
from slack_bolt import App
@@ -122,4 +123,8 @@ def _authorize_with_fallback_bot_token(
122123

123124
if __name__ == "__main__":
124125
port = int(os.environ.get("PORT", 3000))
126+
redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "")
127+
if redirect_uri:
128+
install_url = urljoin(redirect_uri, "/slack/install")
129+
logger.info("Connect the Slack MCP Server: %s", install_url)
125130
app.start(port=port)

0 commit comments

Comments
 (0)