Skip to main content
Glama

Instagram MCP Server

by duhlink

Instagram MCP 服务器

使用 Chrome 现有登录会话获取 Instagram 帖子的模型上下文协议 (MCP) 服务器。

特征

  • 具有明确关注点分离的模块化架构
  • 使用 TypeScript 的类型安全实现
  • 改进的错误处理和日志记录
  • 可通过环境变量配置
  • 符合 JSON-RPC 2.0 的通信
  • 自动媒体下载和元数据生成
  • 搜索引擎优化友好的描述生成

建筑学

该服务器采用模块化架构,结构如下:

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

配置

服务器需要以下环境变量:

  • CHROME_USER_DATA_DIR :包含登录会话的 Chrome 用户数据目录的路径

可以通过配置管理器获得其他配置选项:

  • 浏览器设置(视口、超时)
  • Instagram 设置(延迟、批量大小)
  • 保存目录和文件路径

用法

  1. 安装依赖项:
    npm install
  2. 构建服务器:
    npm run build
  3. 运行服务器:
    CHROME_USER_DATA_DIR=/path/to/chrome/profile npm start

可用工具

获取 Instagram 帖子

从 Instagram 个人资料中获取最近的帖子。

参数:

  • username (必填):用于获取帖子的 Instagram 用户名
  • limit (可选):要获取的帖子数量(1-50)或“全部”
  • saveDir (可选):保存媒体文件和元数据的目录
  • delayBetweenPosts (可选):处理帖子之间等待的毫秒数

例子:

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

错误处理

服务器使用标准化的错误代码和消息:

  • INVALID_REQUEST :请求格式或参数无效
  • INVALID_PARAMS :缺少参数或参数无效
  • METHOD_NOT_FOUND :未知方法或工具
  • INTERNAL_ERROR :服务器端错误

发展

  1. 以开发模式启动:
    npm run dev
  2. 运行 linter:
    npm run lint

比原版有所改进

  1. 模块化架构
    • 清晰的关注点分离
    • 更好的代码组织
    • 更易于维护和扩展
  2. 类型安全
    • 全面的 TypeScript 类型
    • 更好的错误捕获
    • 改进的 IDE 支持
  3. 错误处理
    • 标准化错误代码
    • 更好的错误消息
    • 适当的错误传播
  4. 配置
    • 集中配置
    • 环境变量验证
    • 类型安全的配置访问
  5. 代码质量
    • 一致的编码风格
    • 更好的文档
    • 改进的日志记录
  6. 测试支持
    • 模块化设计支持测试
    • 依赖注入准备就绪
    • 清晰的界面

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

允许通过模型上下文协议 (MCP) 使用 Chrome 现有的登录会话获取 Instagram 帖子的服务器。

  1. 特征
    1. 建筑学
      1. 配置
        1. 用法
          1. 可用工具
            1. 获取 Instagram 帖子
          2. 错误处理
            1. 发展
              1. 比原版有所改进
                1. 执照

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol (MCP) server for managing social media posts, currently supporting X (formerly Twitter).
                    Last updated -
                    3
                    7
                    JavaScript
                    MIT License
                  • -
                    security
                    F
                    license
                    -
                    quality
                    This server provides a standardized framework using the Model Context Protocol (MCP) to seamlessly integrate and manage diverse tools, enabling features like Twitter automation, cryptocurrency updates, and ElizaOS interaction.
                    Last updated -
                    2
                    Python
                  • A
                    security
                    A
                    license
                    A
                    quality
                    An MCP server that provides tools for interacting with Chrome through its DevTools Protocol, enabling remote control of Chrome tabs to execute JavaScript, capture screenshots, monitor network traffic, and more.
                    Last updated -
                    7
                    30
                    14
                    TypeScript
                    MIT License
                    • Linux
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.
                    Last updated -
                    Python
                    MIT License

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/duhlink/instagram-server-next-mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server