MCP Personal Assistant Agent

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides integration with Google API for calendar management and email functionality, allowing access to events, creating new events, reading and sending emails.

  • Enables smart home control through Home Assistant, providing capabilities to list devices, control them, and get detailed information about device states.

MCP 个人助理代理

使用模型上下文协议 (MCP) 构建的多功能个人助理 AI 代理,可帮助处理日历、任务、电子邮件等。

概述

该项目是一个模型上下文协议 (MCP) 服务器,为个人助理代理提供了一套工具。它可以与 Claude for Desktop 等 MCP 客户端集成,使 AI 助理能够:

  • 管理日历事件
  • 跟踪任务和待办事项
  • 阅读和发送电子邮件
  • 搜索网络并检索信息
  • 控制智能家居设备

要求

⚠️重要提示: MCP SDK 需要 Python 3.10 或更高版本。服务器不支持更低版本的 Python。

  • Python 3.10+
  • MCP SDK 1.2.0+
  • 所需的 Python 包(请参阅 requirements.txt)

安装

  1. 克隆存储库:
git clone https://github.com/yourusername/mcp-pa-ai-agent.git cd mcp-pa-ai-agent
  1. 确保您拥有 Python 3.10+:
python --version
  1. 如果您的系统 Python 版本早于 3.10,请设置兼容环境:
# Using conda conda create -n mcp-env python=3.10 conda activate mcp-env # OR using venv (if Python 3.10+ is installed elsewhere) python3.10 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. 安装依赖项:
pip install -r requirements.txt
  1. 通过复制示例文件来配置环境变量:
cp .env.example .env
  1. 使用您的 API 凭证和设置编辑.env文件。

运行服务器

使用以下命令启动 MCP 服务器:

python mcp_server.py

服务器将启动并监听 MCP 客户端连接。

连接到 Claude 桌面版

  1. 安装Claude 桌面版
  2. 通过编辑配置文件来配置 Claude for Desktop 以使用此 MCP 服务器:
    • MacOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 添加以下配置:
{ "mcpServers": { "personal-assistant": { "command": "/path/to/python", "args": [ "/absolute/path/to/mcp-pa-ai-agent/mcp_server.py" ] } } }

如果您使用虚拟环境,请确保指向该环境中的 Python 可执行文件。

  1. 重启 Claude 桌面版

可用工具

日历

  • get_events :检索即将发生的日历事件
  • create_event :安排新的日历事件

任务

  • list_tasks :查看所有任务或按状态过滤
  • add_task :创建新任务
  • update_task_status :将任务标记为待处理、进行中或已完成

电子邮件

  • get_emails :列出收件箱中的最近电子邮件
  • read_email :查看特定电子邮件的完整内容
  • send_email :撰写并发送新电子邮件

知识

  • web_search :在网络上搜索信息
  • get_weather :获取当前天气信息
  • get_news :检索最新新闻文章

智能家居

  • list_devices :查看所有智能家居设备
  • control_device :控制智能家居设备(灯、恒温器等)
  • get_device_state :获取有关设备当前状态的详细信息

配置

服务器需要各种 API 密钥和凭证来访问不同的服务:

  • Google API :用于日历和电子邮件功能(OAuth2 凭证)
  • 天气 API :获取天气信息
  • 新闻 API :用于新闻检索
  • 家庭助理:用于智能家居控制

请参阅.env.example文件以了解所有可配置选项。

故障排除

Python 版本问题

如果您看到如下错误:

Error: Python 3.10 or higher is required for the MCP server.

您需要升级您的 Python 版本或使用 Python 3.10+ 的虚拟环境。

MCP SDK 安装问题

如果您在安装 MCP SDK 时遇到问题:

ERROR: Could not find a version that satisfies the requirement mcp>=1.2.0

确保您使用的是 Python 3.10+ 并且 pip 已更新:

pip install --upgrade pip

发展

要向服务器添加新功能,您可以:

  1. modules/目录中创建一个新模块
  2. 使用@mcp.tool()装饰器实现函数
  3. mcp_server.py中导入您的模块

执照

麻省理工学院

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

-
security - not tested
F
license - not found
-
quality - not tested

多功能模型上下文协议服务器,使 AI 助手能够管理日历、跟踪任务、处理电子邮件、搜索网页和控制智能家居设备。

  1. Overview
    1. Requirements
      1. Installation
        1. Running the Server
          1. Connecting to Claude for Desktop
            1. Available Tools
              1. Calendar
              2. Tasks
              3. Email
              4. Knowledge
              5. Smart Home
            2. Configuration
              1. Troubleshooting
                1. Python Version Issues
                2. MCP SDK Installation Issues
              2. Development
                1. License
                  1. Contributing
                    ID: sjtdv0xex1