Skip to main content

A Model Context Protocol server that lets AI assistants read and send Instagram DMs

Project description

Instagram DMs MCP

A Model Context Protocol (MCP) server that lets AI assistants read and send Instagram DMs.

Deploy to Render

Deployment

Option 1: One-Click Deploy (Render)

  1. Click the "Deploy to Render" button above
  2. Add your environment variables in Render dashboard:
    • IG_COOKIES - Your Instagram cookies as JSON (see below)
    • POKE_API_KEY - Your Poke API key (optional, for DM notifications)
  3. Your MCP server will be at https://your-service.onrender.com/mcp

Option 2: Local Development

Quick Start

1. Get Your Instagram Cookies

  1. Go to instagram.com and log in
  2. Open DevTools (F12) → Application tab → Cookieshttps://www.instagram.com
  3. Copy these values into your .env:
Cookie Env Variable
sessionid IG_SESSION_ID
ds_user_id IG_USER_ID
csrftoken IG_CSRF_TOKEN
datr IG_DATR
ig_did IG_DID
mid IG_MID

2. Setup

git clone https://github.com/braindead-dev/instagram-dms-mcp.git
cd instagram-dms-mcp

# Build the gateway (requires Go 1.22+)
cd gateway && ./build.sh && cd ..

# Configure
cp env.example .env
# Edit .env with your cookies

# Run
pip install -r requirements.txt
python src/server.py

Tools

Tool Description
get_inbox() See all your conversations
get_conversation(user) Read messages with someone
send_message(user, message) Send a message
react(user, emoji) React to their last message

Example Flow

User: "Check my Instagram DMs"
→ get_inbox()

User: "What did @johndoe say?"
→ get_conversation("johndoe")

User: "Reply with 'sounds good!'"
→ send_message("johndoe", "sounds good!")

User: "React with a heart"
→ react("johndoe", "❤️")

Incoming DM Notifications (Poke)

To get notified when you receive new DMs:

  1. Get your API key from poke.com/settings/advanced
  2. Add to .env:
    POKE_API_KEY=your_key_here
    

New DMs will be forwarded to Poke as: 📩 Instagram DM from @username: message

Behavior Settings

The MCP simulates natural behavior by default:

Setting Default Description
IG_SIMULATE_TYPING true Show typing indicator before sending
IG_AUTO_MARK_SEEN true Mark as read when opening conversation
IG_TYPING_DELAY 1.5 Seconds to "type" before sending

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 951a5976b364a3eb8cddd2fbad996eb5c47470c8a53f3318915e3d2ba9b98d97
MD5 36f93afa88af1bd5f24e96e75705781d
BLAKE2b-256 4a3e39f052b5d41f73bf102ce015b6394c6b1ac4f36d87f3012b8f7950d54b51

See more details on using hashes here.

File details

Details for the file iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4472c49c83ed52a5b862f330636482d3c29cb2e59dcce59cd352c2ff4aa0179b
MD5 ec4a13eb8dcaf4691a818569cfa04d97
BLAKE2b-256 779ab44f397ec103d2d6deafe0e35dae455445532493e7f29c541bdd05b13387

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page