Get the FREE Ultimate OpenClaw Setup Guide →

instagram -next

MCP server from duhlink/instagram-server-next-mcp

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio duhlink-instagram-server-next-mcp node dist/server.js \
  --env CHROME_USER_DATA_DIR="Path to Chrome user data directory containing login session"

How to use

This MCP server provides a JSON-RPC 2.0 interface to fetch and process Instagram posts by reusing an existing Chrome login session. The core feature exposed is get_instagram_posts, which retrieves recent posts from a specified Instagram profile and can optionally download media and generate metadata. The server is built with TypeScript and offers modular components for core MCP functionality, Instagram-specific logic, and browser automation through a shared browser service. To use it, start the server with the required Chrome user data directory so the session is available, then send RPC calls to invoke get_instagram_posts with the desired parameters. Example calls in the README show how to structure a request using the call_tool method to fetch posts for a given username and limit, optionally saving media to a directory and controlling processing delays.

How to install

Prerequisites:

  • Node.js (and npm) installed on your system
  • Access to a terminal/command prompt

Steps:

  1. Clone the repository: git clone https://github.com/duhlink-instagram-server-next-mcp.git cd duhlink-instagram-server-next-mcp

  2. Install dependencies: npm install

  3. Build the server (TypeScript to JavaScript): npm run build

  4. Run the server (providing the Chrome user data directory): CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start

Optional (development):

  • Start in development mode: npm run dev
  • Run linter: npm run lint

Additional notes

Tips and considerations:

  • The server relies on Chrome's profile data to reuse an existing login session; ensure CHROME_USER_DATA_DIR points to a valid Chrome user data directory with an active Instagram session.
  • The get_instagram_posts tool supports parameters like username, limit, saveDir, and delayBetweenPosts. Use the JSON-RPC 2.0 payload structure shown in the README when calling tools remotely.
  • Check environment-specific configuration options under the config manager in the codebase for things like viewport settings, timeouts, batch sizes, and save paths.
  • If you encounter authentication or session issues, verify that the Chrome profile is still logged in to Instagram and that the browser automation layer can access the profile directory.
  • For production deployments, you may want to pin Node.js versions and lock dependencies to avoid breaking changes, and consider securing RPC access if exposed beyond a trusted network.

Related MCP Servers

Sponsor this space

Reach thousands of developers