
How to add Instagram DM MCP to Windsurf
Send, read and search Instagram DMs from your AI client: 22 tools for messages, media, threads and user lookups. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 174★ · stdio · apikey
Windsurf config for Instagram DM MCP
git clone https://github.com/trypeggy/instagram_dm_mcp.git && cd instagram_dm_mcp && uv sync{
"mcpServers": {
"instagram-dm-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"PATH/TO/instagram_dm_mcp",
"python",
"src/mcp_server.py"
]
}
}
}Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the Instagram DM MCP config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5Instagram DM MCP's tools become available to Cascade.
Before you start
- Python 3.11+
- An Instagram account (logs in with username/password)
- uv (recommended) or pip to install dependencies
- Claude Desktop or Cursor as the MCP client
What Instagram DM MCP can do in Windsurf
send_messageSend an Instagram DM to a user by username.
send_photo_messageSend a photo as a DM to a user by username.
send_video_messageSend a video as a DM to a user by username.
list_chatsGet DM threads from your account, with optional filters and limits.
list_messagesGet messages in a thread by thread ID, including item_type and shared post/reel info.
download_media_from_messageDownload a direct-uploaded photo or video from a DM message.
download_shared_post_from_messageDownload media from a shared post, reel, or clip in a DM message.
list_media_messagesList all messages containing direct-uploaded media in a thread.
Security
You hand the server your real Instagram username and password (stored in a local .env plus reused session files), and it can read and send DMs as you. This is unofficial account automation, not the Meta API — Instagram may restrict accounts that automate logins, so consider a secondary account.
Instagram DM MCP + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Instagram DM MCP config there under the "mcpServers" key and restart the client.
Is Instagram DM MCP safe to use with Windsurf?
You hand the server your real Instagram username and password (stored in a local .env plus reused session files), and it can read and send DMs as you. This is unofficial account automation, not the Meta API — Instagram may restrict accounts that automate logins, so consider a secondary account.
Is the Instagram DM MCP safe for my main account?
Treat it as risky for a main account: it is unofficial automation that logs in with your real username and password and acts as you, and Instagram can flag automated behavior. Credentials stay local (in your .env and session files), but many users run it on a secondary account first. Session reuse at least avoids repeated logins.
Do I need a Meta developer account or Instagram API access?
No. It authenticates with a normal Instagram username and password — no developer app, access tokens, or business account required. That is also exactly why it is not an official integration.
Can it read and download messages, or only send them?
Both. list_chats, list_messages and search_threads read conversations; download_media_from_message and download_shared_post_from_message pull photos, videos and shared reels; list_pending_chats covers the request inbox. Sending supports text, photos and videos.