The Instagram MCP Server fetches and processes Instagram posts using Chrome's existing login session. Key capabilities include:
Fetch recent posts from an Instagram profile by specifying a username
Control the number of posts fetched (limit parameter accepts 1-50 or "all")
Fetch posts starting from a specific index using the
startFrom
parameterAutomatically download media files associated with posts
Generate metadata and SEO-friendly descriptions for posts
Configure through environment variables for Chrome user data, browser settings, and Instagram parameters
Utilize JSON-RPC 2.0 for standardized communication
Benefit from improved error handling with standardized codes and messages
Enables fetching and processing Instagram posts using Chrome's existing login session, with support for media downloading, metadata generation, and SEO-friendly description creation.
Instagram MCP Server
A Model Context Protocol (MCP) server for fetching Instagram posts using Chrome's existing login session.
Features
Modular architecture with clear separation of concerns
Type-safe implementation using TypeScript
Improved error handling and logging
Configurable through environment variables
JSON-RPC 2.0 compliant communication
Automatic media downloading and metadata generation
SEO-friendly description generation
Architecture
The server follows a modular architecture with the following structure:
Configuration
The server requires the following environment variables:
CHROME_USER_DATA_DIR
: Path to Chrome user data directory containing login session
Additional configuration options are available through the config manager:
Browser settings (viewport, timeouts)
Instagram settings (delays, batch sizes)
Save directory and file paths
Usage
Install dependencies:
npm installBuild the server:
npm run buildRun the server:
CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start
Available Tools
get_instagram_posts
Fetches recent posts from an Instagram profile.
Parameters:
username
(required): Instagram username to fetch posts fromlimit
(optional): Number of posts to fetch (1-50) or "all"saveDir
(optional): Directory to save media files and metadatadelayBetweenPosts
(optional): Milliseconds to wait between processing posts
Example:
Error Handling
The server uses standardized error codes and messages:
INVALID_REQUEST
: Invalid request format or parametersINVALID_PARAMS
: Missing or invalid parametersMETHOD_NOT_FOUND
: Unknown method or toolINTERNAL_ERROR
: Server-side errors
Development
Start in development mode:
npm run devRun linter:
npm run lint
Improvements Over Original
Modular Architecture
Clear separation of concerns
Better code organization
Easier to maintain and extend
Type Safety
Comprehensive TypeScript types
Better error catching
Improved IDE support
Error Handling
Standardized error codes
Better error messages
Proper error propagation
Configuration
Centralized configuration
Environment variable validation
Type-safe config access
Code Quality
Consistent coding style
Better documentation
Improved logging
Testing Support
Modular design enables testing
Dependency injection ready
Clear interfaces
License
MIT
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
A server that allows fetching Instagram posts using Chrome's existing login session via Model Context Protocol (MCP).
- Features
- Architecture
- Configuration
- Usage
- Available Tools
- Error Handling
- Development
- Improvements Over Original
- License
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server for managing social media posts, currently supporting X (formerly Twitter).Last updated -8MIT License
- AsecurityAlicenseAqualityA Pinterest Model Context Protocol (MCP) server for image search and information retrievalLast updated -3516MIT License
- AsecurityFlicenseAqualityA lightweight MCP service that enables programmatic downloading of Instagram videos to a specified local path with progress tracking.Last updated -13
- -securityAlicense-qualityA Model Context Protocol server that enables Claude or Cursor to send direct messages on Instagram, allowing AI assistants to interact with Instagram's messaging system.Last updated -135MIT License