Instagram CLI logo

Instagram CLI

Community
lupikovoleg

Agentic AI to communicate with Instagram (and MCP too)

Publisherlupikovoleg
Repositoryinstagram-cli
LanguagePython
Forks
4
Stars
36
Available tools
0
Transport typestdio
Categories
Licensenull
Links
  • Connect tools to AI workflows

    Instagram CLI exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    36 stars and 4 forks from the linked repository.

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.

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Use Instagram CLI MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Instagram CLI is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Instagram CLI as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Instagram CLI MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "lupikovoleg-instagram-cli": {
      "command": "npx",
      "args": [
        "-y",
        "instagram-cli"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Instagram CLI MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Instagram CLI MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Instagram CLI to help me with this task?
Instagram CLI
Sure. I read it.
Here is what I found using Instagram CLI.

Frequently asked questions

What is the Instagram CLI MCP server used for?

Instagram CLI is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Instagram CLI MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Instagram CLI with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Instagram CLI MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Instagram CLI connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Instagram CLI MCP to TypingMind?

Instagram CLI runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Instagram CLI MCP provide in TypingMind?

Instagram CLI exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Instagram CLI MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Instagram CLI requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇