Skip to content

Instantly share code, notes, and snippets.

View seratch's full-sized avatar

Kazuhiro Sera seratch

View GitHub Profile
@seratch
seratch / app.py
Created March 27, 2025 17:11
OpenAI Agents SDK + Slack MCP Server Example
#
# OpenAI Agents SDK MCP server example
#
# How to run this app:
# $ pip install -U openai-agents
# $ python app.py
#
# See also:
# - https://openai.github.io/openai-agents-python/mcp/
# - https://github.com/openai/openai-agents-python/tree/main/examples/mcp
@seratch
seratch / app.py
Last active March 26, 2025 21:31
OpenAI Agents SDK MCP server example
#
# OpenAI Agents SDK MCP server example
#
# How to run this app:
# $ pip install -U openai-agents
# $ python app.py
#
# See also:
# - https://openai.github.io/openai-agents-python/mcp/
# - https://github.com/openai/openai-agents-python/tree/main/examples/mcp
@seratch
seratch / app-manifest.yml
Created November 14, 2023 07:06
file input block in bolt-python apps
display_information:
name: file-uploader
features:
bot_user:
display_name: file-uploader
slash_commands:
- command: /send-files
description: Send files on a modal
should_escape: false
oauth_config:
@seratch
seratch / app.ts
Created March 31, 2022 05:39
@slack/bolt meets Fastify
import Fastify from 'fastify';
import { App, FileInstallationStore, LogLevel } from '@slack/bolt';
import { FileStateStore } from '@slack/oauth';
import { FastifyReceiver } from 'slack-bolt-fastify';
const fastify = Fastify({ logger: true });
fastify.get('/', async (_, res) => {
res.redirect('/slack/install');
});
@seratch
seratch / app.py
Last active October 2, 2024 05:48
Hot-reloading Socket Mode app using Jurigged (Python) - `SLACK_LOCAL_DEV=1 python app.py`
# You can run this script by `SLACK_LOCAL_DEV=1 python app.py`
import os
if os.environ.get("SLACK_LOCAL_DEV") == "1":
# Hot reloading https://github.com/breuleux/jurigged
import jurigged
jurigged.watch()
# Debug logging
import logging
logging.basicConfig(level=logging.DEBUG)
@seratch
seratch / MyApp.kt
Created August 11, 2021 04:36
Sign in with Slack (OpenID Connect) Example App in Kotlin
import com.auth0.jwt.JWT
import com.slack.api.Slack
import com.slack.api.bolt.App
import com.slack.api.bolt.jetty.SlackAppServer
fun main() {
System.setProperty("org.slf4j.simpleLogger.log.com.slack.api", "debug")
// export SLACK_CLIENT_ID=
// export SLACK_CLIENT_SECRET=
@seratch
seratch / MyApp.kt
Last active May 23, 2021 21:59
Send Slack saved Items to Notion Database
import com.slack.api.Slack
import com.slack.api.bolt.App
import com.slack.api.bolt.AppConfig
import com.slack.api.bolt.jetty.SlackAppServer
import com.slack.api.model.event.StarAddedEvent
import notion.api.v1.NotionClient
import notion.api.v1.http.JavaNetHttpClient
import notion.api.v1.logging.Slf4jLogger
import notion.api.v1.model.common.PropertyType
import notion.api.v1.model.common.RichTextLinkType
@seratch
seratch / Dockerfile
Last active May 20, 2021 00:16
Bolt for Python: AWS App Runner Example
# https://gallery.ecr.aws/e5d9f5q7/aws-app-runner-bolt-python
FROM python:3.9.5-slim-buster
EXPOSE 8000
WORKDIR /app/
COPY requirements.txt /app/
COPY app.py /app/
RUN pip install -r requirements.txt
CMD python /app/app.py
@seratch
seratch / README.md
Last active March 31, 2024 13:43
Sign in with Slack - the simplest example

You can run this app by following the steps below:

Set up your Slack app

  • Create a new Slack app from https://api.slack.com/apps?new_app=1
  • Go to OAuth & Permissions
    • Add identity.basic & identity.email to User Token Scopes
    • Add OAuth Redirect URL
  • Go to Basic Information
  • Grab the Client ID & Client Secret in the page
@seratch
seratch / app.py
Last active August 21, 2024 04:01
Two Slack App Installation Flow Example (Flask + SQLAlchemy)
import logging
from typing import Callable
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
import os
from slack_bolt import App, BoltContext, Ack
from slack_bolt.adapter.flask import SlackRequestHandler
from slack_bolt.oauth.oauth_settings import OAuthSettings