tsai-s8-sse-mcp

RoyRushreeta/tsai-s8-sse-mcp

3.1

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.send scope). 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):

VariablePurpose
AGENT_INPUT_SOURCE=telegramEnables Telegram-driven queries.
TELEGRAM_BOT_TOKENBot token from BotFather.
TELEGRAM_ALLOWED_CHAT_IDSComma-separated chat IDs permitted to trigger the agent (optional but recommended).
GOOGLE_SERVICE_ACCOUNT_FILE or GOOGLE_SERVICE_ACCOUNT_JSONService account credentials for Sheets/Drive/Gmail.
GMAIL_SENDERHuman-readable “From” address for the Gmail API message (defaults to GMAIL_SEND_AS if omitted).
GMAIL_SEND_ASGmail identity to impersonate with the service account (e.g. your email). Required when using domain delegation.
GMAIL_RECIPIENTAddress 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 for GMAIL_SEND_AS.
  • AGENT_TELEGRAM_TOOL — custom Telegram tool name (defaults to fetch_telegram_query).
  • AGENT_TELEGRAM_TOOL_ARGS — JSON payload with extra arguments for the Telegram tool.

Running the Workflow

  1. Activate the Python environment and ensure dependencies are installed.
  2. 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 via python mcp_server_sse.py --host 127.0.0.1 --port 8320.
  3. Send a Telegram message such as “Find the Current Point Standings of F1 Racers”.
  4. 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.