Instagram CLIのロゴ

Instagram CLI

コミュニティ
lupikovoleg

Agentic AI to communicate with Instagram (and MCP too)

公開者lupikovoleg
リポジトリinstagram-cli
言語Python
フォーク
4
スター
41
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    Instagram CLIは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには41件のスターと4件のフォークがあります。

Instagram CLI

Terminal-first Instagram analytics, downloads, and MCP tools powered by HikerAPI, OpenRouter, and FastMCP.

text
 ___ _   _ ____ _____  _    ____ ____      _    __  __      ____ _     ___
|_ _| \ | / ___|_   _|/ \  / ___|  _ \    / \  |  \/  |    / ___| |   |_ _|
 | ||  \| \___ \ | | / _ \| |  _| |_) |  / _ \ | |\/| |   | |   | |    | |
 | || |\  |___) || |/ ___ \ |_| |  _ <  / ___ \| |  | |   | |___| |___ | |
|___|_| \_|____/ |_/_/   \_\____|_| \_\/_/   \_\_|  |_|    \____|_____|___|
                           INSTAGRAM-CLI by @lupikovoleg

What It Does

  • Search Instagram by topic with adaptive deep pagination, including multilingual reel and media discovery
  • Filter search results by freshness, including today and last N days
  • Fetch profile stats, reel stats, up to 100 root comments per media, likers, followers, following, stories, and highlights
  • Analyze profile publications from the main grid:
    • reels
    • posts
    • carousels
  • Inspect pinned posts, tagged publications, comment replies, tagged users, and media insight metrics
  • Discover content and entities through:
    • hashtags
    • places
    • music tracks
    • suggested related profiles
  • Check HikerAPI balance and request-rate data from the CLI or MCP
  • Download Instagram content locally:
    • reels and posts
    • audio tracks
    • active stories
    • highlights
  • Export collected results to csv or json
  • Support natural-language interaction with tool calling in the CLI
  • Handle chained workflows such as:
    • search -> inspect -> rank -> export
    • open a profile -> analyze publications -> download content
    • fetch a reel -> inspect comments or likers -> export the result
  • Expose the same capability layer through a local MCP server for Claude and other MCP clients

Requirements

  • macOS or Linux
  • Python 3.10+
  • HIKERAPI_KEY or HIKERAPI_TOKEN
  • OPENROUTER_API_KEY for the interactive CLI agent

Installation

bash
cd /path/to/instagram-cli
./install.sh

This installs two commands:

  • instagram for the interactive CLI
  • instagram-mcp for the local MCP server

Install as a Python dependency in another project:

bash
pip install git+https://github.com/lupikovoleg/instagram-cli.git

First Run

The CLI uses its own .env file.

  • default path: /path/to/instagram-cli/.env
  • override path: INSTAGRAM_CLI_ENV_FILE=/path/to/custom.env

If required keys are missing, the CLI bootstrap asks for them and writes the local .env.

Quick Start

Start the CLI:

bash
instagram

Typical commands:

text
instagram> profile lupikovoleg
instagram> search portugal creators
instagram> search reels about dubai attack
instagram> publications lupikovoleg 10 30 all
instagram> comments https://www.instagram.com/reel/XXXXXXXXXXX/ 100
instagram> download media https://www.instagram.com/reel/XXXXXXXXXXX/
instagram> export csv latest-results
instagram> how many followers does @lupikovoleg have?
instagram> find today's reels about an attack on Dubai
instagram> find 100 reels about Dubai real estate

Start the MCP server:

bash
instagram-mcp

Use it as a Python library:

python
from instagram_cli import InstagramClient

client = InstagramClient.from_env(env_file="/path/to/instagram-cli/.env")
profile = client.get_profile_stats(target="lupikovoleg")

Custom agent example:

bash
python /path/to/instagram-cli/examples/custom_agent.py \
  --env-file /path/to/instagram-cli/.env \
  "How many followers does @lupikovoleg have?"

MCP Setup

Claude Code:

bash
claude mcp add instagram-cli -- /path/to/instagram-cli/.venv/bin/instagram-mcp

Claude Desktop config file on macOS:

text
~/Library/Application Support/Claude/claude_desktop_config.json

Example:

json
{
  "mcpServers": {
    "instagram-cli": {
      "command": "/path/to/instagram-cli/.venv/bin/instagram-mcp",
      "args": [],
      "env": {
        "INSTAGRAM_CLI_ENV_FILE": "/path/to/instagram-cli/.env"
      }
    }
  }
}

Documentation

Project Notes

  • CLI mode uses OpenRouter for natural-language tool selection and query expansion.
  • Search is adaptive by default: if limit is omitted, the tool can paginate internally up to 50 final results; explicit one-shot search requests are capped at 100.
  • High-level comment collection returns root comments only and can paginate internally up to 100 comments per media.
  • MCP mode does not use OpenRouter internally for search. MCP clients can pass query_variants when richer multilingual retrieval is needed.
  • Python library mode uses the same deterministic InstagramOps layer as the CLI and MCP server, exposed through InstagramClient.
  • Expensive follower and liker analysis is intentionally capped by default to avoid burning HikerAPI credits.
  • Some tools are exact page reads, while sampled ranking tools explicitly mark themselves as approximate.

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "lupikovoleg-instagram-cli": {
      "command": "",
      "args": []
    }
  }
}

Instagram CLIのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Instagram CLIに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Instagram CLIをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Instagram CLIのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "lupikovoleg-instagram-cli": {
      "command": "npx",
      "args": [
        "-y",
        "instagram-cli"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてInstagram CLIのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Instagram CLIのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Instagram CLIを使ってこのタスクを手伝ってもらえますか?
Instagram CLI
はい、読みました。
Instagram CLIで調べた結果をお伝えします。

よくある質問

Instagram CLI MCPサーバーは何に使いますか?

Instagram CLIは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでInstagram CLI MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでInstagram CLIを利用できます。

TypingMindでInstagram CLI MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。Instagram CLIを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Instagram CLI MCPをTypingMindに接続するにはどうすればよいですか?

Instagram CLIはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでInstagram CLI MCPのどのようなツールを利用できますか?

Instagram CLIはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Instagram CLI MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Instagram CLIで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇