This MCP server allows you to fetch Instagram posts using Chrome's existing login session, leveraging a Model Context Protocol implementation for standardized communication and data handling.
To get the Instagram MCP server up and running, follow these steps:
npm install
npm run build
CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start
Replace /path/to/chrome/profile
with the actual path to your Chrome user data directory that contains the Instagram login session.
CHROME_USER_DATA_DIR
: Path to Chrome user data directory containing your Instagram login sessionThe server supports additional configuration options for:
The MCP server communicates using JSON-RPC 2.0 protocol. Here's how to interact with it:
You can use the get_instagram_posts
tool to retrieve posts from an Instagram profile:
username
(required): The Instagram username to fetch posts fromlimit
(optional): Number of posts to fetch (between 1-50) or "all"saveDir
(optional): Directory where media files and metadata will be saveddelayBetweenPosts
(optional): Milliseconds to wait between processing posts{
"jsonrpc": "2.0",
"id": 1,
"method": "call_tool",
"params": {
"name": "get_instagram_posts",
"arguments": {
"username": "example",
"limit": 10
}
}
}
This request will fetch 10 most recent posts from the Instagram user "example".
The server provides standardized error responses:
INVALID_REQUEST
: Your request format or parameters are invalidINVALID_PARAMS
: Required parameters are missing or invalidMETHOD_NOT_FOUND
: The requested method or tool doesn't existINTERNAL_ERROR
: Server-side errors occurred during processingWhen an error occurs, you'll receive a standard JSON-RPC error response with details about what went wrong.
The server automatically downloads media files from Instagram posts and organizes them in the specified save directory. This includes:
The server generates SEO-friendly descriptions for each post based on captions and content, which can be useful for indexing or displaying the content elsewhere.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "instagram-server-next-mcp" '{"command":"npx","args":["-y","instagram-server-next-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"instagram-server-next-mcp": {
"command": "npx",
"args": [
"-y",
"instagram-server-next-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"instagram-server-next-mcp": {
"command": "npx",
"args": [
"-y",
"instagram-server-next-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect