Instagram MCP Server
Instagram MCP Server
Ein produktionsreifer Model Context Protocol (MCP)-Server für die Interaktion mit Instagram-/Meta-APIs. Ermöglicht KI-Agenten die Verwaltung von Inhalten, die Analyse von Leistungskennzahlen, die Recherche von Wettbewerbern und die Abwicklung von Publishing-Workflows über strukturierte MCP-Tools.
Funktionen
Kontoverwaltung: Profilabruf, Kontoeinblicke, Medienauflistung
Inhaltsanalysen: Einblicke in Beiträge, Reels und Storys mit Engagement-Kennzahlen
Inhaltsgenerierung: Reel-Ideen, Bildunterschriften, Hashtags, Inhaltskalender
Wettbewerbsrecherche: Profilanalyse, Inhaltsvergleich, Wettbewerbsberichte
Kommentarverwaltung: Klassifizierung, Moderation, Auto-Antwort-Workflows
Publishing-Workflow: Container-Erstellung, Medienveröffentlichung, Statusverfolgung
Lead-Bewertung: Analyse von Geschäftsleads mit Bewertungsstufen
Audit-Protokollierung: Vollständige Anfrage-/Antwort-Protokollierung mit Ausführungsmetriken
Related MCP server: Instagram Control MCP Server
Voraussetzungen
Python 3.10+
Meta-Developer-App mit Zugriff auf die Instagram-Graph-API
Instagram-Unternehmenskonto, das mit deiner Meta-App verbunden ist
Schnellstart
1. Klonen und Installieren
git clone <repository-url>
cd instagram-mcp
pip install -r requirements.txt2. Umgebung konfigurieren
cp .env.example .envBearbeite .env mit deinen Anmeldedaten:
META_APP_ID=your_meta_app_id
META_APP_SECRET=your_meta_app_secret
INSTAGRAM_ACCESS_TOKEN=your_instagram_access_token
INSTAGRAM_BUSINESS_ACCOUNT_ID=your_instagram_business_account_id3. Server starten
python server.pyDocker
docker-compose up --buildMCP-Client-Konfiguration
Füge Folgendes zu deiner MCP-Client-Konfiguration hinzu (z. B. Claude Desktop, Cursor):
{
"mcpServers": {
"instagram": {
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/instagram-mcp"
}
}
}Verfügbare Tools
Account-Tools
Tool | Beschreibung |
| Profilinformationen abrufen |
| Analysen auf Kontoebene abrufen |
| Medienposts auflisten |
| Detaillierte Post-Infos abrufen |
Analysetools
Tool | Beschreibung |
| Leistungskennzahlen für Posts |
| Leistungskennzahlen für Reels |
| Leistungskennzahlen für Storys |
| Beste Inhalte |
| Vergleich von Zeiträumen |
Inhaltstools
Tool | Beschreibung |
| Post-Struktur analysieren |
| Reel-Konzepte generieren |
| Bildunterschriften mit Hashtags generieren |
| Relevante Hashtags generieren |
| Mehr-Tage-Kalender erstellen |
| Inhaltsmuster identifizieren |
Wettbewerbs-Tools
Tool | Beschreibung |
| Wettbewerbsprofil analysieren |
| Mehrere Konten vergleichen |
| Top-Wettbewerbsinhalte finden |
| Vollständiger Wettbewerbsbericht |
Kommentar-Tools
Tool | Beschreibung |
| Kommentare abrufen und klassifizieren |
| Auf einen Kommentar antworten |
| Kommentare mit Klassifizierung moderieren |
Publishing-Tools
Tool | Beschreibung |
| Publishing-Container erstellen |
| Auf Instagram veröffentlichen |
| Veröffentlichungsstatus prüfen |
Lead-Tools
Tool | Beschreibung |
| Leads bewerten und analysieren |
Beispiel für natürliche Sprachbefehle
"What were my best performing Reels last month?"
→ instagram_get_reel_insights (multiple calls) → sort → analyze → top results
"Generate a 30-day content calendar for an AI automation agency"
→ instagram_generate_content_calendar
"Analyze my competitor @examplebrand"
→ instagram_analyze_competitor → instagram_find_competitor_content
"What comments need moderation on my latest post?"
→ instagram_get_comments → classify → filter
"Compare my engagement with @competitor1 and @competitor2"
→ instagram_compare_accountsKI-Entscheidungsebene
Der Server implementiert eine interne Entscheidungspipeline:
Benutzeranfrage – Eingabe in natürlicher Sprache
Absichtserkennung – Erforderliche Operation bestimmen
Berechtigungsprüfung – API-Zugriff validieren
Tool-Auswahl – Auf das passende MCP-Tool abbilden
Instagram-API – Autorisierte API-Aufrufe ausführen
Datenvalidierung – Antwortdaten validieren
Analysen/Logik – Ergebnisse verarbeiten und analysieren
Strukturierte Antwort – Formatiertes JSON zurückgeben
Kommentarklassifizierung
Kommentare werden automatisch in folgende Kategorien eingeteilt:
Kategorie | Beschreibung |
| Lob, Komplimente, positives Feedback |
| Beschwerden, Kritik, negative Stimmung |
| Fragen, Anfragen |
| Kaufabsicht, geschäftliche Anfragen |
| Werbe-Spam, Betrugsinhalte |
| Support-Anfragen, Problemberichte |
| Nicht klassifizierte Kommentare |
Lead-Bewertung
Bewertungsbereich | Stufe |
81-100 | Sehr hoch |
61-80 | Hoch |
31-60 | Mittel |
0-30 | Niedrig |
Bewertungsfaktoren: Follower-Anzahl, Veröffentlichungshäufigkeit, Geschäftskategorie, identifizierte Bedürfnisse, Vorhandensein einer Website.
Fehlerbehandlung
Alle Tools geben strukturierte Fehlerantworten zurück:
{
"success": false,
"error": {
"code": "RATE_LIMIT",
"message": "Instagram API rate limit reached.",
"retryable": true
}
}Fehlercodes: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, RATE_LIMIT, SERVER_ERROR, NETWORK_ERROR, INVALID_MEDIA, PERMISSION_MISSING
Projektstruktur
instagram-mcp/
├── server.py # Main MCP server with tool definitions
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── .env.example # Environment template
├── Dockerfile # Container configuration
├── docker-compose.yml # Docker Compose setup
├── mcp/
│ ├── tools/ # MCP tool implementations
│ │ ├── account.py # Account tools
│ │ ├── analytics.py # Analytics tools
│ │ ├── content.py # Content generation tools
│ │ ├── comments.py # Comment management tools
│ │ ├── publishing.py # Publishing workflow tools
│ │ └── competitors.py # Competitor research tools
│ └── schemas/ # Pydantic data models
│ ├── account.py
│ ├── content.py
│ └── analytics.py
├── services/ # Business logic layer
│ ├── instagram_api.py # Instagram Graph API client
│ ├── analytics.py # Analytics calculations
│ ├── content_ai.py # Content generation engine
│ └── lead_scoring.py # Lead analysis and scoring
├── database/ # Data persistence
│ ├── models.py # SQLAlchemy models
│ └── repository.py # Database operations
└── tests/ # Unit tests
├── test_account.py
├── test_analytics.py
├── test_publishing.py
└── test_errors.pyTests ausführen
pytest tests/ -vSicherheit
OAuth-2.0-Authentifizierung über die Meta-Graph-API
Zugriffstokens werden in Umgebungsvariablen gespeichert
Kein Scraping von Anmeldedaten oder Sitzungsextraktion
Berechtigungsprüfung vor Operationen
Rate-Limit-Handling mit Wiederholungslogik
Audit-Protokollierung für alle Tool-Ausführungen
Tokens oder Geheimnisse werden niemals in Antworten offengelegt
Lizenz
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for QPost — lets AI agents publish video and image posts to YouTube, TikTok, Instagram.
Agent-first social media publishing, scheduling, analytics, and unified inbox API + 16-tool MCP server across 18 social platforms (X, LinkedIn, Instagram, YouTube, TikTok, Threads, Bluesky, Reddit, Telegram, Discord, Mastodon, Facebook, Pinterest).
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
Hosted Instagram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that integrates with Instagram's Graph API to enable AI-driven management of Instagram Business accounts. It provides tools for fetching profile data, publishing media, analyzing engagement metrics, and managing direct messages.203MIT
- AlicenseBqualityCmaintenanceA professional, full-fidelity MCP server enabling AI agents to fully control and manage an Instagram account exactly like a human user.6821 PyPI5MIT
- AlicenseBqualityFmaintenanceMCP server that connects AI agents to Instagram for reading statistics, insights, and comments via the official Meta Graph API.162MIT
- AlicenseNot gradedqualityDmaintenanceA production-ready Remote MCP Server that gives Claude direct, tool-based access to your Instagram Business account through the Meta Graph API — profile data, posts, comments, publishing, insights, analytics, hashtags, messaging, and real-time webhooks.11 npmMIT