personal-assistant-example

MCP.Pizza Chef: mastra-ai

The personal-assistant-example is a client built with Mastra and MCP that acts as a versatile personal assistant. It integrates multiple MCP servers to manage emails, monitor GitHub activity, schedule social media posts, retrieve weather updates, and track todo lists. It automates daily workflows by aggregating information from various sources, enabling streamlined task and information management in one agent.

Use This MCP client To

Manage and categorize emails via Gmail integration Monitor and summarize GitHub pull requests and commits Create and schedule tweets using Typefully Retrieve current weather information for any location Search and fetch stories and comments from Hacker News Track and manage todo lists stored in the filesystem Run automated daily workflows for news and GitHub summaries

README

Personal Assistant Agent

An example personal assistant built with Mastra and MCP (Model Context Protocol) that helps with various daily tasks and information management.

Features

This personal assistant can help with:

  • Email Management: Read, categorize, and send emails through Gmail
  • GitHub Activity: Monitor and summarize GitHub activity, including PRs and commits
  • Social Media Scheduling: Create and manage tweet drafts with Typefully
  • Weather Information: Get current weather conditions for any location
  • Hacker News: Search for and retrieve stories and comments from Hacker News
  • Todo Lists: Keep track of tasks and important items using the filesystem
  • Daily Workflow: Run automated workflows to get summaries of news and GitHub activity

How It Works

The personal assistant is built using Mastra's agent framework and leverages MCP servers to connect to various services.

Agent Architecture

The core of the application is the personalAssistantAgent which:

  • Uses GPT-4o as its underlying model
  • Has access to various tools through MCP connections
  • Maintains memory of conversations and user preferences
  • Can execute workflows for complex, multi-step tasks

MCP Servers

The assistant connects to several MCP servers:

  • Zapier: For automation and connecting to various services
  • GitHub: For monitoring repository activity
  • Hacker News: For retrieving tech news
  • Text Editor: For managing notes and todo lists

Tools

The assistant includes custom tools like:

  • Weather Tool: Fetches current weather conditions using open-meteo API
  • Daily Workflow Tool: Runs a sequence of steps to gather and summarize information

Workflows

The application includes a daily workflow that:

  1. Fetches relevant Hacker News stories based on user interests
  2. Summarizes recent PRs from the Mastra repository
  3. Combines this information into a daily briefing

Telegram Bot

The application connects with a Telegram bot to handle user interactions and provide responses.

  • The code for this bot is in src/mastra/integrations/telegram.ts and it's used in src/mastra/index.ts.
  • You can get your Telegram bot token from BotFather.

Getting Started

  1. Clone this repository
  2. Create a .env.development file with the required API keys:
    OPENAI_API_KEY=your_openai_api_key
    ZAPIER_MCP_URL=your_zapier_mcp_url
    COMPOSIO_MCP_GITHUB=your_github_mcp_url
    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
    
  3. Install dependencies:
    pnpm install
    
  4. Run the dev playground:
    pnpm run dev
    

Customization

You can customize the assistant by:

  • Modifying the agent instructions in src/mastra/agents/index.ts
  • Adding new tools in src/mastra/tools/index.ts
  • Creating new workflows in src/mastra/workflows/index.ts
  • Adjusting memory settings for better personalization

Dependencies

  • @ai-sdk/openai: For connecting to OpenAI models
  • @mastra/core: Core Mastra functionality
  • @mastra/memory: For conversation and working memory
  • @mastra/mcp: For Model Context Protocol integration
  • zod: For schema validation

Notes

This assistant uses a notes directory to store information for later use. The notes can be used to keep track of todo list items and other important information that should persist between sessions.

personal-assistant-example FAQ

How does the personal-assistant-example connect to external services?
It uses MCP servers as adapters to securely connect and interact with services like Gmail, GitHub, Typefully, and weather APIs.
Can I customize the workflows in the personal-assistant-example?
Yes, the agent framework allows you to modify or extend workflows to fit your specific daily task needs.
Is the personal-assistant-example limited to the included services?
No, you can add additional MCP servers to integrate more services as needed.
How does the personal-assistant-example handle authentication?
Authentication is managed through the MCP servers connecting to each service, typically using OAuth or API keys.
Can this client run on different platforms?
Yes, as an MCP client built with Mastra, it can run wherever the Mastra agent framework and MCP client are supported.
Does the personal-assistant-example support real-time updates?
It can fetch real-time data by querying MCP servers, depending on the service capabilities.
How secure is the data handled by the personal-assistant-example?
Data security depends on the MCP servers and the underlying service authentication; MCP enforces scoped and observable interactions.
Can I extend the personal-assistant-example to include my own custom tools?
Yes, the architecture supports adding custom MCP servers or tools to expand functionality.