SMS.ir MCP server
SMS.ir MCP サーバー
SMS.ir Panel V2 API のための厳選された、安全ゲート付きツールセットを公開するローカル Model Context Protocol サーバーです。Python + FastMCP で構築されています。
Codex / Claude Desktop / Claude Code 用の stdio トランスポート
ローカル開発・テスト用の streamable HTTP トランスポート
読み取り操作はそのまま動作します。すべての送信は課金対象であり、デフォルトでブロックされ、確認フラグ と サーバー側のキルスイッチの両方が必要です。
電話番号、メッセージ本文、API キー、OTP コードはログでマスクされます。
SMS.ir Panel V2 Postman コレクション(このリポジトリには含まれていません — 実際の API キーが埋め込まれているため)から構築されています。正規化された API の説明は docs/API.md と docs/openapi.yaml にあります。
1. セットアップ
Python 3.10+ が必要です(CPython 3.12 で開発・テスト済み)。
cd C:\Users\Kasra\Documents\sms.ir-mcp
# create the project-local virtual environment
py -3.12 -m venv .venv
# install runtime deps (pinned)
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
# ...or install with the package + dev/test extras
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"Related MCP server: iletiMerkezi MCP Server
2. 設定
すべての設定は環境変数から取得されます。ローカルで使用する場合は、サンプルの env ファイルをコピーして記入してください — これは git で無視され、コミットされることはありません。
copy .env.example .env
notepad .env変数 | 必須 | デフォルト | 目的 |
| はい | – | SMS.ir Panel API キー。 |
| いいえ | – | 送信ツール用のフォールバック送信元回線 |
| いいえ |
| キルスイッチ。 実際の送信がプロセスから出るには |
| いいえ |
| API ベース URL(ホストは許可リストで制限) |
| いいえ |
|
|
| いいえ |
| リクエストごとのタイムアウト |
| いいえ |
| 一時的な障害(429 / 5xx / ネットワーク)に対する再試行回数 |
| いいえ |
| クライアント側のレート制限 |
| いいえ |
|
|
| いいえ |
|
|
| いいえ |
| 自動ロードする env ファイルのパス |
実際の環境変数は、env ファイルの値よりも常に優先されます。
3. 実行
# stdio (what MCP clients launch)
.\.venv\Scripts\python.exe -m sms_ir_mcp --transport stdio
# streamable HTTP for local testing (http://127.0.0.1:8000/mcp)
.\.venv\Scripts\python.exe -m sms_ir_mcp --transport http --host 127.0.0.1 --port 8000クレジットを消費しない簡単な接続・認証チェックには、接続済みの任意のクライアントから health_check ツール(または get_balance)を呼び出してください — どちらも内部的には GET /v1/credit です。
4. ツール
読み取り専用ツールは常に利用可能です。書き込みツールには confirm=true と SMSIR_ALLOW_SEND=true の両方が必要です。破壊的ツールには confirm=true が必要です。
ツール | 種類 | API | 説明 |
| 読み取り |
| 残りの SMS クレジット |
| 読み取り |
| 送信元回線番号 / 仮想番号 |
| 読み取り |
| 送信済みメッセージ 1 件の配信レポート / ステータス |
| 読み取り |
| 一括パックの受信者ごとの結果(ページング対応) |
| 読み取り |
| 送信済みメッセージ、 |
| 読み取り |
| 一括パック、 |
| 読み取り |
| 受信メッセージ、 |
| 読み取り |
| 解析可能なワンタイムコードを含む最新の受信メッセージ(ヒューリスティック) |
| 読み取り |
| 到達可能性 + 認証チェック、課金されません。有効な設定も返します |
| 管理 | – | サーバーを再起動せずに |
| 課金対象 |
| 1 つのテキストを 1 人以上の受信者に送信 |
| 課金対象 |
| テンプレート化された OTP / 認証メッセージ |
| 課金対象 |
| 受信者ごとに異なるテキストを送信 |
| 破壊的 |
| 未送信の予約パックをキャンセル |
すべてのツールは、成功時には {"ok": true, "data": …, …} を、失敗時には {"ok": false, "error": {"code": …, "message": …}} を返します。エラーコード: config_error、validation_error、confirmation_required、send_disabled、auth_error、rate_limited、transient_error、api_error、internal_error。
例
// check balance
get_balance() -> {"ok": true, "data": {"credit": 45210}}
// read the latest OTP received on a given number
extract_latest_otp({"mobile": "9821000"})
-> {"ok": true, "data": {"otp": "834122", "matched": true, "from": "*****1000", ...}}
// attempt a send without confirming -> refused, nothing sent
send_sms({"message_text": "Hi", "mobiles": ["09121234567"]})
-> {"ok": false, "error": {"code": "confirmation_required", ...}}
// confirmed send, but kill switch still off -> refused, nothing sent
send_sms({"message_text": "Hi", "mobiles": ["09121234567"], "confirm": true})
-> {"ok": false, "error": {"code": "send_disabled", ...}}
// edited .env to set SMSIR_ALLOW_SEND=true -> apply it without restarting
reload_config()
-> {"ok": true, "data": {"config": {"allow_send": true, ...}, "changed": ["allow_send"]}}
// with SMSIR_ALLOW_SEND=true AND confirm=true -> actually sends (billable)
send_sms({"message_text": "Hi", "mobiles": ["09121234567"],
"line_number": "30007732000000", "confirm": true})
-> {"ok": true, "data": {"packId": "…", "messageIds": [123], "cost": 1.0}, "recipients": 1}5. 安全モデル
課金対象の操作(
send_sms、send_verification_code、send_personalized_sms)には両方が必要です:ツール呼び出しでの
confirm=true、およびサーバー環境での
SMSIR_ALLOW_SEND=true。 キルスイッチがオフの場合、確認済みの呼び出しでも何も送信されません。
破壊的操作(
cancel_scheduled_send)にはconfirm=trueが必要です。任意のベース URL は不可:
SMSIR_ALLOW_CUSTOM_BASE_URL=trueでない限り、api.sms.irのみ受け入れられます。HTTPS が強制されます。ヘッダーインジェクションなし: 呼び出し元はリクエストヘッダーを設定できません。型指定され検証されたフィールドのみが転送されます。
タイムアウト + 制限付き再試行 + クライアント側レート制限がすべてのリクエストに適用されます。
マスキング: API キー、電話番号、メッセージ本文、OTP 値はログ出力でマスクされます。
管理エンドポイントなし: Postman コレクション内の操作のみが公開されます。アカウント / 設定管理用のものはありません。
6. クライアント登録
実際の API キーはこのフォルダの .env に置いてください — クライアント設定ファイルには決して入れないでください。以下の各設定は、クライアントをこのサーバーとその .env にポイントするだけです。
Codex CLI(インストール済み)
codex mcp add sms-ir `
--env SMSIR_ENV_FILE=C:\Users\Kasra\Documents\sms.ir-mcp\.env `
-- C:\Users\Kasra\Documents\sms.ir-mcp\.venv\Scripts\python.exe -m sms_ir_mcp --transport stdio
codex mcp list # sms-ir should appear
codex mcp get sms-ir手動での同等設定: docs/codex_config.example.toml
Claude Code(インストール済み)
このリポジトリにはプロジェクトスコープの .mcp.json が同梱されています。このディレクトリで Claude Code を開き、プロンプトが表示されたら sms-ir サーバーを承認してください:
cd C:\Users\Kasra\Documents\sms.ir-mcp
claude
/mcp # shows sms-ir and its tools代わりにユーザースコープで登録する場合:
claude mcp add sms-ir --scope user `
--env SMSIR_ENV_FILE=C:\Users\Kasra\Documents\sms.ir-mcp\.env `
-- C:\Users\Kasra\Documents\sms.ir-mcp\.venv\Scripts\python.exe -m sms_ir_mcp --transport stdioClaude Desktop(未インストール)
インストールしたら、docs/claude_desktop_config.example.json を %APPDATA%\Claude\claude_desktop_config.json にマージしてください(事前にバックアップを取り、他のサーバーは保持してください)。
7. 開発
.\.venv\Scripts\python.exe -m ruff check src tests
.\.venv\Scripts\python.exe -m ruff format --check src tests
.\.venv\Scripts\python.exe -m pytestテストでは、リクエスト構築、認証ヘッダー、エンベロープ解析、エラー正規化、再試行 / レート制限、引数検証、マスキング、OTP 抽出、すべてのツールのモック統合(Postman のサンプルペイロードを使用)、OpenAPI とコレクションの整合性、MCP ツールの検出をカバーしています。
8. 最初のライブテスト(資格情報を提供した後)
このリポジトリ内の何も、課金対象の呼び出しを行ったことはありません。最初の実際の送信を実行するには、明示的に承認する必要があります:
キーを
.envに置きます:SMSIR_API_KEY=<your real key> SMSIR_DEFAULT_LINE_NUMBER=<your approved line> SMSIR_ALLOW_SEND=true費用をかけずに接続を確認します — 接続済みのクライアントから
health_check(またはget_balance)を呼び出します。そのときだけ、最初の課金対象の呼び出しを行います。正確なツール呼び出し:
send_sms({ "message_text": "SMS.ir MCP test", "mobiles": ["<your own mobile>"], "line_number": "<your approved line>", "confirm": true })Codex での表現: "Use the sms-ir server's send_sms tool to send 'SMS.ir MCP test' to from line , with confirm true."
9. トラブルシューティング
症状 | 原因 / 修正 |
| 環境変数または |
すべての呼び出しで | キーが間違っている / ローテーションされた、またはキーに Panel API アクセスがない |
| サーバー環境で |
| サーバーは起動時に一度だけ設定を読み取ります。 |
| ツールを |
| 10〜15 桁、先頭の |
| クライアント側のリミッターが作動。 |
| 再試行後のネットワーク / 5xx。接続と SMS.ir のステータスを確認 |
クライアントにツールが表示されない | クライアント設定の |
| SMS.ir がリクエストを拒否。 |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Send SMS, manage contacts and groups, and read delivery reports. OAuth 2.1 SureSMS login.
Send and schedule SMS and WhatsApp messages, manage contacts and templates, and track delivery.
SMS Verify: SMS Verify API is a secure and easy-to-integrate service that sends verification codes.
Email, phone, domain, URL & OFAC verification; phishing and IBAN checks via x402.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables comprehensive email marketing and transactional email operations through SendGrid's API v3. Supports contact management, campaign creation, email automation, list management, and email sending with built-in read-only safety mode.581,3843ISC
- AlicenseAqualityAmaintenanceEnables sending SMS, querying delivery reports, and managing senders and blacklists through the iletiMerkezi SMS API.11342MIT

SOLAPI MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceEnables searching SOLAPI documentation and examples, and sending/managing SMS, LMS, MMS, RCS, and Kakao messages with safety guards.250MIT- AlicenseAqualityAmaintenanceEnables MCP clients to read Instantly.ai analytics and manage leads, campaigns, Unibox, sender accounts, blocklist, and webhooks, with write actions gated behind confirm prompts and configurable safety policies.40MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ali-toghiani/sms-ir-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server