Build a CLI or Telegram agent with Hermes and Civic’s MCP Hub
Connect a Hermes agent to Civic using its native MCP support. Hermes is a Python CLI agent framework powered by Anthropic’s Claude that supports MCP for external tool access — pair it with Civic’s MCP gateway to give your agent secure access to Gmail, Google Calendar, and 80+ other services.
# Your full Civic toolkit URL — MUST be wrapped in double quotes# because the URL contains & characters that bash interprets otherwiseCIVIC_URL="https://app.civic.com/hub/mcp?profile=your-toolkit&lock=true"# Civic token generated from app.civic.com → Install → MCP URLCIVIC_TOKEN=your-civic-token# Your Anthropic API keyANTHROPIC_API_KEY=your-anthropic-key
The CIVIC_URL contains & characters. Always wrap it in double quotes in your .env file — otherwise bash interprets & as a background operator and silently truncates the URL.
Get Your Credentials
How to generate a Civic token and configure toolkit URL parameters
Hermes also supports running as a Telegram bot. Add your bot token to .env:
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
Then run the bot:
uv run python telegram_bot.py
The bot supports per-user conversation history, automatic message chunking for Telegram’s 4,096-character limit, and background typing indicators during tool calls.
When a profile is specified, the session is locked by default — the agent cannot switch toolkits or modify its own guardrails. This prevents prompt injection attacks from escaping the defined tool scope.