
一个用于Instagram直通消息功能的MCP(Model-Concer Protocol)服务器,由快取和Instagrapi所建. 此服务器允许AI助手读取并发送Instagram直接消息.
概览
一个用于Instagram直通消息功能的MCP(Model-Concer Protocol)服务器,由快取和Instagrapi所建. 此服务器允许AI助手读取并发送Instagram直接消息. - 读取您Instagram收件箱中包含全面线程信息的最新直接信息 - 直接向Instagram用户发送信息 - 简单问候资源(例功能) - 状态信息的健康检查端点 - 正确记录为 stderr 以避免 JSON 解析问题 - 支持各种认证方法,包括环境变量 2. 运行安装 Python 依赖的设置脚本: 3. 用克洛德桌面注册服务器并配置证书: 你会被提示在你的Instagram饼干信息中粘贴. 如果你不确定如何得到这个,请登录Chrome上的Instagram,右键点击页面,并选择"督察". 转到"应用"分页,再点击左侧栏的"Cookies". 你应该看看饼干清单.
概述(AI 翻译)
一个用于Instagram直接消息功能的MCP(模型-消费者协议)服务器,以[[T0]和instagrapi来构建. 此服务器允许AI助手读取并发送Instagram直接消息.
** 当前版本: 1.3.5**
□ 特性
- 读取您Instagram收件箱中最近直接发来的信息,其中包含全面的线程信息
- 直接向Instagram用户发送信息
- 简单的问候资源(例如功能)
- 附有状况信息的健康检查终点
- 适当伐木以避免JSON分析问题
- 支持各种认证方法,包括环境变量
□ 安装
作为 npm 包(推荐)
-
在全球安装软件包:
-
运行安装 Python 依赖的设置脚本:
-
用克洛德桌面注册服务器并配置证书:
你会被提示在你的Instagram饼干信息中粘贴. 如果你不确定如何得到这个,请登录Chrome上的Instagram,右键点击页面,并选择"督察". 转到"应用"分页,再点击左侧栏的"Cookies". 你应该看看饼干清单 复制[[T2]、[T3]和ds_user_id的值.
本页由 AI 翻译,技术细节请以原文为准。
README
Instagram DM MCP Server
An MCP (Model-Consumer Protocol) server for Instagram direct messaging functionality, built with fastmcp and instagrapi. This server enables AI assistants to read and send Instagram direct messages.
Current Version: 1.3.5
Features
- Read recent direct messages from your Instagram inbox with comprehensive thread information
- Send direct messages to Instagram users
- Simple greeting resource (example functionality)
- Health check endpoint with status information
- Proper logging to stderr to avoid JSON parsing issues
- Support for various authentication methods, including environment variables
Installation
As an npm package (recommended)
- Install the package globally:
npm install -g instagram-dm-mcp
- Run the setup script to install Python dependencies:
instagram-dm-mcp-setup
- Register the server with Claude Desktop and configure credentials:
instagram-dm-mcp install
You will be prompted to paste in your Instagram cookies information. If you arne’t sure how to get this, log into Instagram on Chrome, right-click on the page, and select “Inspect”. Go to the “Application” tab, then click on “Cookies” in the left sidebar. You should see a list of cookies. Copy the values for sessionid, csrftoken, and ds_user_id.
The install command will automatically register the Instagram DM MCP server with Claude Desktop and add it to your Claude Desktop configuration file. The command will configure the server to use the npx approach, which makes it easier to maintain. You can also copy-paste the same setup to Claude or any other MCP client.
You can provide Instagram credentials in several ways:
-
Using command-line arguments:
instagram-dm-mcp install --session-id YOUR_SESSION_ID --csrf-token YOUR_CSRF_TOKEN --ds-user-id YOUR_DS_USER_ID -
Using a credentials file:
instagram-dm-mcp install --from-file /path/to/instagram_cookies.json -
Using environment variables (INSTAGRAM_SESSION_ID, INSTAGRAM_CSRF_TOKEN, and INSTAGRAM_DS_USER_ID)
The installer will add these credentials as environment variables in the Claude Desktop configuration file, creating a configuration like this:
"mcpServers": {
// other servers...
"InstagramDM": {
"command": "npx",
"args": [
"-y",
"instagram-dm-mcp",
"start"
],
"env": {
"INSTAGRAM_SESSION_ID": "your-session-id",
"INSTAGRAM_CSRF_TOKEN": "your-csrf-token",
"INSTAGRAM_DS_USER_ID": "your-ds-user-id"
}
}
}
安装
npx -y instagram-dm-mcp start配置
"mcpServers": {
// other servers...
"InstagramDM": {
"command": "npx",
"args": [
"-y",
"instagram-dm-mcp",
"start"
],
"env": {
"INSTAGRAM_SESSION_ID": "your-session-id",
"INSTAGRAM_CSRF_TOKEN": "your-csrf-token",
"INSTAGRAM_DS_USER_ID": "your-ds-user-id"
}
}
}