youtube-mcp: Instructions file for GitHub Copilot

.github/copilot-instructions.md

youtube-mcp copilot-instructions.md is an instructions file for GitHub Copilot from granitebps/youtube-mcp. It costs 1,375 tokens per session, scanned A, original, ISC.

A project-specific instruction file for Copilot describing the youtube-mcp project's build, test, lint, architecture, and coding conventions.

In plain words
What is it for?
Use it when building, testing, linting, or changing the youtube-mcp project.
Why use it?
It gives the coding agent repository-specific guidance instead of relying only on general programming assumptions.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is granitebps/youtube-mcp's own configuration. It tells GitHub Copilot how to work on youtube-mcp 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 youtube-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to granitebps/youtube-mcp. 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/granitebps/youtube-mcp/main/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/granitebps/youtube-mcp

Made for: GitHub Copilot.

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 youtube-mcp copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/granitebps/youtube-mcp/copilot-instructions/github.svg)](https://agentmods.dev/instructions/granitebps/youtube-mcp/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/granitebps/youtube-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/granitebps/youtube-mcp/copilot-instructions/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 youtube-mcp copilot-instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/granitebps/youtube-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/granitebps/youtube-mcp/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,375 This file is loaded in full into every session.
When invoked 1,375 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.01375 $0.01375
Opus 5.5 $0.00550 $0.00550
Sonnet 5.5 $0.00275 $0.00275
Haiku 4.5 $0.00137 $0.00137

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

Security

Grade A, and why

youtube-mcp copilot-instructions.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 19d 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.

.github/copilot-instructions.md · 53 lines

How it starts

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

Copilot Instructions

Build, test, and lint commands

  • npm install installs dependencies.
  • npm run build compiles the TypeScript source in src/ to dist/. This is the main verification command currently configured in the repo.
  • npm start runs the built MCP server over stdio from dist/index.js.
  • npm run start:http runs the built server in Streamable HTTP mode. node dist/index.js --http is equivalent.
  • npm run dev and npm run dev:http do a one-time tsc build and then start the server; they are not watch-mode commands.
  • npm run check runs npm test plus the release checks: check:release (package, lockfile, and server.json versions agree; workflow policy), check:package (packed file allow-list), and check:install (installs the packed tarball and lists tools over stdio). CI runs it on Node 22.21.0 and 24.
  • Releases follow RELEASE.md: a pushed v* tag publishes npm, then the MCP Registry, then a GitHub release. Never create or push a release tag without explicit approval of the version and commit. Keep the version in package.json, package-lock.json, and server.json in sync, and add docs/release-notes-vX.Y.Z.md plus a CHANGELOG.md entry.
  • npm test builds and runs the offline suite in test/*.test.mjs with Node's built-in test runner against dist/. Tests replace globalThis.fetch with fakes from test/helpers.mjs; they never touch the network. Run one file with npm run build && node --test test/transcript.test.mjs.
  • There is no lint script.

High-level architecture

  • src/index.ts is the only entrypoint. It builds an McpServer, registers all tools, and then selects the transport:
    • stdio by default via StdioServerTransport
    • HTTP when --http is passed or TRANSPORT=http is set
  • In HTTP mode, src/index.ts builds an Express app through the MCP SDK, adds optional bearer-token auth with API_TOKEN, rate-limits /mcp, and keeps a Map<string, StreamableHTTPServerTransport> so each MCP session can continue across requests.
  • Each tool lives in src/tools/ and follows the same pattern:
    • export a Zod schema
    • export an output schema for structuredContent
    • export an async handler
    • register the tool in createServer() using inputSchema: schema.shape and outputSchema
    • wrap the handler with withLogging(...)
  • Shared YouTube access lives in src/utils/youtube-api.ts. That module owns:
    • the singleton youtubei.js Innertube client
    • TTL caches for video info, comment pages, and search results
    • per-call deadlines via runWithDeadline (src/utils/abort.ts), linked to the MCP request's extra.signal
  • src/utils/abort.ts keeps the current call's AbortSignal in AsyncLocalStorage. contextFetch is passed to youtubei.js as its fetch, and the transcript library's videoFetch/playerFetch/transcriptFetch hooks also use it, so cancellation aborts real HTTP requests. It turns HTTP 403/429 into ACCESS_BLOCKED before a library can relabel them.
  • src/utils/config.ts reads the YT_* limits once at startup.
  • Transcript features are the notable exception to the youtubei.js path:
    • get_video_transcript and get_transcript_languages use youtube-transcript-plus
    • metadata, comments, and search use the selected provider (youtubei.js by default, or the official YouTube Data API v3 with YT_PROVIDER=api)
  • src/utils/parse-video-id.ts is the normalization layer for every tool that accepts a URL or ID. It supports watch URLs, youtu.be, embed URLs, shorts, live URLs, and raw 11-character IDs.

Read the full file on GitHub · 53 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. 19d ago Changed · +46 tokens per session dc58d5b6f859
  2. 24d ago Changed · +8 lines · +465 tokens per session e09d889c4cf9
  3. 2mo ago First seen · 45 lines · 864 tokens per session scan A 234457ac0553

Subscribe to this mod's changes

youtube-mcp copilot-instructions.md is an instructions file published in the GitHub repository granitebps/youtube-mcp (0 stars, last pushed 19d ago), licensed ISC. It adds 1,375 tokens to every session, about $0.0055 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

youtube-mcp copilot-instructions.md compared with instructions from other repositories

youtube-mcp copilot-instructions.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
youtube-mcp copilot-instructions.mdgranitebps/youtube-mcpInstructions file019d agoISCA1,375GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot