- Home
- MCP servers
- Instagram DM
Instagram DM
- javascript
17
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"taskmaster-ai-insta-mcp": {
"command": "npx",
"args": [
"-y",
"instagram-dm-mcp",
"start"
],
"env": {
"INSTAGRAM_CSRF_TOKEN": "your-csrf-token",
"INSTAGRAM_DS_USER_ID": "your-ds-user-id",
"INSTAGRAM_SESSION_ID": "your-session-id"
}
}
}
}You deploy the Instagram DM MCP Server to enable AI assistants to read and send Instagram direct messages through a lightweight MCP interface. It supports multiple authentication methods, health checks, and structured logs, making it practical for automating Instagram DM workflows while keeping credentials secure.
How to use
You interact with the Instagram DM MCP Server through an MCP client. Start the server, provide your Instagram cookies or credentials, and then issue read and send commands via the MCP protocol to read recent inbox threads or send direct messages. The server exposes a health endpoint and logs output to stderr to avoid JSON parsing issues in some clients.
Typical capabilities you can leverage include reading recent conversations with thread details, sending direct messages to Instagram users, and using a simple greeting resource for basic interactions. Ensure your MCP client is configured with the correct credentials so the server can access your Instagram account securely.
How to install
# Prerequisites
- Node.js and npm (Node 14+ or newer)
- Access to install global npm packages
Install the MCP package globally and set up Python dependencies as part of the install flow.
npm install -g instagram-dm-mcp
instagram-dm-mcp-setup
Register the server with an MCP client (Claude Desktop in this flow) and configure credentials. You will provide your Instagram cookies (sessionid, csrftoken, ds_user_id) during setup.
instagram-dm-mcp install
Provide credentials in one of these ways. You can paste cookies during the install process, pass them via command-line arguments, a credentials file, or by setting environment variables.
# Example: command-line arguments
instagram-dm-mcp install --session-id YOUR_SESSION_ID --csrf-token YOUR_CSRF_TOKEN --ds-user-id YOUR_DS_USER_ID
# Example: credentials file
instagram-dm-mcp install --from-file /path/to/instagram_cookies.json
# Example: environment variables
# INSTAGRAM_SESSION_ID=... INSTAGRAM_CSRF_TOKEN=... INSTAGRAM_DS_USER_ID=...
Additional notes
The installer configures the MCP server to use a standard, easily maintainable runtime. It uses the npx approach by default, which simplifies updates and dependencies across environments.
Environment variables you should be aware of include INSTAGRAM_SESSION_ID, INSTAGRAM_CSRF_TOKEN, and INSTAGRAM_DS_USER_ID. These are used to authenticate with Instagram and should be kept secure. The setup process will add these credentials to your MCP client configuration so they are available to the server at runtime.
Health checks are available to confirm the server is running and responsive. Logs are written to stderr to avoid issues with downstream JSON parsing in some MCP clients.
Available tools
read_messages
Reads recent direct messages from your Instagram inbox and returns thread information for each conversation.
send_message
Sends a direct message to a specified Instagram user from within the MCP client.
greeting
Provides a simple greeting resource for basic interactions with the DM interface.
health_check
Offers a health check endpoint that reports the server status and readiness.
logging
Logs server activity to stderr to avoid JSON parsing issues in some clients.