Skip to main content
Glama
duhlink

Instagram MCP Server

by duhlink

Servidor MCP de Instagram

Un servidor de Protocolo de contexto de modelo (MCP) para obtener publicaciones de Instagram utilizando la sesión de inicio de sesión existente de Chrome.

Características

  • Arquitectura modular con clara separación de preocupaciones

  • Implementación segura de tipos usando TypeScript

  • Manejo y registro de errores mejorados

  • Configurable a través de variables de entorno

  • Comunicación compatible con JSON-RPC 2.0

  • Descarga automática de medios y generación de metadatos

  • Generación de descripciones optimizadas para SEO

Related MCP server: instagram-mcp

Arquitectura

El servidor sigue una arquitectura modular con la siguiente estructura:

src/
├── core/                      # Core MCP functionality
│   ├── mcp/                  # MCP server implementation
│   │   ├── server.ts        # Server class
│   │   ├── stdio.ts         # StdioServerTransport
│   │   └── index.ts         # Barrel exports
│   ├── types/               # Core type definitions
│   │   └── mcp.ts          # MCP types
│   └── utils/               # Utility functions
│       ├── config.ts        # Configuration management
│       └── errors.ts        # Error handling
├── features/                 # Feature modules
│   └── instagram/           # Instagram feature
│       ├── types.ts         # Instagram types
│       ├── utils/           # Feature utilities
│       │   ├── media.ts     # Media handling
│       │   ├── post.ts      # Post processing
│       │   └── seo.ts       # SEO generation
│       └── instagram.service.ts # Instagram service
├── services/                 # Shared services
│   └── browser/             # Browser service
│       ├── types.ts         # Browser types
│       └── browser.service.ts # Browser service
├── index.ts                 # Entry point
└── server.ts                # Main server class

Configuración

El servidor requiere las siguientes variables de entorno:

  • CHROME_USER_DATA_DIR : Ruta al directorio de datos de usuario de Chrome que contiene la sesión de inicio de sesión

Hay opciones de configuración adicionales disponibles a través del administrador de configuración:

  • Configuración del navegador (ventana gráfica, tiempos de espera)

  • Configuración de Instagram (retrasos, tamaños de lotes)

  • Guardar directorios y rutas de archivos

Uso

  1. Instalar dependencias:

    npm install
  2. Construir el servidor:

    npm run build
  3. Ejecutar el servidor:

    CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start

Herramientas disponibles

obtener publicaciones de Instagram

Obtiene publicaciones recientes de un perfil de Instagram.

Parámetros:

  • username (obligatorio): Nombre de usuario de Instagram del cual obtener publicaciones

  • limit (opcional): Número de publicaciones a recuperar (1-50) o "todas"

  • saveDir (opcional): Directorio para guardar archivos multimedia y metadatos

  • delayBetweenPosts (opcional): milisegundos de espera entre el procesamiento de publicaciones

Ejemplo:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "call_tool",
  "params": {
    "name": "get_instagram_posts",
    "arguments": {
      "username": "example",
      "limit": 10
    }
  }
}

Manejo de errores

El servidor utiliza códigos y mensajes de error estandarizados:

  • INVALID_REQUEST : Formato o parámetros de solicitud no válidos

  • INVALID_PARAMS : Parámetros faltantes o no válidos

  • METHOD_NOT_FOUND : Método o herramienta desconocidos

  • INTERNAL_ERROR : Errores del lado del servidor

Desarrollo

  1. Iniciar en modo de desarrollo:

    npm run dev
  2. Ejecutar linter:

    npm run lint

Mejoras respecto al original

  1. Arquitectura modular

    • Separación clara de preocupaciones

    • Mejor organización del código

    • Más fácil de mantener y ampliar

  2. Seguridad de tipos

    • Tipos de TypeScript completos

    • Mejor detección de errores

    • Compatibilidad IDE mejorada

  3. Manejo de errores

    • Códigos de error estandarizados

    • Mejores mensajes de error

    • Propagación adecuada de errores

  4. Configuración

    • Configuración centralizada

    • Validación de variables de entorno

    • Acceso a configuración de tipo seguro

  5. Calidad del código

    • Estilo de codificación consistente

    • Mejor documentación

    • Registro mejorado

  6. Soporte de pruebas

    • El diseño modular permite realizar pruebas

    • Listo para inyección de dependencia

    • Interfaces claras

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Available Tools

1 tool
get_instagram_postsC

Get recent posts from an Instagram profile using existing Chrome login

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of posts to fetch (1-3) or "all" for continuous batches
startFromNoIndex to start fetching from (for pagination)
usernameYesInstagram username to fetch posts from

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only mentions 'using existing Chrome login' as a behavioral trait, hinting at authentication needs. It fails to disclose critical behaviors like rate limits, pagination mechanics (implied by 'startFrom' but not explained), error handling, or what 'recent' means temporally, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core action and key constraint ('using existing Chrome login'). It's front-loaded with the main purpose, though it could be slightly more structured by separating functional from implementation details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool with 3 parameters and behavioral complexity. It lacks details on return values (e.g., post format, errors), authentication specifics, or operational limits, making it inadequate for full agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents parameters like 'limit' and 'startFrom'. The description adds no additional meaning beyond what's in the schema, such as clarifying 'recent' in relation to parameters or usage context, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get recent posts') and target resource ('from an Instagram profile'), making the purpose understandable. However, it doesn't differentiate from siblings (none exist), and the phrase 'using existing Chrome login' adds implementation detail rather than clarifying the core purpose, slightly reducing specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints beyond the implied need for Chrome login. With no siblings, differentiation isn't needed, but it lacks context like when to fetch posts (e.g., for monitoring, analysis) or any exclusions, leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedget_instagram_posts

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as retrieving Instagram posts, leaving no room for misselection.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern (get_instagram_posts), which is consistent and predictable. Since there is only one tool, naming consistency is inherently perfect.

Tool Count2/5

One tool is too few for a server labeled 'Instagram MCP Server', which implies broader Instagram functionality. This minimal toolset feels thin and under-scoped for the apparent domain, limiting agent capabilities.

Completeness2/5

The tool surface is severely incomplete for Instagram operations. It only allows retrieving posts, with no coverage for actions like posting, commenting, liking, or managing profiles, leading to significant gaps that will cause agent failures.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers