Skip to main content
Glama

Python Apple MCP

by jxnl

Python Apple MCP (モデルコンテキストプロトコル)

FastMCP を使用して、連絡先、メモ、メール、メッセージ、リマインダー、カレンダー、マップなどの macOS アプリケーションとのやり取りを処理するサーバーの Python 実装。

特徴

  • AppleScript を通じて macOS ネイティブアプリケーションと対話する
  • パフォーマンス向上のための非同期操作
  • 包括的なエラー処理
  • Pydantic モデルを使用した型安全なインターフェース
  • 広範なテスト範囲
  • 簡単に拡張できるモジュール設計

サポートされているアプリケーション

  • 連絡先
  • 注記
  • 郵便
  • メッセージ
  • リマインダー
  • カレンダー
  • 地図

インストール

  1. リポジトリをクローンします。
git clone https://github.com/jxnl/python-apple-mcp.git cd python-apple-mcp
  1. 仮想環境を作成します。
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. 依存関係をインストールします:
pip install -r requirements.txt
  1. テストの依存関係をインストールします(オプション):
pip install -r requirements-test.txt

使用法

基本的な例

from apple_mcp import FastMCP, Context # Initialize FastMCP server mcp = FastMCP("Apple MCP") # Use the tools @mcp.tool() def find_contact(name: str) -> List[Contact]: """Search for contacts by name""" # Implementation here pass # Run the server if __name__ == "__main__": mcp.run()

個々のモジュールの使用

from utils.contacts import ContactsModule from utils.notes import NotesModule # Initialize modules contacts = ContactsModule() notes = NotesModule() # Use the modules async def main(): # Find a contact contact = await contacts.find_contact("John") # Create a note await notes.create_note( title="Meeting Notes", body="Discussion points...", folder_name="Work" ) # Run the async code import asyncio asyncio.run(main())

テスト

テスト スイートを実行します。

pytest

カバレッジ付きのテストを実行します。

pytest --cov=utils tests/

特定のテスト ファイルを実行します。

pytest tests/test_contacts.py

APIドキュメント

連絡先モジュール

  • find_contact(name: str) -> List[Contact] : 名前で連絡先を検索する
  • get_all_contacts() -> List[Contact] : すべての連絡先を取得する
  • create_contact(name: str, phones: List[str]) -> Contact : 新しい連絡先を作成する

ノートモジュール

  • find_note(query: str) -> List[Note] : ノートを検索する
  • create_note(title: str, body: str, folder_name: str) -> Note : 新しいノートを作成する
  • get_all_notes() -> List[Note] : すべてのノートを取得する

メールモジュール

  • send_email(to: str, subject: str, body: str) -> str : メールを送信する
  • search_emails(query: str) -> List[Email] : メールを検索
  • get_unread_mails() -> List[Email] : 未読メールを取得する

メッセージモジュール

  • send_message(to: str, content: str) -> bool : iMessageを送信する
  • read_messages(phone_number: str) -> List[Message] : メッセージを読む
  • schedule_message(to: str, content: str, scheduled_time: str) -> Dict : メッセージをスケジュールする

リマインダーモジュール

  • create_reminder(name: str, list_name: str, notes: str, due_date: str) -> Dict : リマインダーを作成する
  • search_reminders(query: str) -> List[Dict] : リマインダーを検索
  • get_all_reminders() -> List[Dict] : すべてのリマインダーを取得する

カレンダーモジュール

  • create_event(title: str, start_date: str, end_date: str, location: str, notes: str) -> Dict : イベントを作成する
  • search_events(query: str) -> List[Dict] : イベントを検索する
  • get_events() -> List[Dict] : すべてのイベントを取得する

マップモジュール

  • search_locations(query: str) -> List[Location] : 場所を検索する
  • get_directions(from_address: str, to_address: str, transport_type: str) -> str : 道順を取得する
  • save_location(name: str, address: str) -> Dict : 場所をお気に入りに保存する

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成する
  3. 変更をコミットする
  4. ブランチにプッシュする
  5. プルリクエストを作成する

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

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

local-only server

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

非同期操作と型セーフなインターフェースを備え、AppleScript を介して macOS ネイティブ アプリケーション (連絡先、メモ、メール、メッセージ、リマインダー、カレンダー、マップ) とのやり取りを可能にする Python サーバーです。

  1. 特徴
    1. サポートされているアプリケーション
      1. インストール
        1. 使用法
          1. 基本的な例
          2. 個々のモジュールの使用
        2. テスト
          1. APIドキュメント
            1. 連絡先モジュール
            2. ノートモジュール
            3. メールモジュール
            4. メッセージモジュール
            5. リマインダーモジュール
            6. カレンダーモジュール
            7. マップモジュール
          2. 貢献
            1. ライセンス

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                This is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.
                Last updated -
                Python
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.
                Last updated -
                4
                Python
              • A
                security
                F
                license
                A
                quality
                A local server that enables Claude Desktop to interact with your macOS Contacts and Messages apps, allowing you to search contacts and send iMessages through natural language commands.
                Last updated -
                2
                1
                JavaScript
                • Apple
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants to interact with Apple Reminders on macOS, allowing users to view lists, retrieve, create, complete, and delete reminders through natural language.
                Last updated -
                TypeScript
                • Apple

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/jxnl/python-apple-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server