About MCP Server Setup Instructions
An MCP server that provides a Telegram AI agent for working with Gmail, Google Calendar, and Google Tasks, using the Ionos AI model. It is intended for users who want to search messages, manage events and tasks, and chat through Telegram.
Key features
- 01Telegram messaging
- 02Gmail message search
- 03Google Calendar event creation
- 04Google Tasks creation
- 05Ionos AI chat
Use cases
- 01Search Gmail from a Telegram conversation
- 02Create Calendar events through chat
- 03Add Google Tasks through chat
MCP support
The server exposes tools for Telegram messaging, Gmail search, Calendar events, Tasks, and Ionos AI chat to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server Setup Instructions
This MCP server provides a Telegram AI agent that can interact with Gmail, Google Calendar, and Google Tasks using the Ionos AI model.
Prerequisites
- Python 3.8 or higher
- Google Cloud Project with APIs enabled
- Telegram Bot Token
- Ionos AI API Key
Step 1: Install Dependencies
pip install -r requirements.txt
Step 2: Google Cloud Setup
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the following APIs:
- Gmail API
- Google Calendar API
- Google Tasks API
- Create OAuth2 credentials:
- Go to "Credentials" → "Create Credentials" → "OAuth client ID"
- Choose "Desktop application"
- Download the JSON file and rename it to
credentials.json - Place it in the same directory as your script
Step 3: Telegram Bot Setup
- Message @BotFather on Telegram
- Use
/newbotcommand to create a new bot - Follow the instructions and get your bot token
- Copy the token to your
.envfile
Step 4: Ionos AI Setup
- Get your API key from Ionos AI service
- Add it to your
.envfile
Step 5: Environment Configuration
- Copy
.env.exampleto.env - Fill in all the required values:
cp .env.example .env
# Edit .env with your actual values
Step 6: First Run and Authentication
- Run the server for the first time:
python mcp_server.py
-
The script will prompt you to authenticate with Google:
- A URL will be displayed
- Open it in your browser
- Grant permissions
- Copy the authorization code back to the terminal
-
Your credentials will be saved in
token.picklefor future use
Usage
Available Tools
- send_telegram_message: Send messages via Telegram
- search_gmail: Search Gmail messages
- create_calendar_event: Create Google Calendar events
- create_task: Create Google Tasks
- ai_chat: Chat with Ionos AI model
Telegram Commands
/start- Initialize the bot- Send any message to chat with the AI
Example Interactions
Search Gmail:
"Search for emails from [email protected]"
Create Calendar Event:
"Create a meeting for tomorrow at 2 PM for 1 hour about project review"
Create Task:
"Add a task to review the quarterly report by Friday"
File Structure
├── mcp_server.py # Main MCP server
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── credentials.json # Google OAuth2 credentials
├── token.pickle # Saved Google authentication token
└── README.md # This file
Security Notes
- Keep your
.envfile secure and never commit it to version control - The
token.picklefile contains sensitive authentication data - Use HTTPS in production environments
- Regularly rotate your API keys
Troubleshooting
Common Issues
- "ModuleNotFoundError": Make sure all dependencies are installed
- "Authentication failed": Check your Google credentials and re-run authentication
- "Telegram bot not responding": Verify your bot token and network connection
- "Ionos AI errors": Check your API key and rate limits
Logs
The server logs important events. Check the console output for error messages and debugging information.
Development
To extend functionality:
- Add new tools in the
setup_handlers()method - Implement corresponding methods for each tool
- Update the resource list if needed
- Test thoroughly before deploying
Production Deployment
For production use:
- Use a process manager like systemd or supervisord
- Set up proper logging
- Configure firewall rules
- Use environment-specific configuration
- Set up monitoring and alerting
API Rate Limits
Be aware of API rate limits:
- Gmail API: 1 billion quota units per day
- Calendar API: 1 million requests per day
- Tasks API: 50,000 requests per day
- Ionos AI: Check your plan limits
Support
For issues or questions:
- Check the logs for error messages
- Verify all credentials are correct
- Test individual components separately
- Check API status pages for service outages
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.