mcp-instagram: Instructions file for Codex

AGENTS.md

mcp-instagram AGENTS.md is an instructions file for Codex, OpenCode from smorand/mcp-instagram. It costs 968 tokens per session, scanned A, original, MIT.

Project instructions for mcp-instagram, a local server that downloads Instagram videos, audio, carousels, and image posts.

In plain words
What is it for?
Use them when installing dependencies, running the server in its supported modes, changing the downloader or CLI, building its Docker image, or running lint, type checks, security checks, and tests.
Why use it?
They give a coding agent the project's commands, layout, conventions, and checks needed to work on it consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is smorand/mcp-instagram's own configuration. It tells Codex and OpenCode how to work on mcp-instagram itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-instagram configures →

Reuse

Borrowing it

Nothing to install: this file belongs to smorand/mcp-instagram. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/smorand/mcp-instagram/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/smorand/mcp-instagram

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-instagram AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/smorand/mcp-instagram/agents-md/github.svg)](https://agentmods.dev/instructions/smorand/mcp-instagram/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/smorand/mcp-instagram/agents-md"><img src="https://agentmods.dev/badge/instructions/smorand/mcp-instagram/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-instagram AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/smorand/mcp-instagram/agents-md"><img src="https://agentmods.dev/badge/instructions/smorand/mcp-instagram/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 968 This file is loaded in full into every session.
When invoked 968 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00968 $0.00968
Opus 5.5 $0.00387 $0.00387
Sonnet 5.5 $0.00194 $0.00194
Haiku 4.5 $0.00097 $0.00097

Measured 1mo ago against content hash b1dd8a914e58, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-instagram AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mcp-instagram

Overview

MCP server for downloading Instagram content using yt-dlp. Exposes 4 tools: download_video, download_audio, download_carousel, get_metadata. Supports stdio and HTTP streamable transports.

download_carousel also handles single image posts (GraphImage): yt-dlp raises "There is no video in this post", so image-only content (single or sidecar) is fetched via instaloader metadata + httpx.

Tech Stack: Python 3.13, FastMCP, yt-dlp, Typer, Pydantic, OpenTelemetry

Key Commands

make sync               # Install dependencies
make run ARGS='stdio'   # Run in stdio mode
make run ARGS='http'    # Run in HTTP mode
make run ARGS='skill'   # Print CLI usage guide (for LLMs/agents, stdout only)
make check              # Full quality gate (lint, format, typecheck, security, tests+coverage)
make docker-build       # Build Docker image

Project Structure

  • src/mcp_instagram.py : CLI entry point + FastMCP server + tool registrations. The skill command prints SKILL_TEXT (CLI usage guide) to stdout for agents; keep it in sync with the dl command options.
  • src/downloader.py : InstagramDownloader service (wraps yt-dlp, async via to_thread)
  • src/models.py : Pydantic models: DownloadResult, CarouselResult, MediaMetadata (all carry an optional description = full post caption)
  • src/config.py : Settings via pydantic-settings (MCP_INSTAGRAM_ prefix)
  • src/logging_config.py : Logging setup with rich + file output
  • src/tracing.py : OpenTelemetry tracing with JSONL export

Conventions

  • Entry point binary: mcp-instagram
  • All yt-dlp calls wrapped in asyncio.to_thread (sync yt-dlp, async interface)
  • OTel spans named instagram.<operation> (e.g., instagram.download_video)
  • Logs to mcp-instagram.log; traces to mcp-instagram-otel.log
  • Cookies: set MCP_INSTAGRAM_COOKIES_FILE to Netscape cookies.txt path
  • Settings uses extra="ignore": .env holds unrelated keys (INSTAGRAM_USERNAME/PASSWORD for scripts/list-saved.py) and pydantic-settings would otherwise raise extra_forbidden
  • Image extension comes from the HTTP Content-Type, not the URL suffix (CDN serves JPEG on .heic paths)
  • Captions: yt-dlp puts the full caption in info["description"]; title is only "Video by <user>" / "Post by <user>". instaloader exposes it as Post.caption. Both go through _caption() (strip, blank becomes None) and land in the description field. Never truncate it in the model; truncate only at display time (_CAPTION_DISPLAY_LIMIT, 500 chars)
  • dl --json prints the raw model as JSON on stdout (logs stay on stderr) and forces quiet logging; it is the way for an agent to get the untruncated caption
  • Rich printing of user content uses markup=False: a caption containing [...] would otherwise be swallowed as rich markup
  • Expected yt-dlp failures (image posts in _get_metadata_sync) are silenced via _QuietYdlLogger
  • ffmpeg/ffprobe resolved through _ffbin (absolute path via shutil.which, clear RuntimeError if missing)

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +3 lines · +173 tokens per session b1dd8a914e58
  2. 2mo ago First seen · 69 lines · 795 tokens per session scan A 29d0965134e9

Subscribe to this mod's changes

mcp-instagram AGENTS.md is an instructions file published in the GitHub repository smorand/mcp-instagram (0 stars, last pushed 1mo ago), licensed MIT. It adds 968 tokens to every session, about $0.0039 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mcp-instagram AGENTS.md compared with instructions from other repositories

mcp-instagram AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-instagram AGENTS.mdsmorand/mcp-instagramInstructions file01mo agoMITA968Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot