プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説 ログイン

Messaging Rules

✓ pinlyx.com

作者:Pinlyxバージョン 0.1.1i★ 0iパソコンで動く公式サイト ↗

インストール方法

できること

Can I message this person now? Source-cited WhatsApp, Instagram, Messenger, Telegram and X rules.

作者による原文

  • 接続方法 パソコンで動く
  • アカウントまたはキー キー不要
  • カテゴリ チャット・メール

この順位の理由

一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり

人気0/80GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます
新しさ12/1230 日以内のリリースかコード更新で満点
応答中0/8前回の確認でクラウドのエンドポイントが応答
利用スコア12/100

品質: 基本チェック 3/3 項目に合格(表示のみ、並び順には不使用) · 勢い: データなし (「急上昇」タブでのみ使用)

インストール

使っているAIアプリを選んで、設定をコピーしてください。

ひとことで AI にインストールしてもらう

Messaging Rules をインストールして。https://mcp.popnx.com/i/pinlyx-messaging-rules.md に従い、コマンドを見せて、私が OK するまで実行しないで。

パソコンで作業できる AI(Claude Code や Cursor など)に貼り付けます。手順を読み、コマンドを見せて、あなたの OK を待ちます。キー不要・登録不要。 · AI が読む全文を見る

チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月26日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません

AI にインストールしてもらう

このメッセージを Claude のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude に MCP server Messaging Rules を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "messaging-rules": { "command": "npx", "args": [ "-y", "messaging-rules" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Messaging Rules のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. パソコン版 Claude アプリの設定ファイルを開く

    SettingsDeveloperEdit Config

  3. この設定を貼り付けて保存

    {
      "mcpServers": {
        "messaging-rules": {
          "command": "npx",
          "args": [
            "-y",
            "messaging-rules"
          ]
        }
      }
    }
  4. Claude を終了してもう一度開く

  5. 試してみる

    Messaging Rules を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が Messaging Rules を使っていると言うか、回答に Messaging Rules のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT はまだ Messaging Rules につなげません

Messaging Rules はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません

代わりにできること

A · Messaging Rules につなげるアプリを使う

  • 先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)

B · チャット・メール の中で ChatGPT につなげる別のサーバー

同じカテゴリでよく使われているものから、キーなしでアドレスだけでつなげるものを選びました

Claude Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Claude Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude Code に MCP server Messaging Rules を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):claude mcp add --scope user messaging-rules -- npx -y messaging-rules 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Messaging Rules のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  3. このコマンドを貼り付けて Enter

    claude mcp add --scope user messaging-rules -- npx -y messaging-rules
  4. Claude Code で /mcp と入力

    Messaging Rules が一覧にあり、接続済みと表示されれば OK です

  5. 試してみる

    Messaging Rules を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が Messaging Rules を使っていると言うか、回答に Messaging Rules のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Cursor のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Cursor に MCP server Messaging Rules を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "messaging-rules": { "command": "npx", "args": [ "-y", "messaging-rules" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Messaging Rules のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  3. Cursor の AI チャットを Agent モードで開く

  4. 試してみる

    Messaging Rules を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が Messaging Rules を使っていると言うか、回答に Messaging Rules のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを VS Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの VS Code に MCP server Messaging Rules を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "servers": { "messaging-rules": { "type": "stdio", "command": "npx", "args": [ "-y", "messaging-rules" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Messaging Rules のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  3. VS Code の AI チャットを Agent モードで開く

  4. 試してみる

    Messaging Rules を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が Messaging Rules を使っていると言うか、回答に Messaging Rules のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

JSON 設定は下の「開発者向け」にあります

つまずいたら?Messaging Rules を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

パソコンにインストール

Claude Code

claude mcp add --scope user messaging-rules -- npx -y messaging-rules

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "messaging-rules": {
      "command": "npx",
      "args": [
        "-y",
        "messaging-rules"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "messaging-rules": {
      "command": "npx",
      "args": [
        "-y",
        "messaging-rules"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "messaging-rules": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "messaging-rules"
      ]
    }
  }
}

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

レジストリ名
com.pinlyx/messaging-rules
週あたりのダウンロードi
npm/PyPIにない
確認済みドメイン
✓ pinlyx.com
接続方法
パソコンで動く
最新バージョンi
0.1.1
レジストリ公開日i
2026年11月26日
コードの最終更新i
2026年11月26日
作者
Pinlyx
パッケージ
npm: messaging-rules
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月26日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名はドメイン pinlyx.com で確認済みです(レジストリがドメインの所有を確認しています)

  • ✓ 合格

    今もメンテナンスされている

    コードの最終更新:今日

  • ✓ 合格

    ライセンスがある

    MITを使用

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

公開済みの脆弱性(OSV.dev)

OSV.dev に messaging-rules@0.1.1 の登録はありません

このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月26日

確認していること → · JSON

作者の方へ:再確認の依頼・情報の誤りの報告
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/pinlyx-messaging-rules.svg)](https://mcp.popnx.com/en/servers/pinlyx-messaging-rules)

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

ユーザーレビュー

まだレビューはありません

ログインしてレビューを書く

チャット・メールのほかのサーバーとの比較i

  • このカテゴリのほかの2184件のうち0%よりスターが多い
  • このカテゴリのほかの2184件のうち99%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの2184件のうち99%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

Messaging Rulesは安全ですか?

当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は今日、最新バージョン(0.1.1)がレジストリに届いたのは今日です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。

代わりに使えるものは?

同じカテゴリには:MoeMail, emailmd, Kite Discord Bot Builder, e2a — email for AI agents, Infobip MCP

似た働きのほかの候補

同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

MoeMail

Disposable email for AI agents: create a mailbox, wait for the code, clean up. Hosted, no install.

作者:beilunyang広く使われている★ 2836一昨日更新

すぐ接続できる(URL あり) · ログインが必要✓ 提供元 · moemail.app

emailmd

Render markdown into email-safe HTML, lint drafts for deliverability problems, and preview emails.

作者:anypost広く使われている↓ 5432/週★ 139912 日前更新

すぐ接続できる(URL あり)ツール 3 個 · 軽め✓ 提供元 · emailmd.dev

Kite Discord Bot Builder

Build and fix Discord bots from a chat. Kite hosts them 24/7, with no code to deploy.

作者:merlinfuchs成長中★ 333 リポジトリ全体のスター29 日前更新

すぐ接続できる(URL あり) · ログインが必要✓ 提供元 · kite.onl

e2a — email for AI agents

Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.

作者:tokencanopy成長中★ 200 リポジトリ全体のスター4 か月前更新

すぐ接続できる(URL あり) · ログインが必要✓ 提供元 · e2a.dev

Infobip MCP

Infobip MCP server for omnichannel communication and messaging. SMS, RCS, WhatsApp, Viber and more.

作者:infobip初期★ 3613 か月前更新

すぐ接続できる(URL あり) · ログインが必要✓ 提供元 · infobip.com
似たものと比べる
これ
Messaging Rules
MoeMailemailmdKite Discord Bot Buildere2a — email for AI agentsInfobip MCP
動く場所パソコンにインストールが必要クラウドで動き、インストール不要クラウドでもパソコンにインストールでも使えるクラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要
キーが必要いいえいいえいいえいいえいいえいいえ
Claude で + から追加いいえいいえいいえいいえいいえはい
基本チェック3/34/45/54/44/44/4
ライセンスMITMITMITAGPL-3.0Apache-2.0MIT
料金登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

messaging-rules

Can I message this person right now? Source-cited rules for WhatsApp, Instagram, Messenger, Telegram and X, as data, a library and an MCP tool.

canMessage({ channel: 'instagram', lastInboundAt: '2026-11-19T09:00:00Z', sender: 'bot' })

// { allowed: false, // reason: 'The 24h standard messaging window closed at 2026-11-20T09:00:00.000Z. After it: Only HUMAN_AGENT tagged replies sent by a person, ...', // allowedAlternatives: [], sources: ['https://developers.facebook.com/...'] }

Why

The rules that decide whether a business may message someone are spread across dozens of platform pages, change several times a year, and are mostly explained second-hand in vendor help centers, each covering a fragment. There is no machine-readable source, so developers and AI agents keep breaking them:

  • sending free-form WhatsApp text after the 24-hour customer service window closed (only an approved template is allowed then);
  • replying from an Instagram or Messenger bot with the HUMAN_AGENT tag (it is for a person replying manually, within 7 days);
  • still using the Messenger ACCOUNT_UPDATE, POST_PURCHASE_UPDATE or CONFIRMED_EVENT_UPDATE tags, which return error 100 since 2026-04-27;
  • trying to have a Telegram bot start a chat (a user has to message it first);
  • sending a 1,500 character Instagram DM (the limit is 1,000 bytes) or a 6 MB WhatsApp image (5 MB).

This repository turns those rules into one JSON file per channel. Every value carries the official URL it was read from, a short quote from that page and the date it was verified. A TypeScript library, a Python port and an MCP server answer the two questions that matter before sending: *may I send this now?* and *will this message be accepted?*

ChannelWho messages firstReply windowAfter the windowText maxAttachments per messageVerified
WhatsAppBusiness may start: Template message24 hoursOnly pre-approved template messages.4,096 characters12026-11-20
InstagramThe person24 hoursOnly HUMAN_AGENT tagged replies sent by a person, within 7 days of the user's last message.999 characters, 1,000 UTF-8 bytes102026-11-20
MessengerThe person24 hoursA HUMAN_AGENT tagged reply by a person (7 days), an approved utility template, a marketing message to an opted-in person, or a sponsored message.2,000 characters302026-11-20
TelegramThe personOpens once, never expiresn/a4,096 characters102026-11-20
XBusiness may start: Direct MessageNoneNo window appliesno documented maximum12026-11-20

Full tables with a source link on every value: [RULES.md](RULES.md).

Install

Not on npm or PyPI yet; install from GitHub.

# TypeScript / JavaScript (Node 18+): library and the messaging-rules-mcp command

npm install messaging-rules

Python 3.9+ (standard library only)

pip install "git+https://github.com/Pinlyx/messaging-rules#subdirectory=python"

Quick start

TypeScript
import { canMessage, validateMessage, getChannel } from 'messaging-rules';

// A WhatsApp user wrote 23 hours ago: free-form is still allowed. const r = canMessage({ channel: 'whatsapp', lastInboundAt: new Date(Date.now() - 23 * 3600_000), sender: 'bot', }); console.log(r.allowed, r.windowEndsAt); // true, about one hour from now

// 30 hours ago: only a template. const late = canMessage({ channel: 'whatsapp', lastInboundAt: new Date(Date.now() - 30 * 3600_000) }); console.log(late.allowed, late.allowedAlternatives.map((a) => a.kind)); // false [ 'template' ]

// A person (not a bot) answering on Instagram 3 days later may use the HUMAN_AGENT tag. canMessage({ channel: 'instagram', lastInboundAt: new Date(Date.now() - 3 * 86400_000), sender: 'human', kind: 'tag', tag: 'HUMAN_AGENT', }).allowed; // true

// Check a draft before sending it. validateMessage('whatsapp', { caption: 'New menu', attachments: [{ type: 'image', bytes: 6_000_000, mime: 'image/png' }], }); // { ok: false, problems: [{ code: 'file_too_large', limit: 5000000, actual: 6000000, source: '...', ... }] }

getChannel('telegram')?.rate_limits; // per chat, per group, broadcast limits with sources

Python
from datetime import datetime, timedelta, timezone

from messaging_rules import can_message, validate_message, get_channel

now = datetime.now(timezone.utc)

r = can_message(channel="messenger", last_inbound_at=now - timedelta(hours=30), sender="bot") print(r["allowed"]) # False print([a["kind"] for a in r["allowed_alternatives"]])

['tag', 'utility_template', 'marketing_message', 'sponsored'] (the tag is NON_PROMOTIONAL_SUBSCRIPTION, news Pages only)

print(validate_message("telegram", text="x" * 5000)"problems"["code"]) # text_too_long print(get_channel("x")"limits"["max"]) # 1

The Python functions take the same arguments in snake_case and return plain dicts with snake_case keys (window_ends_at, allowed_alternatives).

MCP server

The npm package ships a stdio MCP server, messaging-rules-mcp, with three tools:

ToolWhat it answers
check_messaging_windowMay this sender send this kind of message on this channel now? Returns allowed, reason, windowEndsAt, conditions, allowedAlternatives, sources.
validate_messageDoes this draft fit the channel's text, caption, attachment, media size/type and button limits?
get_channel_rulesThe full source-cited rules for a channel, one section of them, or a summary of all channels.

Add it to any MCP client that supports stdio servers:

{

"mcpServers": { "messaging-rules": { "command": "npx", "args": ["-y", "-p", "messaging-rules", "messaging-rules-mcp"] } } }

If you installed the package, use "command": "messaging-rules-mcp" (or node node_modules/messaging-rules/dist/mcp.js) instead. The server reads only the bundled data: no network, no keys.

API

canMessage(input) / can_message(**input)
InputMeaning
channelwhatsapp, instagram, messenger, telegram or x.
lastInboundAtWhen the person last messaged you: Date, ISO 8601 string (UTC when no offset is given) or epoch milliseconds. null if they never did. For private_reply, pass the time of the comment.
nowDefaults to the current time.
senderbot (default) or human.
kindfree_form (default), template (WhatsApp), tag, private_reply (Instagram, Messenger), utility_template, marketing_message, sponsored (Messenger).
tagWith kind: 'tag', for example HUMAN_AGENT.
openedByad_referral when the conversation started from a click-to-message ad (Instagram and Messenger windows can then last up to 7 days).

Returns { allowed, reason, channel, kind, tag?, windowEndsAt?, conditions, allowedAlternatives, sources }. A window is open while now < lastInboundAt + duration, so exactly 24 hours later it is closed. conditions lists what the data cannot check for you (opt-in, permissions, recipient settings). allowedAlternatives lists other kinds or tags that would be allowed at the same moment.

validateMessage(channel, message) / validate_message(channel, ...)

message may contain text, caption, attachments ([{ type, bytes?, mime?, filename?, viaUrl? }]), buttons, quickReplies and listRows (titles). Returns { ok, channel, problems }; each problem has a code, severity (error or warning), field, message and, where relevant, limit, actual and source. ok is false only when there is an error.

Lengths are counted in UTF-16 code units, which is never less than the number of characters, so the check errs on the safe side (an emoji counts as 2). Instagram also has a byte limit, counted in UTF-8.

Other exports

getChannel(id), listChannels(), CHANNEL_IDS and all TypeScript types. The raw files are importable as messaging-rules/channels/ .json and messaging-rules/schema/channel.schema.json.

Data format

channels/ .json, validated by schema/channel.schema.json:

FieldHolds
initiationWhether the person must message first, plus cited rules.
windowsduration_hours (null = never expires), starts_on, resets_on, applies_to (bot, human, any), optional only_when_opened_by and max_messages, and after_window (what is still allowed).
message_kindsWhich windows a kind needs, or allowed_without_window plus conditions; template categories.
tagsstatus (active or retired with retired_on), applies_to, own window, requirements.
limitstext, caption, attachments_per_message, media (type, MIME types or extensions, max_bytes, max_size_documented), buttons, quick_replies, list_rows, other.
rate_limitslimit per period_seconds and scope, or a formula.
notes, sourcesCited caveats, and every official page used.

Every rule object has source (official URL), quote (text from that page; [...] marks an elision and long dashes are written as hyphens) and verified (date). Megabytes are converted to bytes as 1 MB = 1,000,000 bytes, the stricter reading; the original wording stays in max_size_documented. The schema is generic on purpose: LinkedIn, Viber or email can be added as new files without code changes.

channels/*.json is the single source. npm run sync-data copies it into src/data.generated.ts and python/messaging_rules/data/, and both test suites fail if a copy drifts.

How the rules are verified

  • Values come only from official pages: developers.facebook.com, core.telegram.org and docs.x.com. Third-party articles are used at most to find the official page, never for a value.
  • If a value could not be confirmed on an official page it is left out rather than guessed. Not included at the last verification:
  • X: maximum DM text length (the current v2 reference has a dm-text-too-long error but no number), and size limits beyond the media upload categories.
  • Telegram: maximum number of inline keyboard buttons or rows.
  • WhatsApp: per-user marketing template limits and exact per-category rules beyond the three categories.
  • Messenger: One-time Notification (still mentioned on the policy page, current status unclear) and message tags other than the four listed.
  • Instagram: marketing messages and utility messages.
  • npm test checks that every rule has a source, a quote and a verified date, that every cited URL is an official host and is listed in sources, and that the generated files are current.

Report a rule change

Platforms change these rules often. If something is out of date, open an issue with the rule change template. It needs a link to the official page that shows the new value; changes backed only by blogs or vendor help centers are not accepted. Pull requests: edit channels/ .json (with source, quote, verified), then run npm run sync-data && npm run generate-tables && npm test.

Limits

  • This is not legal advice and not a compliance guarantee. Platforms change rules without notice; check the verified dates and the linked pages before relying on a value.
  • The library checks timing and documented limits. It cannot know whether a user opted in, whether your app has the Human Agent permission, whether a template is approved, or what a recipient's privacy settings are; those come back as conditions.
  • Window logic uses the time you pass. Pass the newes

冒頭だけを表示しています。続きはリポジトリで読めます