RoyRushreeta/tsai-s8-sse-mcp
If you are the rightful owner of tsai-s8-sse-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Cortex-R Automation Workflow is a sophisticated system that integrates Telegram, Google Sheets, and Gmail through an SSE-based MCP server, enabling seamless execution of assignment workflows via MCP function calls.
Cortex-R Automation Workflow
This workspace now includes an SSE-based MCP server that bridges Telegram, Google Sheets, and Gmail so the agent can execute the required assignment workflow entirely through MCP function calls.
Prerequisites
- Create a Telegram bot and note its token.
- Provision a Google service account with access to Sheets/Drive and Gmail (
gmail.sendscope). If you are on Google Workspace, enable domain-wide delegation for the account and authorise the scopes in the Admin console. - Install project dependencies:
uv pip install -e .(or the equivalent for your environment).
Required Environment Variables
Set these values (e.g. in a .env file or your shell):
| Variable | Purpose |
|---|---|
AGENT_INPUT_SOURCE=telegram | Enables Telegram-driven queries. |
TELEGRAM_BOT_TOKEN | Bot token from BotFather. |
TELEGRAM_ALLOWED_CHAT_IDS | Comma-separated chat IDs permitted to trigger the agent (optional but recommended). |
GOOGLE_SERVICE_ACCOUNT_FILE or GOOGLE_SERVICE_ACCOUNT_JSON | Service account credentials for Sheets/Drive/Gmail. |
GMAIL_SENDER | Human-readable “From” address for the Gmail API message (defaults to GMAIL_SEND_AS if omitted). |
GMAIL_SEND_AS | Gmail identity to impersonate with the service account (e.g. your email). Required when using domain delegation. |
GMAIL_RECIPIENT | Address that receives the sheet link (defaults to GMAIL_SEND_AS if omitted). |
Optional tweaks:
GOOGLE_SHEET_TITLE— override the sheet base title (timestamp is appended for uniqueness).GOOGLE_SHEET_PUBLIC=true— make the sheet link public.GOOGLE_SERVICE_ACCOUNT_SUBJECT— optional alias forGMAIL_SEND_AS.AGENT_TELEGRAM_TOOL— custom Telegram tool name (defaults tofetch_telegram_query).AGENT_TELEGRAM_TOOL_ARGS— JSON payload with extra arguments for the Telegram tool.
Running the Workflow
- Activate the Python environment and ensure dependencies are installed.
- Launch the agent:
python agent.py.- The SSE MCP server (
mcp_server_sse.py) auto-starts using the profile configuration; you can also run it manually viapython mcp_server_sse.py --host 127.0.0.1 --port 8320.
- The SSE MCP server (
- Send a Telegram message such as “Find the Current Point Standings of F1 Racers”.
- The agent will:
- Pull the Telegram message via the SSE MCP server.
- Invoke
run_f1_standings_workflow(or the individual tools) to fetch F1 standings, create a fresh Google Sheet, and capture the shareable link. - Email the sheet link through the Gmail API.
Logs in the console confirm each step; the final answer is printed once the workflow completes.