Instagram DMs MCP
A Model Context Protocol (MCP) server that lets AI assistants read and send Instagram DMs.
Deployment
Option 1: One-Click Deploy (Render)
- Click the "Deploy to Render" button above
- 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)
- Your MCP server will be at
https://your-service.onrender.com/mcp
Option 2: Local Development
Quick Start
1. Get Your Instagram Cookies
- Go to instagram.com and log in
- Open DevTools (F12) → Application tab → Cookies →
https://www.instagram.com - 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:
- Get your API key from poke.com/settings/advanced
- 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 |
Metadata
Release files for iflow-mcp_braindead-dev_instagram-dms-mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4.tar.gz | 9.9 kB | Without provenance | Details for iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4-py3-none-any.whl |
Total release size: 20.1 kB
Release files / iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4.tar.gz
| Download URL | iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d484c922f826ad298a8164d4c8728030b15d758e9308ae755398ff71f80fbc7
|
|
BLAKE2b-256 checksum How to use checksums |
53cd7b7ade9c33f06c2f9acd98786a64f884e0c15d50e2b31f6150b632da1300
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4-py3-none-any.whl
| Download URL | iflow_mcp_braindead_dev_instagram_dms_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a788776b80e85f031679654737894312393e1e2202e96d709caaf2b3ae0451d2
|
|
BLAKE2b-256 checksum How to use checksums |
664e8f10d5df6ac3a7f2c64bf328e41a558e7435cc47cd15271308586170dd35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for iflow-mcp_braindead-dev_instagram-dms-mcp 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.