Instagram MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
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:Copy
- Build the server:Copy
- Run the server:Copy
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:Copy
- Run linter:Copy
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
You must be authenticated.
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