Efficient modular MCP server for fetching and downloading Instagram posts using TypeScript and Chrome sessions
The Instagram MCP Server is a specialized Model Context Protocol (MCP) server designed to fetch recent posts from an Instagram profile, integrating seamlessly with various AI applications such as Claude Desktop, Continue, and Cursor. By leveraging the power of the Instagram API through Chrome's existing login session, this server enables these applications to access and utilize rich media content in their workflows.
The Instagram MCP Server boasts several key features that make it an indispensable tool for AI application developers:
Modular Architecture:
Improved Error Handling & Logging:
Configuration Through Environment Variables:
JSON-RPC 2.0 Compliance:
Automatic Media Downloading & Metadata Generation:
SEO-Friendly Description Generation:
The Instagram MCP Server follows a modular architecture as illustrated below:
graph TD
src -->|Core functionality| core/mcp/server.ts
src -->|Type definitions| core/types/mcp.ts
src -->|Utils| utils/config.ts, utils/errors.ts
src -->|Feature modules| features/instagram/types.ts, features/instagram/utils/media.ts, etc.
src -->|Shared services| services/browser/types.ts, services/browser/browser.service.ts
graph TD
features/instagram/Types Ts --> features/instagram/utils/post.ts
features/instagram/U utils --> features/instagram/services/instagram.service.ts
To set up the Instagram MCP Server, follow these steps:
npm install
npm run build
CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start
Scenario: A content curator needs to fetch up-to-date images from popular Instagram profiles and incorporate them into Claude Desktop's text-based articles.
Technical Implementation:
graph LR
subgraph AI Application["Claude Desktop"]
A[Send MCP Request] -->|JSON-RPC 2.0|MCP Client
end
subgraph MCP Client["Instagram MCP Server"]
B[MCP Request Parsing] --> C[Server Command Execution]
D[Data Fetching from Instagram] --> E[Media Processing & Metadata Generation]
F[SEO Description Generation] --> G[mcpProtocol Response]
end
subgraph Data Source/Tool["Instagram Profile"]
H[Fetch Latest Posts] --> I[Return Media Files & Meta Data]
J[SEO Optimization of Descriptions] --> K[Send SEO-Optimized Content to MCP Client]
end
A --> B
B --> C
C --> D
D --> E
E --> F
F --> G
G --> J
J --> K
table
|MCP Client| Claude Desktop | Continue | Cursor |
|---|---|---|---|
|Resources| ✅ | ✅ | ❌ |
|Tools| ✅ | ✅ | ✅ |
|Prompts| ✅ | ✅ | ❌ |
|Status| Full Support | Full Support | Tools Only |
Scenario: An image database requires automatic collection of recent posts from top Instagram accounts to train a machine learning model.
Technical Implementation:
graph LR
subgraph AI Application["Cursor"]
A[Send MCP Request] -->|JSON-RPC 2.0|MCP Client
end
subgraph MCP Client["Instagram MCP Server"]
B[MCP Request Parsing] --> C[Server Command Execution]
D[Data Fetching from Instagram] --> E[Media Processing & Metadata Generation]
F[SEO Description Generation] --> G[mcpProtocol Response]
end
subgraph Data Source/Tool["Instagram Profile"]
H[Fetch Latest Posts] --> I[Return Media Files & Meta Data]
J[SEO Optimization of Descriptions] --> K[Send SEO-Optimized Content to MCP Client]
end
A --> B
B --> C
C --> D
D --> E
E --> F
F --> G
G --> J
J --> K
The Instagram MCP Server seamlessly integrates with various AI applications via the Model Context Protocol, providing a consistent and standardized way for applications to interact with external data sources. The following MCP clients are supported:
table
|MCP Client| Resources| Tools| Prompts| Status|
|---|---|---|---|---|
|Claude Desktop| ✅ | ✅ | ✅ | Full Support |
|Continue| ✅ | ✅ | ✅ | Full Support |
|Cursor| ❌ | ✅ | ✅ | Tools Only |
The server has been designed with performance and compatibility in mind, ensuring seamless integration across different AI applications. The following matrix provides a summary of the server's capabilities:
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Q: How do I integrate the Instagram MCP Server with my AI application?
Q: Which AI applications are currently compatible with this server?
Q: Can I use a custom Chrome profile for fetching Instagram posts?
CHROME_USER_DATA_DIR
environment variable.Q: How does the server handle errors during the fetching process?
Q: Is it possible to customize the SEO descriptions generated by this server?
For developers interested in contributing to or enhancing the Instagram MCP Server:
npm run dev
npm run lint
Contributions are welcome, and detailed guidelines can be found in the project's documentation.
For developers interested in learning more about the Model Context Protocol and its applications:
This comprehensive documentation highlights the key features, architecture, and capabilities of the Instagram MCP Server. By providing clear instructions for setup and usage, as well as addressing common questions, this guide empowers developers to integrate and utilize the server effectively within their AI applications.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Set up MCP Server for Alpha Vantage with Python 312 using uv and MCP-compatible clients