TwilioManager MCP

by errajibadr
Verified

local-only server

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

Integrations

  • Used for managing Twilio credentials and environment variables required for authentication with the Twilio API.

  • Enables direct interaction with Twilio's API for subaccount management, phone number control, regulatory compliance handling, and address management for compliance requirements.

Twilio マネージャー MCP

Twilio リソースを管理するための Model Context Protocol (MCP) 実装。このパッケージは、標準化された MCP インターフェースを通じて、Twilio サブアカウント、電話番号、規制バンドルを管理するためのツールを提供します。

特徴

  • Twilioサブアカウントの一覧
  • サブアカウントに関連付けられた電話番号を取得する
  • サブアカウント間で電話番号を転送する
  • 規制バンドルSIDを取得する
  • 直接通信とサーバー送信イベント(SSE)通信の両方をサポート
  • Claude Desktop、Cursor、その他のMCP互換ツールとの統合

インストール

前提条件

uvをインストールする

macOSの場合:

brew install uv

Windowsの場合:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Linuxの場合:

curl -LsSf https://astral.sh/uv/install.sh | sh

プロジェクトのセットアップ

  1. リポジトリをクローンします。
git clone https://github.com/yourusername/twilio_manager_mcp.git cd twilio_manager_mcp
  1. uv を使用して依存関係をインストールします。
uv sync

構成

  1. Twilio の資格情報を使用して、ルート ディレクトリに.envファイルを作成します。
TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token
  1. .cursor/mcp.jsonファイルを作成して、ツール (Cursor、Claude Desktop など) の MCP を構成します。
{ "mcpServers": { "twilio_manager_mcp_abs": { "command": "uv", "args": ["--directory", "/path/to/twilio_manager_mcp", "run", "mcp", "run", "./twilio_manager_mcp.py"], "env": { "TWILIO_ACCOUNT_SID": "your_account_sid", "TWILIO_AUTH_TOKEN": "your_auth_token" } }, "twilio_manager_mcp_uvx": { "command": "uvx", "args": [ "twilio-manager-mcp" ], "env": { "TWILIO_ACCOUNT_SID": "your_account_sid", "TWILIO_AUTH_TOKEN": "your_auth_token" } }, "twilio_manager_mcp_sse": { "url": "http://localhost:8000/sse" } } }

ドッカー

導入と管理を容易にするために、Docker を使用して Twilio Manager MCP を実行できます。

Docker Composeの使用

このプロジェクトには、以下を設定する Docker Compose 構成が含まれています。

  • Twilio Manager MCP サービス
  • 自動HTTPSを備えたTraefikリバースプロキシ
  1. .envファイルで環境変数を設定します。
# Twilio credentials TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token # Domain configuration for Traefik DOMAIN_NAME=yourdomain.com ACME_EMAIL=user@yourdomain.com # Address details (optional) ADDRESS_CUSTOMER_NAME= ADDRESS_FRIENDLY_NAME= ADDRESS_STREET= ADDRESS_CITY= ADDRESS_REGION= ADDRESS_POSTAL_CODE= ADDRESS_ISO_COUNTRY=
  1. サービスを開始します。
docker-compose up -d

アプリケーションは、HTTPS が有効になっている構成済みのドメインで利用できるようになります。

Docker Compose なしで Docker を使用する

Traefik を使用せずに Twilio Manager MCP コンテナのみを実行したい場合:

  1. Docker イメージをビルドします。
docker build -t twilio-manager-mcp .
  1. コンテナを実行します。
docker run -p 8000:8000 \ -e TWILIO_ACCOUNT_SID=your_account_sid \ -e TWILIO_AUTH_TOKEN=your_auth_token \ twilio-manager-mcp

SSE エンドポイントはhttp://localhost:8000/sseで利用できます。

使用法

カーソル、クロードデスクトップ、またはその他のMCP互換ツールを使用

この MCP を使用するには、次の 3 つのオプションがあります。

  1. 直接UVX統合(推奨):
    • twilio_manager_mcp_uvx設定を使用する
    • これは最も簡単な方法であり、uvxですぐに使用できます。
  2. 直接UV統合
    • twilio_manager_mcp_abs設定を使用する
    • インストール先のフルパスを指定する必要があります
  3. SSE サーバー:
    • twilio_manager_mcp_sse設定を使用する
    • まず SSE サーバーを起動します。
      uvicorn twilio_manager_mcp_sse:app --host 0.0.0.0 --port 8000

利用可能なツール

ツール名説明
list_twilio_subaccountsすべてのTwilioサブアカウントを一覧表示する
get_account_phone_numbers特定のサブアカウントの電話番号を取得する
get_all_phone_numbersサブアカウント間で電話番号を転送する
get_regulatory_bundle_sidサブアカウントの規制バンドル SID を取得する

Cursor/Claude デスクトップでの使用例

設定が完了すると、AI アシスタントの会話でツールを直接使用できるようになります。

  1. すべてのサブアカウントを一覧表示します:
# The AI will automatically use the MCP to list all subaccounts # No need to write code - just ask "List all Twilio subaccounts"
  1. サブアカウントの電話番号を取得します。
# Simply ask: "Show me all phone numbers for subaccount AC..."

Pythonの直接使用

プログラムで直接使用する場合:

from mcp import ClientSession from clients.client import MCPClient async with MCPClient("uvx", ["twilio-manager-mcp"], env={}) as session: # List available tools tools = (await session.list_tools()).tools # List all subaccounts subaccounts = await session.invoke("list_twilio_subaccounts") # Get phone numbers for a subaccount numbers = await session.invoke("get_account_phone_numbers", {"account_sid": "AC..."})

プロジェクト構造

twilio_manager_mcp/ ├── api/ │ └── async_twilio_api.py # Async Twilio API implementation ├── clients/ │ ├── client.py # Direct MCP client implementation │ └── client_sse.py # SSE client implementation ├── twilio_manager_mcp.py # Core MCP server implementation ├── twilio_manager_mcp_sse.py # SSE server wrapper ├── requirements.txt # Project dependencies └── README.md # This file

発達

開発には、UV の仮想環境管理を使用できます。

# Create a virtual environment uv venv # Activate the virtual environment source .venv/bin/activate # On Unix .venv\Scripts\activate # On Windows # Install dependencies in development mode uv pip install -e .

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

MITライセンス

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

モデル コンテキスト プロトコルを介して Claude AI を Twilio に接続し、Twilio アカウント、電話番号、規制コンプライアンスの迅速な管理を可能にするサーバー。

  1. Features
    1. Installation
      1. Prerequisites
      2. Project Setup
    2. Configuration
      1. Docker
        1. Using Docker Compose
        2. Using Docker Without Docker Compose
      2. Usage
        1. With Cursor, Claude Desktop, or other MCP-compatible tools
        2. Available Tools
        3. Example Usage in Cursor/Claude Desktop
        4. Direct Python Usage
      3. Project Structure
        1. Development
          1. Contributing
            1. License
              ID: 5s1dhxznxx